Lint: fixes UseCompatTextViewDrawableXml issues

This commit is contained in:
Benoit Marty 2020-10-08 09:30:25 +02:00
parent e846e30905
commit acbd4c3aba
16 changed files with 42 additions and 35 deletions

View File

@ -27,6 +27,7 @@
<issue id="DisableBaselineAlignment" severity="error" />
<issue id="ScrollViewSize" severity="error" />
<issue id="NegativeMargin" severity="error" />
<issue id="UseCompatTextViewDrawableXml" severity="error" />
<!-- RTL -->
<issue id="RtlEnabled" severity="error" />

View File

@ -1,10 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:drawableBottom="@drawable/stickerpack_rabbit"
android:drawablePadding="16dp"
android:gravity="center_horizontal"
android:maxWidth="300dp"
android:paddingTop="16dp"
android:text="@string/no_sticker_application_dialog_content" />
android:text="@string/no_sticker_application_dialog_content"
app:drawableBottomCompat="@drawable/stickerpack_rabbit" />

View File

@ -54,12 +54,12 @@
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:drawableStart="@drawable/ic_alert_triangle"
android:drawablePadding="4dp"
android:drawableTint="@color/riotx_destructive_accent"
android:gravity="center_vertical"
android:text="@string/bootstrap_dont_reuse_pwd"
android:textSize="12sp" />
android:textSize="12sp"
app:drawableStartCompat="@drawable/ic_alert_triangle"
app:drawableTint="@color/riotx_destructive_accent" />
</com.google.android.material.textfield.TextInputLayout>

View File

@ -83,8 +83,8 @@
android:layout_marginEnd="16dp"
android:text="@string/reset_secure_backup_warning"
android:textColor="@color/riotx_destructive_accent"
android:drawableStart="@drawable/ic_warning_badge"
android:drawablePadding="4dp"
android:textSize="14sp" />
android:textSize="14sp"
app:drawableStartCompat="@drawable/ic_warning_badge" />
</LinearLayout>

View File

@ -16,16 +16,16 @@
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:drawableStart="@drawable/ic_alert_triangle"
android:drawablePadding="8dp"
android:drawableTint="?riot_primary_text_color"
android:text="@string/secure_backup_reset_all"
android:textColor="?riotx_text_primary"
android:textSize="20sp"
android:textStyle="bold"
android:tint="?riot_primary_text_color"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
app:drawableTint="?riot_primary_text_color"
app:drawableStartCompat="@drawable/ic_alert_triangle" />
<TextView
android:id="@+id/ssss_reset_all_description"
@ -48,14 +48,14 @@
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:drawableStart="@drawable/ic_smartphone"
android:drawablePadding="8dp"
android:gravity="center_vertical"
android:textSize="17sp"
android:visibility="gone"
app:layout_constraintTop_toBottomOf="@id/ssss_reset_all_description"
tools:text="Show 2 devices you can verify with now"
tools:visibility="visible" />
tools:visibility="visible"
app:drawableStartCompat="@drawable/ic_smartphone" />
<TextView
android:id="@+id/ssss_reset_text3"

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/messageStatusInfo"
android:layout_width="match_parent"
@ -24,10 +25,10 @@
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:layout_weight="1"
android:drawableStart="@drawable/ic_warning_badge"
android:drawablePadding="4dp"
android:textColor="?riotx_text_secondary"
android:textStyle="bold"
tools:text="@string/unable_to_send_message" />
tools:text="@string/unable_to_send_message"
app:drawableStartCompat="@drawable/ic_warning_badge" />
</LinearLayout>

View File

@ -65,9 +65,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:layout_marginEnd="8dp"
android:drawableStart="@drawable/ic_user"
android:drawablePadding="8dp"
android:drawableTint="?riotx_text_secondary"
android:gravity="center_vertical"
android:minWidth="56dp"
android:textColor="?riotx_text_secondary"
@ -75,7 +73,9 @@
app:layout_constraintBottom_toTopOf="@+id/itemPublicRoomBottomSeparator"
app:layout_constraintStart_toStartOf="@+id/itemPublicRoomName"
app:layout_constraintTop_toBottomOf="@+id/itemPublicRoomTopic"
tools:text="148" />
tools:text="148"
app:drawableTint="?riotx_text_secondary"
app:drawableStartCompat="@drawable/ic_user" />
<TextView
android:id="@+id/itemPublicRoomAlias"

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/roomCategoryRootView"
android:layout_width="match_parent"
@ -21,14 +22,14 @@
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
tools:drawableEnd="@drawable/ic_expand_more_white"
android:drawableTint="?riotx_text_secondary"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
android:textColor="?riotx_text_secondary"
android:textSize="14sp"
android:textStyle="bold"
tools:text="@string/room_participants_header_direct_chats" />
tools:text="@string/room_participants_header_direct_chats"
app:drawableTint="?riotx_text_secondary" />
<im.vector.app.features.home.room.list.UnreadCounterBadgeView
android:id="@+id/roomCategoryUnreadCounterBadgeView"

