Moving new material views to base class

This commit is contained in:
Jay 2020-05-23 15:52:36 -04:00
parent 2413d4c91e
commit c4f1183dc4
9 changed files with 11 additions and 13 deletions

View File

@ -1,4 +1,4 @@
package eu.kanade.tachiyomi.ui.library
package eu.kanade.tachiyomi.ui.base
import android.content.Context
import android.util.AttributeSet

View File

@ -1,4 +1,4 @@
package eu.kanade.tachiyomi.ui.library
package eu.kanade.tachiyomi.ui.base
import android.animation.ObjectAnimator
import android.animation.ValueAnimator

View File

@ -49,6 +49,7 @@ import eu.kanade.tachiyomi.data.notification.NotificationReceiver
import eu.kanade.tachiyomi.data.notification.Notifications
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
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.category.ManageCategoryDialog
import eu.kanade.tachiyomi.ui.library.LibraryGroup.BY_DEFAULT

View File

@ -16,6 +16,7 @@ import eu.kanade.tachiyomi.data.database.models.Category
import eu.kanade.tachiyomi.data.library.LibraryUpdateService
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
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.util.system.dpToPx
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 sheet = MaterialMenuSheet(
activity,
items,
activity.getString(R.string.sort_by),
sortingMode
activity, items, activity.getString(R.string.sort_by), sortingMode
) { sheet, item ->
onCatSortClicked(category, item)
val nCategory =
(adapter.getItem(adapterPosition) as? LibraryHeaderItem)?.category
val nCategory = (adapter.getItem(adapterPosition) as? LibraryHeaderItem)?.category
val isAscending = nCategory?.isAscending() ?: false
val drawableRes = getSortRes(item, isAscending)
sheet.setDrawable(item, drawableRes)

View File

@ -36,7 +36,7 @@ import eu.kanade.tachiyomi.data.notification.Notifications
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
import eu.kanade.tachiyomi.source.model.Page
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.Error
import eu.kanade.tachiyomi.ui.reader.ReaderPresenter.SetAsCoverResult.Success

View File

@ -76,7 +76,7 @@
android:layout_gravity="center"
android:visibility="gone" />
<eu.kanade.tachiyomi.ui.library.MaterialFastScroll
<eu.kanade.tachiyomi.ui.base.MaterialFastScroll
android:id="@+id/fast_scroller"
android:layout_width="match_parent"
android:layout_height="match_parent"

View File

@ -67,7 +67,7 @@
android:clipToPadding="false"
tools:listitem="@layout/extension_card_header" />
<eu.kanade.tachiyomi.ui.library.MaterialFastScroll
<eu.kanade.tachiyomi.ui.base.MaterialFastScroll
android:id="@+id/fast_scroller"
android:layout_width="match_parent"
android:layout_height="match_parent"

View File

@ -55,7 +55,7 @@
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<eu.kanade.tachiyomi.ui.library.MaterialFastScroll
<eu.kanade.tachiyomi.ui.base.MaterialFastScroll
android:id="@+id/fast_scroller"
android:layout_width="match_parent"
android:layout_height="match_parent"

View File

@ -28,7 +28,7 @@
</FrameLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<eu.kanade.tachiyomi.ui.library.MaterialFastScroll
<eu.kanade.tachiyomi.ui.base.MaterialFastScroll
android:id="@+id/fast_scroller"
android:layout_width="match_parent"
android:layout_height="match_parent"