OLD | NEW |
1 <?xml version="1.0" encoding="utf-8"?> | 1 <?xml version="1.0" encoding="utf-8"?> |
2 <!-- Copyright 2015 The Chromium Authors. All rights reserved. | 2 <!-- Copyright 2015 The Chromium Authors. All rights reserved. |
3 Use of this source code is governed by a BSD-style license that can be | 3 Use of this source code is governed by a BSD-style license that can be |
4 found in the LICENSE file. --> | 4 found in the LICENSE file. --> |
5 | 5 |
6 <Button xmlns:android="http://schemas.android.com/apk/res/android" | 6 <!-- |
7 android:drawablePadding="0dp" | 7 Overlays a Button on top of an ImageView. Via a RemoteViews the only way to
set an image, apply |
8 android:ellipsize="end" | 8 a color filter, and have API level 16+ compatibility, is to use an ImageView
. There are some |
9 android:gravity="start|center_vertical" | 9 similar methods for Button but they are either hidden, require too high an A
PI level, or both. |
10 android:id="@+id/button" | 10 |
| 11 The Button must be on top of the ImageView so that it can be tapped, and so
that its text will |
| 12 be read out by TalkBack. |
| 13 --> |
| 14 <FrameLayout |
| 15 xmlns:android="http://schemas.android.com/apk/res/android" |
| 16 xmlns:tools="http://schemas.android.com/tools" |
| 17 tools:ignore="MergeRootFrame" |
| 18 android:layout_width="0dp" |
11 android:layout_height="48dp" | 19 android:layout_height="48dp" |
12 android:layout_weight="1" | 20 android:layout_weight="1"> |
13 android:layout_width="0dp" | 21 |
14 android:paddingStart="8dp" | 22 <ImageView |
15 android:singleLine="true" | 23 android:id="@+id/button_icon" |
16 android:textSize="13sp" | 24 android:layout_width="wrap_content" |
17 style="@style/WebNotificationButton"/> | 25 android:layout_height="match_parent" |
| 26 android:layout_marginStart="8dp" |
| 27 android:layout_gravity="start|center_vertical" |
| 28 android:maxWidth="48dp" |
| 29 android:contentDescription="@null" |
| 30 android:scaleType="centerInside"/> |
| 31 |
| 32 <Button |
| 33 android:id="@+id/button" |
| 34 android:layout_width="match_parent" |
| 35 android:layout_height="match_parent" |
| 36 android:ellipsize="end" |
| 37 android:gravity="start|center_vertical" |
| 38 android:paddingStart="8dp" |
| 39 android:singleLine="true" |
| 40 android:textSize="13sp" |
| 41 style="@style/WebNotificationButton"/> |
| 42 |
| 43 </FrameLayout> |
OLD | NEW |