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:icon="@drawable/ic_debug_icon"
android:title="Send"
app:showAsAction="always" />
app:showAsAction="always"
tools:ignore="AlwaysShowAction" />
</menu>

View file

@ -19,6 +19,9 @@
<issue id="IconExpectedSize" 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">
<!-- Ignore TooManyViews in debug build type -->
<ignore path="**/src/debug/**" />

View file

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

View file

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

View file

@ -1,12 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<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
android:id="@+id/action_delete"
android:icon="@drawable/ic_delete_unsent_messages"
android:title="@string/action_delete"
app:showAsAction="always" />
app:showAsAction="always"
tools:ignore="AlwaysShowAction" />
<item
android:id="@+id/action_mark_as_suggested"