Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4145)

Unified Diff: chrome/android/java/res/layout/web_notification_button.xml

Issue 1441723002: Notification custom layouts: paint the button icon for Material. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplify setting a color filter. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilder.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilder.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698