fix crash from navigation setting

This commit is contained in:
jmir1 2022-11-07 20:52:06 +01:00
parent b288adc767
commit 1c2be82196
2 changed files with 2 additions and 4 deletions

View file

@ -37,9 +37,8 @@ class TachiyomiBottomNavigationView @JvmOverloads constructor(
defStyleRes: Int = R.style.Widget_Design_BottomNavigationView,
) : BottomNavigationView(context, attrs, defStyleAttr, defStyleRes) {
private val libraryPreferences: LibraryPreferences = Injekt.get()
override fun inflateMenu(resId: Int) {
val libraryPreferences: LibraryPreferences = Injekt.get()
when (libraryPreferences.bottomNavStyle().get()) {
1 -> super.inflateMenu(R.menu.main_nav_history)
2 -> super.inflateMenu(R.menu.main_nav_no_manga)

View file

@ -13,9 +13,8 @@ class TachiyomiNavigationRailView @JvmOverloads constructor(
attrs: AttributeSet? = null,
) : NavigationRailView(context, attrs) {
private val libraryPreferences: LibraryPreferences = Injekt.get()
override fun inflateMenu(resId: Int) {
val libraryPreferences: LibraryPreferences = Injekt.get()
when (libraryPreferences.bottomNavStyle().get()) {
1 -> super.inflateMenu(R.menu.main_nav_history)
2 -> super.inflateMenu(R.menu.main_nav_no_manga)