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

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: Documentation tweaks. 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
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..06e9cba27f750ef2e5428af5dff83edbd5c6aeb2 100644
--- a/chrome/android/java/res/layout/web_notification_button.xml
+++ b/chrome/android/java/res/layout/web_notification_button.xml
@@ -3,15 +3,39 @@
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 a Bitmap is on
+ an ImageView. We have a Bitmap because it is the format that can be painted to match the theme,
+ and it is the format we get when loading an image from the network.
+-->
+<FrameLayout
newt (away) 2015/11/16 17:50:08 Do these views need to overlap? If not, can't you
Michael van Ouwerkerk 2015/11/17 12:00:23 I would have preferred to use RemoteViews#setTextV
newt (away) 2015/11/17 20:04:40 Yowsers. Thanks for the run down. I wasn't thinkin
Michael van Ouwerkerk 2015/11/18 14:08:40 Done. I've added some more docs here.
+ 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
newt (away) 2015/11/17 20:04:40 Will there always be button text, or will we have
Michael van Ouwerkerk 2015/11/18 14:08:40 Action (button) titles are required at the JavaScr
+ android:id="@+id/button"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:drawablePadding="0dp"
newt (away) 2015/11/17 20:04:40 not needed? (since there are no compound drawables
Michael van Ouwerkerk 2015/11/18 14:08:40 Done.
+ android:ellipsize="end"
+ android:gravity="start|center_vertical"
+ android:paddingStart="8dp"
+ android:singleLine="true"
+ android:textSize="13sp"
+ style="@style/WebNotificationButton"/>
+
+</FrameLayout>

Powered by Google App Engine
This is Rietveld 408576698