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 -->
|
// SY -->
|
||||||
preferences.bottomBarLabels()
|
preferences.bottomBarLabels()
|
||||||
.asImmediateFlow { setBottomNavLabelVisibility() }
|
.asImmediateFlow { setNavLabelVisibility() }
|
||||||
.launchIn(lifecycleScope)
|
.launchIn(lifecycleScope)
|
||||||
// SY <--
|
// SY <--
|
||||||
}
|
}
|
||||||
@ -590,13 +590,11 @@ class MainActivity : BaseViewBindingActivity<MainActivityBinding>() {
|
|||||||
private val nav: NavigationBarView
|
private val nav: NavigationBarView
|
||||||
get() = binding.bottomNav ?: binding.sideNav!!
|
get() = binding.bottomNav ?: binding.sideNav!!
|
||||||
|
|
||||||
private fun setBottomNavLabelVisibility() {
|
private fun setNavLabelVisibility() {
|
||||||
binding.bottomNav?.let {
|
|
||||||
if (preferences.bottomBarLabels().get()) {
|
if (preferences.bottomBarLabels().get()) {
|
||||||
it.labelVisibilityMode = NavigationBarView.LABEL_VISIBILITY_LABELED
|
nav.labelVisibilityMode = NavigationBarView.LABEL_VISIBILITY_LABELED
|
||||||
} else {
|
} else {
|
||||||
it.labelVisibilityMode = NavigationBarView.LABEL_VISIBILITY_SELECTED
|
nav.labelVisibilityMode = NavigationBarView.LABEL_VISIBILITY_SELECTED
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user