mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
Fix for navigation UI bug (#1220)
This commit is contained in:
parent
2fc279f4ae
commit
a28ee41368
1 changed files with 29 additions and 0 deletions
|
@ -572,6 +572,35 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener, BiometricCa
|
||||||
binding?.apply {
|
binding?.apply {
|
||||||
navRailView.isVisible = isNavVisible && landscape
|
navRailView.isVisible = isNavVisible && landscape
|
||||||
navView.isVisible = isNavVisible && !landscape
|
navView.isVisible = isNavVisible && !landscape
|
||||||
|
|
||||||
|
/**
|
||||||
|
* We need to make sure if we return to a sub-fragment,
|
||||||
|
* the correct navigation item is selected so that it does not
|
||||||
|
* highlight the wrong one in UI.
|
||||||
|
*/
|
||||||
|
when (destination.id) {
|
||||||
|
in listOf(R.id.navigation_downloads, R.id.navigation_download_child) -> {
|
||||||
|
navRailView.menu.findItem(R.id.navigation_downloads).isChecked = true
|
||||||
|
navView.menu.findItem(R.id.navigation_downloads).isChecked = true
|
||||||
|
}
|
||||||
|
in listOf(
|
||||||
|
R.id.navigation_settings,
|
||||||
|
R.id.navigation_subtitles,
|
||||||
|
R.id.navigation_chrome_subtitles,
|
||||||
|
R.id.navigation_settings_player,
|
||||||
|
R.id.navigation_settings_updates,
|
||||||
|
R.id.navigation_settings_ui,
|
||||||
|
R.id.navigation_settings_account,
|
||||||
|
R.id.navigation_settings_providers,
|
||||||
|
R.id.navigation_settings_general,
|
||||||
|
R.id.navigation_settings_extensions,
|
||||||
|
R.id.navigation_settings_plugins,
|
||||||
|
R.id.navigation_test_providers
|
||||||
|
) -> {
|
||||||
|
navRailView.menu.findItem(R.id.navigation_settings).isChecked = true
|
||||||
|
navView.menu.findItem(R.id.navigation_settings).isChecked = true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue