Fix label visibility for tablet ui (#343)
* fix label visibility for tablet ui * change to less code
This commit is contained in:
parent
57dde4c922
commit
b523e47102
@ -302,7 +302,7 @@ class MainActivity : BaseViewBindingActivity<MainActivityBinding>() {
|
||||
|
||||
// SY -->
|
||||
preferences.bottomBarLabels()
|
||||
.asImmediateFlow { setBottomNavLabelVisibility() }
|
||||
.asImmediateFlow { setNavLabelVisibility() }
|
||||
.launchIn(lifecycleScope)
|
||||
// SY <--
|
||||
}
|
||||
@ -590,13 +590,11 @@ class MainActivity : BaseViewBindingActivity<MainActivityBinding>() {
|
||||
private val nav: NavigationBarView
|
||||
get() = binding.bottomNav ?: binding.sideNav!!
|
||||
|
||||
private fun setBottomNavLabelVisibility() {
|
||||
binding.bottomNav?.let {
|
||||
if (preferences.bottomBarLabels().get()) {
|
||||
it.labelVisibilityMode = NavigationBarView.LABEL_VISIBILITY_LABELED
|
||||
} else {
|
||||
it.labelVisibilityMode = NavigationBarView.LABEL_VISIBILITY_SELECTED
|
||||
}
|
||||
private fun setNavLabelVisibility() {
|
||||
if (preferences.bottomBarLabels().get()) {
|
||||
nav.labelVisibilityMode = NavigationBarView.LABEL_VISIBILITY_LABELED
|
||||
} else {
|
||||
nav.labelVisibilityMode = NavigationBarView.LABEL_VISIBILITY_SELECTED
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user