Ignore `AlwaysShowAction` lint issue. Also make it an error, so that developer has to explicitly disable the warning.

This commit is contained in:
Benoit Marty 2022-09-15 15:36:21 +02:00 committed by Benoit Marty
parent 151f6245db
commit 1ff4a5f212
5 changed files with 14 additions and 6 deletions

View File

@ -14,6 +14,7 @@
android:id="@+id/menuDebug2" android:id="@+id/menuDebug2"
android:icon="@drawable/ic_debug_icon" android:icon="@drawable/ic_debug_icon"
android:title="Send" android:title="Send"
app:showAsAction="always" /> app:showAsAction="always"
tools:ignore="AlwaysShowAction" />
</menu> </menu>

View File

@ -19,6 +19,9 @@
<issue id="IconExpectedSize" severity="error" /> <issue id="IconExpectedSize" severity="error" />
<issue id="LocaleFolder" severity="error" /> <issue id="LocaleFolder" severity="error" />
<!-- AlwaysShowAction is considered as an error to force ignoring the issue when detected -->
<issue id="AlwaysShowAction" severity="error" />
<issue id="TooManyViews" severity="warning"> <issue id="TooManyViews" severity="warning">
<!-- Ignore TooManyViews in debug build type --> <!-- Ignore TooManyViews in debug build type -->
<ignore path="**/src/debug/**" /> <ignore path="**/src/debug/**" />

View File

@ -1124,6 +1124,7 @@ class TimelineFragment :
.findViewById<ImageView>(R.id.action_view_icon_image) .findViewById<ImageView>(R.id.action_view_icon_image)
.setColorFilter(colorProvider.getColorFromAttribute(R.attr.colorPrimary)) .setColorFilter(colorProvider.getColorFromAttribute(R.attr.colorPrimary))
actionView.findViewById<TextView>(R.id.cart_badge).setTextOrHide("$widgetsCount") actionView.findViewById<TextView>(R.id.cart_badge).setTextOrHide("$widgetsCount")
@Suppress("AlwaysShowAction")
matrixAppsMenuItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS) matrixAppsMenuItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS)
} }

View File

@ -34,6 +34,7 @@
android:icon="@drawable/ic_filter" android:icon="@drawable/ic_filter"
android:title="@string/home_filter_placeholder_home" android:title="@string/home_filter_placeholder_home"
app:iconTint="?vctr_content_secondary" app:iconTint="?vctr_content_secondary"
app:showAsAction="always" /> app:showAsAction="always"
tools:ignore="AlwaysShowAction" />
</menu> </menu>

View File

@ -1,12 +1,14 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" <menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<item <item
android:id="@+id/action_delete" android:id="@+id/action_delete"
android:icon="@drawable/ic_delete_unsent_messages" android:icon="@drawable/ic_delete_unsent_messages"
android:title="@string/action_delete" android:title="@string/action_delete"
app:showAsAction="always" /> app:showAsAction="always"
tools:ignore="AlwaysShowAction" />
<item <item
android:id="@+id/action_mark_as_suggested" android:id="@+id/action_mark_as_suggested"
@ -18,4 +20,4 @@
android:title="@string/space_mark_as_not_suggested" android:title="@string/space_mark_as_not_suggested"
app:showAsAction="never" /> app:showAsAction="never" />
</menu> </menu>