Add fastscroller to updates and history
This commit is contained in:
parent
8cd27a199d
commit
1cf74a5396
6 changed files with 27 additions and 8 deletions
|
@ -64,17 +64,17 @@ open class ExtensionController :
|
||||||
override fun onViewCreated(view: View) {
|
override fun onViewCreated(view: View) {
|
||||||
super.onViewCreated(view)
|
super.onViewCreated(view)
|
||||||
|
|
||||||
binding.extSwipeRefresh.isRefreshing = true
|
binding.swipeRefresh.isRefreshing = true
|
||||||
binding.extSwipeRefresh.refreshes()
|
binding.swipeRefresh.refreshes()
|
||||||
.onEach { presenter.findAvailableExtensions() }
|
.onEach { presenter.findAvailableExtensions() }
|
||||||
.launchIn(scope)
|
.launchIn(scope)
|
||||||
|
|
||||||
// Initialize adapter, scroll listener and recycler views
|
// Initialize adapter, scroll listener and recycler views
|
||||||
adapter = ExtensionAdapter(this)
|
adapter = ExtensionAdapter(this)
|
||||||
// Create recycler and set adapter.
|
// Create recycler and set adapter.
|
||||||
binding.extRecycler.layoutManager = LinearLayoutManager(view.context)
|
binding.recycler.layoutManager = LinearLayoutManager(view.context)
|
||||||
binding.extRecycler.adapter = adapter
|
binding.recycler.adapter = adapter
|
||||||
binding.extRecycler.addItemDecoration(ExtensionDividerItemDecoration(view.context))
|
binding.recycler.addItemDecoration(ExtensionDividerItemDecoration(view.context))
|
||||||
adapter?.fastScroller = binding.fastScroller
|
adapter?.fastScroller = binding.fastScroller
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -176,7 +176,7 @@ open class ExtensionController :
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setExtensions(extensions: List<ExtensionItem>) {
|
fun setExtensions(extensions: List<ExtensionItem>) {
|
||||||
binding.extSwipeRefresh.isRefreshing = false
|
binding.swipeRefresh.isRefreshing = false
|
||||||
this.extensions = extensions
|
this.extensions = extensions
|
||||||
drawExtensions()
|
drawExtensions()
|
||||||
|
|
||||||
|
|
|
@ -64,6 +64,7 @@ class HistoryController :
|
||||||
adapter = HistoryAdapter(this@HistoryController)
|
adapter = HistoryAdapter(this@HistoryController)
|
||||||
binding.recycler.setHasFixedSize(true)
|
binding.recycler.setHasFixedSize(true)
|
||||||
binding.recycler.adapter = adapter
|
binding.recycler.adapter = adapter
|
||||||
|
adapter?.fastScroller = binding.fastScroller
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onDestroyView(view: View) {
|
override fun onDestroyView(view: View) {
|
||||||
|
|
|
@ -93,6 +93,7 @@ class UpdatesController :
|
||||||
binding.recycler.setHasFixedSize(true)
|
binding.recycler.setHasFixedSize(true)
|
||||||
adapter = UpdatesAdapter(this@UpdatesController)
|
adapter = UpdatesAdapter(this@UpdatesController)
|
||||||
binding.recycler.adapter = adapter
|
binding.recycler.adapter = adapter
|
||||||
|
adapter?.fastScroller = binding.fastScroller
|
||||||
|
|
||||||
binding.recycler.scrollStateChanges()
|
binding.recycler.scrollStateChanges()
|
||||||
.onEach {
|
.onEach {
|
||||||
|
|
|
@ -6,12 +6,12 @@
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<eu.kanade.tachiyomi.widget.ThemedSwipeRefreshLayout
|
<eu.kanade.tachiyomi.widget.ThemedSwipeRefreshLayout
|
||||||
android:id="@+id/ext_swipe_refresh"
|
android:id="@+id/swipe_refresh"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/ext_recycler"
|
android:id="@+id/recycler"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
tools:listitem="@layout/source_main_controller_card_header" />
|
tools:listitem="@layout/source_main_controller_card_header" />
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
@ -12,6 +13,14 @@
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
tools:listitem="@layout/history_item" />
|
tools:listitem="@layout/history_item" />
|
||||||
|
|
||||||
|
<eu.kanade.tachiyomi.ui.library.MaterialFastScroll
|
||||||
|
android:id="@+id/fast_scroller"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_gravity="end"
|
||||||
|
app:fastScrollerBubbleEnabled="false"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<eu.kanade.tachiyomi.widget.EmptyView
|
<eu.kanade.tachiyomi.widget.EmptyView
|
||||||
android:id="@+id/empty_view"
|
android:id="@+id/empty_view"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|
|
@ -19,6 +19,14 @@
|
||||||
android:paddingBottom="@dimen/action_toolbar_list_padding"
|
android:paddingBottom="@dimen/action_toolbar_list_padding"
|
||||||
tools:listitem="@layout/updates_item" />
|
tools:listitem="@layout/updates_item" />
|
||||||
|
|
||||||
|
<eu.kanade.tachiyomi.ui.library.MaterialFastScroll
|
||||||
|
android:id="@+id/fast_scroller"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_gravity="end"
|
||||||
|
app:fastScrollerBubbleEnabled="false"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<eu.kanade.tachiyomi.widget.ActionToolbar
|
<eu.kanade.tachiyomi.widget.ActionToolbar
|
||||||
android:id="@+id/action_toolbar"
|
android:id="@+id/action_toolbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
Reference in a new issue