Skip to content

Commit

Permalink
all: smoother navigation links (fixes #5046) (#5053)
Browse files Browse the repository at this point in the history
Co-authored-by: Gideon Okuro <[email protected]>
Co-authored-by: dogi <[email protected]>
  • Loading branch information
3 people committed Jan 21, 2025
1 parent 49a1381 commit b17f44f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "org.ole.planet.myplanet"
minSdkVersion 26
targetSdkVersion 34
versionCode 2220
versionName "0.22.20"
versionCode 2221
versionName "0.22.21"
ndkVersion '21.3.6528147'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,9 @@ class DashboardActivity : DashboardElementActivity(), OnHomeItemClickListener, N
val b = Bundle()
b.putBoolean("isMyCourseLib", true)
f.arguments = b
openCallFragment(f, "shelf")
val fragmentName = f::class.java.simpleName
val tag = "My$fragmentName"
openCallFragment(f, tag)
}

override fun onDestroy() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,9 @@ class DashboardActivity : DashboardElementActivity(), OnHomeItemClickListener, N
val b = Bundle()
b.putBoolean("isMyCourseLib", true)
f.arguments = b
openCallFragment(f, "shelf")
val fragmentName = f::class.java.simpleName
val tag = "My$fragmentName"
openCallFragment(f, tag)
}

override fun onDestroy() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ abstract class DashboardElementActivity : SyncActivity(), FragmentManager.OnBack
profileDbHandler = UserProfileDbHandler(this)
settings = applicationContext.getSharedPreferences(PREFS_NAME, MODE_PRIVATE)
prefData = SharedPrefManager(this)
supportFragmentManager.addOnBackStackChangedListener(this)
}

fun onClickTabItems(position: Int) {
Expand Down Expand Up @@ -246,13 +247,13 @@ abstract class DashboardElementActivity : SyncActivity(), FragmentManager.OnBack
val f = supportFragmentManager.findFragmentById(R.id.fragment_container)
val fragmentTag = f?.tag
if (f is CoursesFragment) {
if ("shelf" == fragmentTag) {
if ("MyCoursesFragment" == fragmentTag) {
navigationView.menu.findItem(R.id.menu_mycourses).isChecked = true
} else {
navigationView.menu.findItem(R.id.menu_courses).isChecked = true
}
} else if (f is ResourcesFragment) {
if ("shelf" == fragmentTag) {
if ("MyResourcesFragment" == fragmentTag) {
navigationView.menu.findItem(R.id.menu_mylibrary).isChecked = true
} else {
navigationView.menu.findItem(R.id.menu_library).isChecked = true
Expand Down

0 comments on commit b17f44f

Please sign in to comment.