From 2d0862cfc5eca56b3bec4389443fd15de5a1ecc9 Mon Sep 17 00:00:00 2001 From: Konrad Pozniak Date: Sun, 7 Mar 2021 19:29:45 +0100 Subject: [PATCH] fix MainActivity switching to notification tab when opened from recents (#2099) --- app/src/main/java/com/keylesspalace/tusky/MainActivity.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/MainActivity.kt b/app/src/main/java/com/keylesspalace/tusky/MainActivity.kt index 7cbbf0c7..d46d3d56 100644 --- a/app/src/main/java/com/keylesspalace/tusky/MainActivity.kt +++ b/app/src/main/java/com/keylesspalace/tusky/MainActivity.kt @@ -175,8 +175,8 @@ class MainActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidInje } }) } - } else if (accountRequested) { - // user clicked a notification, show notification tab and switch user if necessary + } else if (accountRequested && savedInstanceState == null) { + // user clicked a notification, show notification tab showNotificationTab = true } } @@ -686,7 +686,7 @@ class MainActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidInje glide.asDrawable() .load(avatarUrl) .transform( - RoundedCorners(resources.getDimensionPixelSize(R.dimen.avatar_radius_36dp)) + RoundedCorners(resources.getDimensionPixelSize(R.dimen.avatar_radius_36dp)) ) .apply { if (showPlaceholder) { @@ -700,6 +700,7 @@ class MainActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidInje binding.mainToolbar.navigationIcon = FixedSizeDrawable(placeholder, navIconSize, navIconSize) } } + override fun onResourceReady(resource: Drawable, transition: Transition?) { binding.mainToolbar.navigationIcon = FixedSizeDrawable(resource, navIconSize, navIconSize) }