Albirew/tachiyomi
Archivé
1
0
Bifurcation 0

Add fast scroller in catalogues/extensions lists

Cette révision appartient à :
arkon 2020-03-22 12:43:53 -04:00
Parent 11529f2795
révision b434bc93a3
4 fichiers modifiés avec 36 ajouts et 7 suppressions

Voir le fichier

@ -30,6 +30,7 @@ import eu.kanade.tachiyomi.ui.catalogue.browse.BrowseCatalogueController
import eu.kanade.tachiyomi.ui.catalogue.global_search.CatalogueSearchController import eu.kanade.tachiyomi.ui.catalogue.global_search.CatalogueSearchController
import eu.kanade.tachiyomi.ui.catalogue.latest.LatestUpdatesController import eu.kanade.tachiyomi.ui.catalogue.latest.LatestUpdatesController
import eu.kanade.tachiyomi.ui.setting.SettingsSourcesController import eu.kanade.tachiyomi.ui.setting.SettingsSourcesController
import kotlinx.android.synthetic.main.catalogue_main_controller.fast_scroller
import kotlinx.android.synthetic.main.catalogue_main_controller.recycler import kotlinx.android.synthetic.main.catalogue_main_controller.recycler
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get import uy.kohesive.injekt.api.get
@ -108,6 +109,7 @@ class CatalogueController : NucleusController<CataloguePresenter>(),
recycler.layoutManager = LinearLayoutManager(view.context) recycler.layoutManager = LinearLayoutManager(view.context)
recycler.adapter = adapter recycler.adapter = adapter
recycler.addItemDecoration(SourceDividerItemDecoration(view.context)) recycler.addItemDecoration(SourceDividerItemDecoration(view.context))
adapter?.fastScroller = fast_scroller
requestPermissionsSafe(arrayOf(WRITE_EXTERNAL_STORAGE), 301) requestPermissionsSafe(arrayOf(WRITE_EXTERNAL_STORAGE), 301)
} }

Voir le fichier

@ -77,6 +77,7 @@ open class ExtensionController : NucleusController<ExtensionPresenter>(),
ext_recycler.layoutManager = LinearLayoutManager(view.context) ext_recycler.layoutManager = LinearLayoutManager(view.context)
ext_recycler.adapter = adapter ext_recycler.adapter = adapter
ext_recycler.addItemDecoration(ExtensionDividerItemDecoration(view.context)) ext_recycler.addItemDecoration(ExtensionDividerItemDecoration(view.context))
adapter?.fastScroller = fast_scroller
} }
override fun onDestroyView(view: View) { override fun onDestroyView(view: View) {

Voir le fichier

@ -1,6 +1,7 @@
<?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:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
@ -10,4 +11,13 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
tools:listitem="@layout/catalogue_main_controller_card" /> tools:listitem="@layout/catalogue_main_controller_card" />
<eu.davidea.fastscroller.FastScroller
android:id="@+id/fast_scroller"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:layout_gravity="end"
app:fastScrollerBubbleEnabled="false"
tools:visibility="visible"/>
</FrameLayout> </FrameLayout>

Voir le fichier

@ -1,14 +1,30 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<eu.kanade.tachiyomi.widget.ThemedSwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/ext_swipe_refresh" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView <eu.kanade.tachiyomi.widget.ThemedSwipeRefreshLayout
android:id="@+id/ext_recycler" android:id="@+id/ext_swipe_refresh"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent">
tools:listitem="@layout/extension_card_header" />
</eu.kanade.tachiyomi.widget.ThemedSwipeRefreshLayout> <androidx.recyclerview.widget.RecyclerView
android:id="@+id/ext_recycler"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:listitem="@layout/extension_card_header" />
</eu.kanade.tachiyomi.widget.ThemedSwipeRefreshLayout>
<eu.davidea.fastscroller.FastScroller
android:id="@+id/fast_scroller"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:layout_gravity="end"
app:fastScrollerBubbleEnabled="false"
tools:visibility="visible"/>
</FrameLayout>