Index: chrome/android/java/res/layout/web_notification_button.xml |
diff --git a/chrome/android/java/res/layout/web_notification_button.xml b/chrome/android/java/res/layout/web_notification_button.xml |
index 37cef2b9eb67556e0f2ef4240db9dcee96994ce2..dd03d6f7e35e1561970e50fdf83fcb6f728d24a7 100644 |
--- a/chrome/android/java/res/layout/web_notification_button.xml |
+++ b/chrome/android/java/res/layout/web_notification_button.xml |
@@ -3,15 +3,41 @@ |
Use of this source code is governed by a BSD-style license that can be |
found in the LICENSE file. --> |
-<Button xmlns:android="http://schemas.android.com/apk/res/android" |
- android:drawablePadding="0dp" |
- android:ellipsize="end" |
- android:gravity="start|center_vertical" |
- android:id="@+id/button" |
- android:layout_height="48dp" |
- android:layout_weight="1" |
+<!-- |
+ Overlays a Button on top of an ImageView. Via a RemoteViews the only way to set an image, apply |
+ a color filter, and have API level 16+ compatibility, is to use an ImageView. There are some |
+ similar methods for Button but they are either hidden, require too high an API level, or both. |
+ |
+ The Button must be on top of the ImageView so that it can be tapped, and so that its text will |
+ be read out by TalkBack. |
+--> |
+<FrameLayout |
+ xmlns:android="http://schemas.android.com/apk/res/android" |
+ xmlns:tools="http://schemas.android.com/tools" |
+ tools:ignore="MergeRootFrame" |
android:layout_width="0dp" |
- android:paddingStart="8dp" |
- android:singleLine="true" |
- android:textSize="13sp" |
- style="@style/WebNotificationButton"/> |
+ android:layout_height="48dp" |
+ android:layout_weight="1"> |
+ |
+ <ImageView |
+ android:id="@+id/button_icon" |
+ android:layout_width="wrap_content" |
+ android:layout_height="match_parent" |
+ android:layout_marginStart="8dp" |
+ android:layout_gravity="start|center_vertical" |
+ android:maxWidth="48dp" |
+ android:contentDescription="@null" |
+ android:scaleType="centerInside"/> |
+ |
+ <Button |
+ android:id="@+id/button" |
+ android:layout_width="match_parent" |
+ android:layout_height="match_parent" |
+ android:ellipsize="end" |
+ android:gravity="start|center_vertical" |
+ android:paddingStart="8dp" |
+ android:singleLine="true" |
+ android:textSize="13sp" |
+ style="@style/WebNotificationButton"/> |
+ |
+</FrameLayout> |