From ad49a028799b669b9abfe82639c78dee8a7a073f Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 14 Nov 2021 11:16:18 -0500 Subject: [PATCH] Address some Android lint warnings --- .../widget/materialdialogs/QuadStateTextView.kt | 3 ++- app/src/main/res/anim/fade_in_long.xml | 9 --------- app/src/main/res/color/nav_selector.xml | 8 -------- .../res/drawable/ic_broken_image_grey_24dp.xml | 10 ---------- .../res/drawable/ic_screen_lock_rotation_24dp.xml | 9 --------- app/src/main/res/layout/navigation_view_group.xml | 3 ++- app/src/main/res/layout/pref_more_header.xml | 4 +++- app/src/main/res/layout/updates_item.xml | 3 +-- app/src/main/res/menu/chapter_selection.xml | 14 +++++++------- app/src/main/res/menu/full_cover.xml | 4 ++-- app/src/main/res/menu/library_selection.xml | 10 +++++----- app/src/main/res/menu/migration.xml | 12 ------------ .../main/res/menu/updates_chapter_selection.xml | 12 ++++++------ app/src/main/res/values-v26/colors.xml | 7 ------- app/src/main/res/values/arrays.xml | 7 ------- app/src/main/res/values/colors.xml | 1 - app/src/main/res/values/dimens.xml | 2 -- app/src/main/res/values/strings.xml | 3 --- 18 files changed, 28 insertions(+), 93 deletions(-) delete mode 100644 app/src/main/res/anim/fade_in_long.xml delete mode 100644 app/src/main/res/color/nav_selector.xml delete mode 100644 app/src/main/res/drawable/ic_broken_image_grey_24dp.xml delete mode 100644 app/src/main/res/drawable/ic_screen_lock_rotation_24dp.xml delete mode 100644 app/src/main/res/menu/migration.xml delete mode 100644 app/src/main/res/values-v26/colors.xml diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/materialdialogs/QuadStateTextView.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/materialdialogs/QuadStateTextView.kt index 6dc81be152..b6b21fccaf 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/materialdialogs/QuadStateTextView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/materialdialogs/QuadStateTextView.kt @@ -4,6 +4,7 @@ import android.content.Context import android.content.res.ColorStateList import android.util.AttributeSet import androidx.appcompat.widget.AppCompatTextView +import androidx.core.widget.TextViewCompat import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.util.system.getThemeColor @@ -31,7 +32,7 @@ class QuadStateTextView @JvmOverloads constructor(context: Context, attrs: Attri context.getThemeColor(R.attr.colorAccent) } if (tint != 0) { - compoundDrawableTintList = ColorStateList.valueOf(tint) + TextViewCompat.setCompoundDrawableTintList(this, ColorStateList.valueOf(tint)) } } diff --git a/app/src/main/res/anim/fade_in_long.xml b/app/src/main/res/anim/fade_in_long.xml deleted file mode 100644 index 659c29f206..0000000000 --- a/app/src/main/res/anim/fade_in_long.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - diff --git a/app/src/main/res/color/nav_selector.xml b/app/src/main/res/color/nav_selector.xml deleted file mode 100644 index 264e2becf8..0000000000 --- a/app/src/main/res/color/nav_selector.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - diff --git a/app/src/main/res/drawable/ic_broken_image_grey_24dp.xml b/app/src/main/res/drawable/ic_broken_image_grey_24dp.xml deleted file mode 100644 index 15b61973a6..0000000000 --- a/app/src/main/res/drawable/ic_broken_image_grey_24dp.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_screen_lock_rotation_24dp.xml b/app/src/main/res/drawable/ic_screen_lock_rotation_24dp.xml deleted file mode 100644 index bc4ecd68e4..0000000000 --- a/app/src/main/res/drawable/ic_screen_lock_rotation_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/layout/navigation_view_group.xml b/app/src/main/res/layout/navigation_view_group.xml index 7622322546..fd44021994 100644 --- a/app/src/main/res/layout/navigation_view_group.xml +++ b/app/src/main/res/layout/navigation_view_group.xml @@ -24,6 +24,7 @@ android:id="@+id/expand_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" - app:tint="?attr/colorOnBackground" /> + app:tint="?attr/colorOnBackground" + tools:ignore="ContentDescription" /> diff --git a/app/src/main/res/layout/pref_more_header.xml b/app/src/main/res/layout/pref_more_header.xml index ae2b209578..c9068c687d 100644 --- a/app/src/main/res/layout/pref_more_header.xml +++ b/app/src/main/res/layout/pref_more_header.xml @@ -1,6 +1,7 @@ + app:tint="?attr/colorOnToolbar" + tools:ignore="ContentDescription" /> diff --git a/app/src/main/res/layout/updates_item.xml b/app/src/main/res/layout/updates_item.xml index 4428075071..4131866512 100644 --- a/app/src/main/res/layout/updates_item.xml +++ b/app/src/main/res/layout/updates_item.xml @@ -49,8 +49,7 @@ app:layout_constraintEnd_toStartOf="@id/chapter_title" app:srcCompat="@drawable/ic_bookmark_24dp" app:tint="?attr/colorAccent" - tools:visibility="visible" - /> + tools:visibility="visible" /> + app:showAsAction="ifRoom" /> + app:showAsAction="ifRoom" /> + app:showAsAction="ifRoom" /> + app:showAsAction="ifRoom" /> + app:showAsAction="ifRoom" /> + app:showAsAction="ifRoom" /> + app:showAsAction="ifRoom" /> diff --git a/app/src/main/res/menu/full_cover.xml b/app/src/main/res/menu/full_cover.xml index 5b339e706a..5bb2bd3824 100644 --- a/app/src/main/res/menu/full_cover.xml +++ b/app/src/main/res/menu/full_cover.xml @@ -7,7 +7,7 @@ android:icon="@drawable/ic_share_24dp" android:title="@string/action_share" app:iconTint="?attr/colorOnToolbar" - app:showAsAction="always" /> + app:showAsAction="ifRoom" /> - \ No newline at end of file + diff --git a/app/src/main/res/menu/library_selection.xml b/app/src/main/res/menu/library_selection.xml index 136ef7840a..d5c0ff4651 100644 --- a/app/src/main/res/menu/library_selection.xml +++ b/app/src/main/res/menu/library_selection.xml @@ -7,34 +7,34 @@ android:icon="@drawable/ic_label_24dp" android:title="@string/action_move_category" app:iconTint="?attr/colorOnToolbar" - app:showAsAction="always" /> + app:showAsAction="ifRoom" /> + app:showAsAction="ifRoom" /> + app:showAsAction="ifRoom" /> + app:showAsAction="ifRoom" /> + app:showAsAction="ifRoom" /> diff --git a/app/src/main/res/menu/migration.xml b/app/src/main/res/menu/migration.xml deleted file mode 100644 index 7c8458196b..0000000000 --- a/app/src/main/res/menu/migration.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - diff --git a/app/src/main/res/menu/updates_chapter_selection.xml b/app/src/main/res/menu/updates_chapter_selection.xml index 1de5670e5d..8fe1d6c629 100644 --- a/app/src/main/res/menu/updates_chapter_selection.xml +++ b/app/src/main/res/menu/updates_chapter_selection.xml @@ -7,41 +7,41 @@ android:icon="@drawable/ic_get_app_24dp" android:title="@string/action_download" app:iconTint="?attr/colorOnToolbar" - app:showAsAction="always" /> + app:showAsAction="ifRoom" /> + app:showAsAction="ifRoom" /> + app:showAsAction="ifRoom" /> + app:showAsAction="ifRoom" /> + app:showAsAction="ifRoom" /> + app:showAsAction="ifRoom" /> diff --git a/app/src/main/res/values-v26/colors.xml b/app/src/main/res/values-v26/colors.xml deleted file mode 100644 index 5c2c719d0a..0000000000 --- a/app/src/main/res/values-v26/colors.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - #BF212121 - - diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 33da89d445..520bb90231 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -55,13 +55,6 @@ @string/zoom_start_center - - 1 - 2 - 3 - 4 - - @string/label_default @string/rotation_free diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index f5cc2e7c86..642fa15e30 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -59,7 +59,6 @@ #000000 #FFFFFF #999999 - #000000 #FC8C5C diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index e5e98b5eea..20ebb38557 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -4,12 +4,10 @@ 0dp - 4dp 4dp 6dp 8dp - 56dp 88dp 72dp diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index baec151597..fb1febd2dd 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -256,7 +256,6 @@ Unofficial Untrusted Uninstall - Available App info Untrusted extension This extension was signed with an untrusted certificate and wasn\'t activated.\n\nA malicious extension could read any login credentials stored in Tachiyomi or execute arbitrary code.\n\nBy trusting this certificate you accept these risks. @@ -282,7 +281,6 @@ Invert dual page split placement If the placement of the dual page split doesn\'t match reading direction Show content in cutout area - Lock orientation Animate page transitions Double tap animation speed Show page number @@ -511,7 +509,6 @@ Username Email address Password - Show password Login Logged in Log out from %1$s?