Moving new material views to base class
This commit is contained in:
parent
2413d4c91e
commit
c4f1183dc4
@ -1,4 +1,4 @@
|
|||||||
package eu.kanade.tachiyomi.ui.library
|
package eu.kanade.tachiyomi.ui.base
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
@ -1,4 +1,4 @@
|
|||||||
package eu.kanade.tachiyomi.ui.library
|
package eu.kanade.tachiyomi.ui.base
|
||||||
|
|
||||||
import android.animation.ObjectAnimator
|
import android.animation.ObjectAnimator
|
||||||
import android.animation.ValueAnimator
|
import android.animation.ValueAnimator
|
@ -49,6 +49,7 @@ import eu.kanade.tachiyomi.data.notification.NotificationReceiver
|
|||||||
import eu.kanade.tachiyomi.data.notification.Notifications
|
import eu.kanade.tachiyomi.data.notification.Notifications
|
||||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||||
import eu.kanade.tachiyomi.data.preference.getOrDefault
|
import eu.kanade.tachiyomi.data.preference.getOrDefault
|
||||||
|
import eu.kanade.tachiyomi.ui.base.MaterialMenuSheet
|
||||||
import eu.kanade.tachiyomi.ui.base.controller.BaseController
|
import eu.kanade.tachiyomi.ui.base.controller.BaseController
|
||||||
import eu.kanade.tachiyomi.ui.category.ManageCategoryDialog
|
import eu.kanade.tachiyomi.ui.category.ManageCategoryDialog
|
||||||
import eu.kanade.tachiyomi.ui.library.LibraryGroup.BY_DEFAULT
|
import eu.kanade.tachiyomi.ui.library.LibraryGroup.BY_DEFAULT
|
||||||
|
@ -16,6 +16,7 @@ import eu.kanade.tachiyomi.data.database.models.Category
|
|||||||
import eu.kanade.tachiyomi.data.library.LibraryUpdateService
|
import eu.kanade.tachiyomi.data.library.LibraryUpdateService
|
||||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||||
import eu.kanade.tachiyomi.source.icon
|
import eu.kanade.tachiyomi.source.icon
|
||||||
|
import eu.kanade.tachiyomi.ui.base.MaterialMenuSheet
|
||||||
import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder
|
import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder
|
||||||
import eu.kanade.tachiyomi.util.system.dpToPx
|
import eu.kanade.tachiyomi.util.system.dpToPx
|
||||||
import eu.kanade.tachiyomi.util.system.getResourceColor
|
import eu.kanade.tachiyomi.util.system.getResourceColor
|
||||||
@ -182,14 +183,10 @@ class LibraryHeaderHolder(val view: View, private val adapter: LibraryCategoryAd
|
|||||||
}
|
}
|
||||||
val sortingMode = category.sortingMode()
|
val sortingMode = category.sortingMode()
|
||||||
val sheet = MaterialMenuSheet(
|
val sheet = MaterialMenuSheet(
|
||||||
activity,
|
activity, items, activity.getString(R.string.sort_by), sortingMode
|
||||||
items,
|
|
||||||
activity.getString(R.string.sort_by),
|
|
||||||
sortingMode
|
|
||||||
) { sheet, item ->
|
) { sheet, item ->
|
||||||
onCatSortClicked(category, item)
|
onCatSortClicked(category, item)
|
||||||
val nCategory =
|
val nCategory = (adapter.getItem(adapterPosition) as? LibraryHeaderItem)?.category
|
||||||
(adapter.getItem(adapterPosition) as? LibraryHeaderItem)?.category
|
|
||||||
val isAscending = nCategory?.isAscending() ?: false
|
val isAscending = nCategory?.isAscending() ?: false
|
||||||
val drawableRes = getSortRes(item, isAscending)
|
val drawableRes = getSortRes(item, isAscending)
|
||||||
sheet.setDrawable(item, drawableRes)
|
sheet.setDrawable(item, drawableRes)
|
||||||
|
@ -36,7 +36,7 @@ import eu.kanade.tachiyomi.data.notification.Notifications
|
|||||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||||
import eu.kanade.tachiyomi.source.model.Page
|
import eu.kanade.tachiyomi.source.model.Page
|
||||||
import eu.kanade.tachiyomi.ui.base.activity.BaseRxActivity
|
import eu.kanade.tachiyomi.ui.base.activity.BaseRxActivity
|
||||||
import eu.kanade.tachiyomi.ui.library.MaterialMenuSheet
|
import eu.kanade.tachiyomi.ui.base.MaterialMenuSheet
|
||||||
import eu.kanade.tachiyomi.ui.reader.ReaderPresenter.SetAsCoverResult.AddToLibraryFirst
|
import eu.kanade.tachiyomi.ui.reader.ReaderPresenter.SetAsCoverResult.AddToLibraryFirst
|
||||||
import eu.kanade.tachiyomi.ui.reader.ReaderPresenter.SetAsCoverResult.Error
|
import eu.kanade.tachiyomi.ui.reader.ReaderPresenter.SetAsCoverResult.Error
|
||||||
import eu.kanade.tachiyomi.ui.reader.ReaderPresenter.SetAsCoverResult.Success
|
import eu.kanade.tachiyomi.ui.reader.ReaderPresenter.SetAsCoverResult.Success
|
||||||
|
@ -76,7 +76,7 @@
|
|||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<eu.kanade.tachiyomi.ui.library.MaterialFastScroll
|
<eu.kanade.tachiyomi.ui.base.MaterialFastScroll
|
||||||
android:id="@+id/fast_scroller"
|
android:id="@+id/fast_scroller"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
@ -67,7 +67,7 @@
|
|||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
tools:listitem="@layout/extension_card_header" />
|
tools:listitem="@layout/extension_card_header" />
|
||||||
|
|
||||||
<eu.kanade.tachiyomi.ui.library.MaterialFastScroll
|
<eu.kanade.tachiyomi.ui.base.MaterialFastScroll
|
||||||
android:id="@+id/fast_scroller"
|
android:id="@+id/fast_scroller"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
@ -55,7 +55,7 @@
|
|||||||
|
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|
||||||
<eu.kanade.tachiyomi.ui.library.MaterialFastScroll
|
<eu.kanade.tachiyomi.ui.base.MaterialFastScroll
|
||||||
android:id="@+id/fast_scroller"
|
android:id="@+id/fast_scroller"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|
||||||
<eu.kanade.tachiyomi.ui.library.MaterialFastScroll
|
<eu.kanade.tachiyomi.ui.base.MaterialFastScroll
|
||||||
android:id="@+id/fast_scroller"
|
android:id="@+id/fast_scroller"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
Loading…
Reference in New Issue
Block a user