From 90571ecaf4b0eb2f2b7a57e9806d7dba3d6aef1f Mon Sep 17 00:00:00 2001 From: Tyoda <55110594+Tyoda@users.noreply.github.com> Date: Tue, 9 Jul 2024 15:48:56 +0200 Subject: [PATCH] Fix show back button when clicking on tagged user (#1579) * Fix show back button when clicking on tagged user Previously a non-working menu button would show in the top left corner when going to a user profile through a user tag (e.g. @Tyoda@lemm.ee). Now a working go back button is shown instead. * Remove default nulls from PersonProfileScreen constructor --------- Co-authored-by: Maarten Vercruysse <67873169+MV-GH@users.noreply.github.com> --- app/src/main/java/com/jerboa/MainActivity.kt | 3 +++ .../java/com/jerboa/ui/components/home/BottomNavScreen.kt | 2 ++ .../com/jerboa/ui/components/person/PersonProfileScreen.kt | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/jerboa/MainActivity.kt b/app/src/main/java/com/jerboa/MainActivity.kt index bf68a999e..563506fdc 100644 --- a/app/src/main/java/com/jerboa/MainActivity.kt +++ b/app/src/main/java/com/jerboa/MainActivity.kt @@ -327,6 +327,7 @@ class MainActivity : AppCompatActivity() { markAsReadOnScroll = appSettings.markAsReadOnScroll, postActionBarMode = appSettings.postActionBarMode.toEnum(), swipeToActionPreset = appSettings.swipeToActionPreset.toEnum(), + padding = null, ) } @@ -362,9 +363,11 @@ class MainActivity : AppCompatActivity() { blurNSFW = appSettings.blurNSFW.toEnum(), showPostLinkPreviews = appSettings.showPostLinkPreviews, drawerState = drawerState, + onBack = appState::popBackStack, markAsReadOnScroll = appSettings.markAsReadOnScroll, postActionBarMode = appSettings.postActionBarMode.toEnum(), swipeToActionPreset = appSettings.swipeToActionPreset.toEnum(), + padding = null, ) } diff --git a/app/src/main/java/com/jerboa/ui/components/home/BottomNavScreen.kt b/app/src/main/java/com/jerboa/ui/components/home/BottomNavScreen.kt index ddd4176a9..094515d88 100644 --- a/app/src/main/java/com/jerboa/ui/components/home/BottomNavScreen.kt +++ b/app/src/main/java/com/jerboa/ui/components/home/BottomNavScreen.kt @@ -329,6 +329,7 @@ fun BottomNavScreen( blurNSFW = appSettings.blurNSFW.toEnum(), showPostLinkPreviews = appSettings.showPostLinkPreviews, drawerState = drawerState, + onBack = null, markAsReadOnScroll = appSettings.markAsReadOnScroll, postActionBarMode = appSettings.postActionBarMode.toEnum(), swipeToActionPreset = appSettings.swipeToActionPreset.toEnum(), @@ -350,6 +351,7 @@ fun BottomNavScreen( blurNSFW = appSettings.blurNSFW.toEnum(), showPostLinkPreviews = appSettings.showPostLinkPreviews, drawerState = drawerState, + onBack = null, markAsReadOnScroll = appSettings.markAsReadOnScroll, postActionBarMode = appSettings.postActionBarMode.toEnum(), swipeToActionPreset = appSettings.swipeToActionPreset.toEnum(), diff --git a/app/src/main/java/com/jerboa/ui/components/person/PersonProfileScreen.kt b/app/src/main/java/com/jerboa/ui/components/person/PersonProfileScreen.kt index 010e82fb8..6ab15fa67 100644 --- a/app/src/main/java/com/jerboa/ui/components/person/PersonProfileScreen.kt +++ b/app/src/main/java/com/jerboa/ui/components/person/PersonProfileScreen.kt @@ -119,9 +119,9 @@ fun PersonProfileScreen( drawerState: DrawerState, markAsReadOnScroll: Boolean, postActionBarMode: PostActionBarMode, - onBack: (() -> Unit)? = null, + onBack: (() -> Unit)?, swipeToActionPreset: SwipeToActionPreset, - padding: PaddingValues? = null, + padding: PaddingValues?, ) { Log.d("jerboa", "got to person screen")