View File

@ -36,7 +36,6 @@
android:layout_marginStart="@dimen/layout_horizontal_margin"
android:layout_marginTop="12dp"
android:layout_marginEnd="20dp"
android:drawableEnd="@drawable/ic_arrow_right"
android:drawablePadding="8dp"
android:duplicateParentState="true"
android:ellipsize="end"
@ -49,7 +48,8 @@
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toEndOf="@id/roomInvitationAvatarImageView"
app:layout_constraintTop_toTopOf="parent"
tools:text="@sample/matrix.json/data/displayName" />
tools:text="@sample/matrix.json/data/displayName"
app:drawableEndCompat="@drawable/ic_arrow_right" />
<TextView
android:id="@+id/roomInvitationSubTitle"

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
@ -12,11 +13,11 @@
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
android:background="?attr/riotx_keys_backup_banner_accent_color"
android:drawableStart="@drawable/error"
android:drawablePadding="16dp"
android:gravity="center|start"
android:minHeight="80dp"
android:padding="16dp"
tools:text="This room is continuation…" />
tools:text="This room is continuation…"
app:drawableStartCompat="@drawable/error" />
</FrameLayout>

View File

@ -25,13 +25,13 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="8dp"
android:drawableStart="@drawable/ic_clock"
android:drawablePadding="2dp"
android:gravity="start"
android:text="@string/notice_crypto_unable_to_decrypt_merged"
android:textColor="?riotx_text_secondary"
android:textSize="15sp"
app:drawableTint="?riotx_text_secondary" />
app:drawableTint="?riotx_text_secondary"
app:drawableStartCompat="@drawable/ic_clock" />
<TextView

View File

@ -2,10 +2,10 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableStart="@drawable/ic_trash_16"
android:drawablePadding="8dp"
android:gravity="center_vertical"
android:text="@string/event_redacted"
android:textColor="?riotx_text_primary_body_contrast"
android:textSize="14sp"
app:drawableTint="?riotx_text_primary_body_contrast" />
app:drawableTint="?riotx_text_primary_body_contrast"
app:drawableStartCompat="@drawable/ic_trash_16" />

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -11,13 +12,13 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:drawableStart="@drawable/ic_shield_black"
android:drawablePadding="6dp"
android:gravity="center"
android:textColor="?riotx_text_primary"
android:textSize="15sp"
android:textStyle="bold"
tools:text="@string/verification_request" />
tools:text="@string/verification_request"
app:drawableStartCompat="@drawable/ic_shield_black" />
<TextView

View File

@ -14,7 +14,6 @@
android:layout_height="wrap_content"
android:layout_toStartOf="@id/returnToCallButton"
android:background="?attr/selectableItemBackground"
android:drawableStart="@drawable/ic_call"
android:drawablePadding="10dp"
android:gravity="center_vertical"
android:paddingStart="16dp"
@ -23,7 +22,8 @@
android:paddingBottom="12dp"
android:text="@string/active_call"
android:textColor="@color/white"
app:drawableTint="@color/white" />
app:drawableTint="@color/white"
app:drawableStartCompat="@drawable/ic_call" />
<com.google.android.material.button.MaterialButton
android:id="@+id/returnToCallButton"

View File

@ -12,7 +12,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toStartOf="@id/deleteWidgetButton"
android:drawableStart="@drawable/ic_call"
android:drawablePadding="10dp"
android:gravity="center_vertical"
android:paddingStart="16dp"
@ -22,7 +21,8 @@
android:textColor="@color/white"
android:textColorLink="@color/white"
app:drawableTint="@color/white"
tools:text="@string/ongoing_conference_call" />
tools:text="@string/ongoing_conference_call"
app:drawableStartCompat="@drawable/ic_call" />
<com.google.android.material.button.MaterialButton
android:id="@+id/deleteWidgetButton"

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -12,7 +13,6 @@
android:layout_height="wrap_content"
android:layout_toStartOf="@+id/closeJumpToReadMarkerView"
android:background="?attr/selectableItemBackground"
android:drawableStart="@drawable/arrow_up_circle"
android:drawablePadding="10dp"
android:gravity="center_vertical"
android:paddingStart="16dp"
@ -20,7 +20,8 @@
android:paddingEnd="16dp"
android:paddingBottom="12dp"
android:text="@string/room_jump_to_first_unread"
android:textColor="@color/white" />
android:textColor="@color/white"
app:drawableStartCompat="@drawable/arrow_up_circle" />
<ImageView
android:id="@+id/closeJumpToReadMarkerView"