Library filter UI change (#1211)
* similar library filter to catalog filter * removed some commented out code * code review changes * fixed accidentally removing title
This commit is contained in:
committed by
Bram van de Kerkhof
parent
c1845aec83
commit
6c1453eb54
@@ -35,7 +35,6 @@ import eu.kanade.tachiyomi.ui.manga.MangaController
|
||||
import eu.kanade.tachiyomi.ui.migration.MigrationController
|
||||
import eu.kanade.tachiyomi.util.inflate
|
||||
import eu.kanade.tachiyomi.util.toast
|
||||
import eu.kanade.tachiyomi.widget.DrawerSwipeCloseListener
|
||||
import kotlinx.android.synthetic.main.library_controller.*
|
||||
import kotlinx.android.synthetic.main.main_activity.*
|
||||
import rx.Subscription
|
||||
@@ -177,11 +176,8 @@ class LibraryController(
|
||||
|
||||
override fun createSecondaryDrawer(drawer: DrawerLayout): ViewGroup {
|
||||
val view = drawer.inflate(R.layout.library_drawer) as LibraryNavigationView
|
||||
drawerListener = DrawerSwipeCloseListener(drawer, view).also {
|
||||
drawer.addDrawerListener(it)
|
||||
}
|
||||
navView = view
|
||||
drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED, Gravity.END)
|
||||
drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED, Gravity.END)
|
||||
|
||||
navView?.onGroupClicked = { group ->
|
||||
when (group) {
|
||||
@@ -196,8 +192,6 @@ class LibraryController(
|
||||
}
|
||||
|
||||
override fun cleanupSecondaryDrawer(drawer: DrawerLayout) {
|
||||
drawerListener?.let { drawer.removeDrawerListener(it) }
|
||||
drawerListener = null
|
||||
navView = null
|
||||
}
|
||||
|
||||
@@ -278,7 +272,7 @@ class LibraryController(
|
||||
activity?.invalidateOptionsMenu()
|
||||
}
|
||||
|
||||
private fun onDownloadBadgeChanged(){
|
||||
private fun onDownloadBadgeChanged() {
|
||||
presenter.requestDownloadBadgesUpdate()
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import uy.kohesive.injekt.injectLazy
|
||||
* The navigation view shown in a drawer with the different options to show the library.
|
||||
*/
|
||||
class LibraryNavigationView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null)
|
||||
: ExtendedNavigationView(context, attrs) {
|
||||
: ExtendedNavigationView(context, attrs) {
|
||||
|
||||
/**
|
||||
* Preferences helper.
|
||||
@@ -25,7 +25,7 @@ class LibraryNavigationView @JvmOverloads constructor(context: Context, attrs: A
|
||||
/**
|
||||
* List of groups shown in the view.
|
||||
*/
|
||||
private val groups = listOf(FilterGroup(), SortGroup(), DisplayGroup(), BadgeGroup())
|
||||
private val groups = listOf(FilterGroup(), SortGroup(), DisplayGroup(), BadgeGroup())
|
||||
|
||||
/**
|
||||
* Adapter instance.
|
||||
@@ -62,7 +62,6 @@ class LibraryNavigationView @JvmOverloads constructor(context: Context, attrs: A
|
||||
onGroupClicked(item.group)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -99,7 +98,6 @@ class LibraryNavigationView @JvmOverloads constructor(context: Context, attrs: A
|
||||
|
||||
adapter.notifyItemChanged(item)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -169,7 +167,7 @@ class LibraryNavigationView @JvmOverloads constructor(context: Context, attrs: A
|
||||
inner class BadgeGroup : Group {
|
||||
private val downloadBadge = Item.CheckboxGroup(R.string.action_display_download_badge, this)
|
||||
override val header = null
|
||||
override val footer= null
|
||||
override val footer = null
|
||||
override val items = listOf(downloadBadge)
|
||||
override fun initModels() {
|
||||
downloadBadge.checked = preferences.downloadBadge().getOrDefault()
|
||||
@@ -215,7 +213,5 @@ class LibraryNavigationView @JvmOverloads constructor(context: Context, attrs: A
|
||||
|
||||
item.group.items.forEach { adapter.notifyItemChanged(it) }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user