More attr cleanup

This commit is contained in:
Jay 2020-04-19 20:46:53 -04:00
parent 776e75cb6c
commit 2fa1c71fbd
25 changed files with 26 additions and 45 deletions

View File

@ -2,9 +2,7 @@ package eu.kanade.tachiyomi.ui.extension
import eu.davidea.flexibleadapter.FlexibleAdapter
import eu.davidea.flexibleadapter.items.IFlexible
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.ui.extension.ExtensionAdapter.OnButtonClickListener
import eu.kanade.tachiyomi.util.system.getResourceColor
/**
* Adapter that holds the catalogue cards.
@ -14,9 +12,6 @@ import eu.kanade.tachiyomi.util.system.getResourceColor
class ExtensionAdapter(val listener: OnButtonClickListener) :
FlexibleAdapter<IFlexible<*>>(null, listener, true) {
val cardBackground = (listener as ExtensionBottomSheet).context.getResourceColor(R.attr
.background_card)
init {
setDisplayHeadersAtStartUp(true)
}

View File

@ -2,8 +2,6 @@ package eu.kanade.tachiyomi.ui.migration
import eu.davidea.flexibleadapter.FlexibleAdapter
import eu.davidea.flexibleadapter.items.IFlexible
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.util.system.getResourceColor
/**
* Adapter that holds the catalogue cards.
@ -13,8 +11,6 @@ import eu.kanade.tachiyomi.util.system.getResourceColor
class SourceAdapter(val controller: MigrationController) :
FlexibleAdapter<IFlexible<*>>(null, controller, true) {
val cardBackground = controller.activity!!.getResourceColor(R.attr.background_card)
private var items: List<IFlexible<*>>? = null
init {

View File

@ -2,8 +2,6 @@ package eu.kanade.tachiyomi.ui.source
import eu.davidea.flexibleadapter.FlexibleAdapter
import eu.davidea.flexibleadapter.items.IFlexible
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.util.system.getResourceColor
/**
* Adapter that holds the catalogue cards.
@ -13,8 +11,6 @@ import eu.kanade.tachiyomi.util.system.getResourceColor
class SourceAdapter(val controller: SourceController) :
FlexibleAdapter<IFlexible<*>>(null, controller, true) {
val cardBackground = controller.activity!!.getResourceColor(R.attr.background_card)
init {
setDisplayHeadersAtStartUp(true)
}

View File

@ -15,7 +15,7 @@
</item>
<item android:id="@android:id/mask">
<color android:color="?attr/background_card" />
<color android:color="?md_background_color" />
</item>
</selector>
</item>

View File

@ -5,7 +5,7 @@
android:id="@+id/chapter_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?selectable_list_drawable"
android:background="@drawable/list_item_selector"
android:tooltipText="@string/sort_and_filter"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"

View File

@ -55,7 +55,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
android:background="?attr/selectable_list_drawable"
android:background="@drawable/list_item_selector"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

View File

@ -9,7 +9,7 @@
android:id="@+id/card"
android:layout_width="match_parent"
android:layout_height="64dp"
android:background="?attr/selectable_list_drawable">
android:background="@drawable/list_item_selector">
<ImageView
android:id="@+id/edit_button"

View File

@ -346,7 +346,7 @@
android:layout_height="wrap_content"
android:tooltipText="@string/sort_and_filter"
app:layout_constraintEnd_toEndOf="parent"
android:background="?selectable_list_drawable"
android:background="@drawable/list_item_selector"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/start_reading_button">

View File

@ -6,7 +6,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:id="@+id/constraint_layout"
android:background="?attr/selectable_list_drawable"
android:background="@drawable/list_item_selector"
android:minHeight="@dimen/material_component_lists_single_line_with_avatar_height">
<com.google.android.material.card.MaterialCardView

View File

@ -10,7 +10,7 @@
android:id="@+id/card"
android:layout_width="match_parent"
android:layout_height="@dimen/material_component_lists_two_line_height"
android:background="?attr/selectable_list_drawable">
android:background="@drawable/list_item_selector">
<ImageView
android:id="@+id/edit_button"

View File

@ -5,7 +5,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="@dimen/material_component_lists_single_line_with_avatar_height"
android:background="?attr/selectable_list_drawable">
android:background="@drawable/list_item_selector">
<ImageView
android:id="@+id/edit_button"

View File

@ -6,7 +6,7 @@
android:layout_height="60dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:background="?attr/selectable_list_drawable"
android:background="@drawable/list_item_selector"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

View File

@ -30,7 +30,7 @@
android:id="@+id/front_view"
android:layout_width="match_parent"
android:layout_height="@dimen/material_component_lists_two_line_height"
android:background="?attr/selectable_list_drawable">
android:background="@drawable/list_item_selector">
<ImageView
android:id="@+id/manga_cover"

View File

@ -33,7 +33,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="?attr/selectable_list_drawable"
android:background="@drawable/list_item_selector"
android:minHeight="@dimen/material_component_lists_single_line_with_avatar_height">
<FrameLayout

View File

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
<com.google.android.material.card.MaterialCardView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/history_card"
style="@style/Theme.Widget.CardView.Item"
android:padding="0dp">
@ -70,4 +72,4 @@
</LinearLayout>
</androidx.cardview.widget.CardView>
</com.google.android.material.card.MaterialCardView>

View File

@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/recent_item"
android:background="?selectable_list_drawable"
android:background="@drawable/list_item_selector"
android:layout_width="match_parent"
android:layout_height="wrap_content">

View File

@ -5,7 +5,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?attr/selectable_list_drawable"
android:background="@drawable/list_item_selector"
android:orientation="vertical"
android:paddingBottom="8dp"
android:paddingEnd="4dp"

View File

@ -49,7 +49,7 @@
android:id="@+id/card"
android:layout_width="match_parent"
android:layout_height="@dimen/material_component_lists_two_line_height"
android:background="?attr/selectable_list_drawable">
android:background="@drawable/list_item_selector">
<ImageView
android:id="@+id/edit_button"

View File

@ -11,7 +11,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?attr/background_card">
android:background="?md_background_color">
<FrameLayout
android:id="@+id/logo_container"

View File

@ -43,7 +43,7 @@
android:dividerHeight="10dp"
android:footerDividersEnabled="true"
android:headerDividersEnabled="true"
android:listSelector="?attr/selectable_list_drawable"
android:listSelector="@drawable/list_item_selector"
android:paddingBottom="4dp"
android:paddingTop="4dp"
android:scrollbars="none"

View File

@ -8,7 +8,7 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="216dp"
android:background="?attr/selectable_list_drawable"
android:background="@drawable/list_item_selector"
android:orientation="horizontal">
<ImageView

View File

@ -18,11 +18,6 @@
<item name="android:colorBackground">@color/md_black_1000</item>
<item name="android:statusBarColor">@color/blackStatus</item>
<!-- Custom Attributes-->
<item name="selectable_list_drawable">@drawable/list_item_selector</item>
<item name="background_card">@color/colorAmoledPrimary</item>
<!-- Material Dialog colors -->
<item name="md_color_title">@color/textColorPrimary</item>
<item name="md_color_content">@color/textColorSecondary</item>

View File

@ -23,6 +23,4 @@
<attr name="actionBarTintColor" format="color"/>
<attr name="tabBarIconColor" format="reference|integer"/>
<attr name="tabBarIconInactive" format="reference|integer"/>
<attr name="selectable_list_drawable" format="reference|integer" />
<attr name="background_card" format="reference|integer"/>
</resources>

View File

@ -150,7 +150,7 @@
</item>
<item name="android:layout_marginEnd">@dimen/material_component_cards_space_between_cards
</item>
<item name="cardBackgroundColor">?attr/background_card</item>
<item name="cardBackgroundColor">?md_background_color</item>
<item name="cardElevation">2dp</item>
</style>
@ -178,7 +178,7 @@
<style name="Theme.Widget.SpinnerItem" parent="Widget.AppCompat.DropDownItem.Spinner">
<item name="android:textColor">?android:textColorPrimary</item>
<item name="android:background">?attr/selectable_list_drawable</item>
<item name="android:background">@drawable/list_item_selector</item>
</style>
<!-- set the rounded drawable as background to your bottom sheet -->

View File

@ -26,9 +26,6 @@
<item name="android:divider">@color/divider</item>
<item name="android:listDivider">@drawable/line_divider</item>
<item name="actionModeStyle">@style/CustomActionModeStyle</item>
<item name="tabBarIconColor">?colorAccent</item>
<item name="tabBarIconInactive">@color/colorPrimaryInactive</item>
<!-- Themes -->
<item name="windowActionModeOverlay">true</item>
@ -36,8 +33,9 @@
<item name="preferenceTheme">@style/PreferenceThemeOverlay</item>
<!-- Custom Attributes-->
<item name="selectable_list_drawable">@drawable/list_item_selector</item>
<item name="actionBarTintColor">@color/textColorPrimary</item>
<item name="tabBarIconColor">?colorAccent</item>
<item name="tabBarIconInactive">@color/colorPrimaryInactive</item>
<item name="android:statusBarColor">@color/mainStatus</item>
<item name="android:navigationBarColor">#B3000000</item>
@ -50,6 +48,7 @@
<item name="md_background_color">@color/dialog</item>
<item name="md_button_casing">literal</item>
<item name="md_corner_radius">16dp</item>
<item name="android:windowLightStatusBar">true</item>
<item name="android:windowLightNavigationBar" tools:targetApi="27">true</item>
</style>