From e98d10958ab9616dd9b8d6099965ab17b2977f9a Mon Sep 17 00:00:00 2001 From: Avinash Sharma <133222313+Avinash-Codes@users.noreply.github.com> Date: Fri, 20 Dec 2024 01:06:09 +0530 Subject: [PATCH] all: smoother main navigation icons (fixes #4891) (#4892) Co-authored-by: dogi --- app/build.gradle | 4 ++-- .../org/ole/planet/myplanet/ui/dashboard/DashboardActivity.kt | 3 +++ .../planet/myplanet/ui/dashboard/DashboardActivity.kt.lite | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index e489f37262..ffad4c8dd7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "org.ole.planet.myplanet" minSdkVersion 26 targetSdkVersion 34 - versionCode 2143 - versionName "0.21.43" + versionCode 2144 + versionName "0.21.44" ndkVersion '21.3.6528147' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/DashboardActivity.kt b/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/DashboardActivity.kt index 80d1e3d79d..8db9937a3a 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/DashboardActivity.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/DashboardActivity.kt @@ -735,6 +735,7 @@ class DashboardActivity : DashboardElementActivity(), OnHomeItemClickListener, N .addDrawerItems(*drawerItems).addStickyDrawerItems(*drawerItemsFooter) .withOnDrawerItemClickListener { _: View?, _: Int, drawerItem: IDrawerItem<*, *>? -> if (drawerItem != null) { + result?.setSelection(drawerItem.identifier, false) // Update selected state menuAction((drawerItem as Nameable<*>).name.textRes) } false @@ -849,6 +850,7 @@ class DashboardActivity : DashboardElementActivity(), OnHomeItemClickListener, N } override fun onNavigationItemSelected(item: MenuItem): Boolean { + item.isChecked = true when (item.itemId) { R.id.menu_library -> { openCallFragment(ResourcesFragment()) @@ -877,6 +879,7 @@ class DashboardActivity : DashboardElementActivity(), OnHomeItemClickListener, N openCallFragment(BellDashboardFragment()) } } + item.isChecked = true return true } diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/DashboardActivity.kt.lite b/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/DashboardActivity.kt.lite index ff850517f4..f14096eeae 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/DashboardActivity.kt.lite +++ b/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/DashboardActivity.kt.lite @@ -735,6 +735,7 @@ class DashboardActivity : DashboardElementActivity(), OnHomeItemClickListener, N .addDrawerItems(*drawerItems).addStickyDrawerItems(*drawerItemsFooter) .withOnDrawerItemClickListener { _: View?, _: Int, drawerItem: IDrawerItem<*, *>? -> if (drawerItem != null) { + result?.setSelection(drawerItem.identifier, false) // Update selected state menuAction((drawerItem as Nameable<*>).name.textRes) } false @@ -849,6 +850,7 @@ class DashboardActivity : DashboardElementActivity(), OnHomeItemClickListener, N } override fun onNavigationItemSelected(item: MenuItem): Boolean { + item.isChecked = true when (item.itemId) { R.id.menu_library -> { openCallFragment(ResourcesFragment()) @@ -877,6 +879,7 @@ class DashboardActivity : DashboardElementActivity(), OnHomeItemClickListener, N openCallFragment(BellDashboardFragment()) } } + item.isChecked = true return true }