mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 06:10:31 +05:30
cleanup
This commit is contained in:
parent
d9c7e937c6
commit
1ff7306063
@ -1,19 +0,0 @@
|
||||
package com.github.libretube.constants
|
||||
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.obj.NavBarItem
|
||||
|
||||
val navBarItems = listOf(
|
||||
NavBarItem(
|
||||
R.id.homeFragment,
|
||||
R.string.startpage
|
||||
),
|
||||
NavBarItem(
|
||||
R.id.subscriptionsFragment,
|
||||
R.string.subscriptions
|
||||
),
|
||||
NavBarItem(
|
||||
R.id.libraryFragment,
|
||||
R.string.library
|
||||
)
|
||||
)
|
@ -2,7 +2,6 @@ package com.github.libretube.dialogs
|
||||
|
||||
import android.app.Dialog
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import androidx.recyclerview.widget.ItemTouchHelper
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
@ -64,6 +63,8 @@ class NavBarOptionsDialog : DialogFragment() {
|
||||
.setView(binding.root)
|
||||
.setPositiveButton(R.string.okay) { _, _ ->
|
||||
NavBarHelper.setNavBarItems(adapter.items)
|
||||
RequireRestartDialog()
|
||||
.show(requireParentFragment().childFragmentManager, null)
|
||||
}
|
||||
.setNegativeButton(R.string.cancel, null)
|
||||
.show()
|
||||
|
@ -1,19 +1,33 @@
|
||||
package com.github.libretube.util
|
||||
|
||||
import android.util.Log
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import com.fasterxml.jackson.core.type.TypeReference
|
||||
import com.fasterxml.jackson.databind.ObjectMapper
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.constants.PreferenceKeys
|
||||
import com.github.libretube.constants.navBarItems
|
||||
import com.github.libretube.extensions.TAG
|
||||
import com.github.libretube.obj.NavBarItem
|
||||
import com.google.android.material.bottomnavigation.BottomNavigationView
|
||||
import com.google.android.material.navigation.NavigationBarView
|
||||
|
||||
object NavBarHelper {
|
||||
val preferenceKey = "nav_bar_items"
|
||||
|
||||
val defaultNavBarItems = listOf(
|
||||
NavBarItem(
|
||||
R.id.homeFragment,
|
||||
R.string.startpage
|
||||
),
|
||||
NavBarItem(
|
||||
R.id.subscriptionsFragment,
|
||||
R.string.subscriptions
|
||||
),
|
||||
NavBarItem(
|
||||
R.id.libraryFragment,
|
||||
R.string.library
|
||||
)
|
||||
)
|
||||
|
||||
val mapper = ObjectMapper()
|
||||
|
||||
fun getNavBarItems(): List<NavBarItem> {
|
||||
@ -27,7 +41,7 @@ object NavBarHelper {
|
||||
type
|
||||
)
|
||||
} catch (e: Exception) {
|
||||
return navBarItems
|
||||
return defaultNavBarItems
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user