Skip to content

Commit b023bf8

Browse files
cwrenAndroid (Google) Code Review
authored andcommitted
let default notifications with actions get bigger that 64dp.
Bug: 6377749 Change-Id: I8c92ef67b59f7a44b61926c32480cce6990a1375
1 parent 32ef750 commit b023bf8

File tree

3 files changed

+150
-1
lines changed

3 files changed

+150
-1
lines changed

core/java/android/app/Notification.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1450,7 +1450,7 @@ private RemoteViews makeTickerView() {
14501450
private RemoteViews makeBigContentView() {
14511451
if (mActions.size() == 0) return null;
14521452

1453-
return applyStandardTemplateWithActions(R.layout.notification_template_base);
1453+
return applyStandardTemplateWithActions(R.layout.notification_template_big_base);
14541454
}
14551455

14561456
private RemoteViews generateActionButton(Action action) {
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Copyright (C) 2012 The Android Open Source Project
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
-->
16+
17+
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
18+
xmlns:internal="http://schemas.android.com/apk/prv/res/android"
19+
android:background="@android:drawable/notification_bg"
20+
android:id="@+id/status_bar_latest_event_content"
21+
android:layout_width="match_parent"
22+
android:layout_height="wrap_content"
23+
internal:layout_minHeight="65dp"
24+
internal:layout_maxHeight="unbounded"
25+
>
26+
<ImageView android:id="@+id/icon"
27+
android:layout_width="@dimen/notification_large_icon_width"
28+
android:layout_height="@dimen/notification_large_icon_height"
29+
android:background="@android:drawable/notify_panel_notification_icon_bg_tile"
30+
android:scaleType="center"
31+
/>
32+
<LinearLayout
33+
android:layout_width="match_parent"
34+
android:layout_height="wrap_content"
35+
android:layout_gravity="fill_vertical"
36+
android:layout_marginLeft="@dimen/notification_large_icon_width"
37+
android:minHeight="@dimen/notification_large_icon_height"
38+
android:orientation="vertical"
39+
android:paddingLeft="12dp"
40+
android:paddingRight="12dp"
41+
android:paddingTop="4dp"
42+
android:paddingBottom="4dp"
43+
android:gravity="center_vertical"
44+
>
45+
<LinearLayout
46+
android:id="@+id/line1"
47+
android:layout_width="match_parent"
48+
android:layout_height="wrap_content"
49+
android:orientation="horizontal"
50+
>
51+
<TextView android:id="@+id/title"
52+
android:textAppearance="@style/TextAppearance.StatusBar.EventContent.Title"
53+
android:layout_width="match_parent"
54+
android:layout_height="wrap_content"
55+
android:singleLine="true"
56+
android:ellipsize="marquee"
57+
android:fadingEdge="horizontal"
58+
android:layout_weight="1"
59+
/>
60+
<ViewStub android:id="@+id/time"
61+
android:layout_width="wrap_content"
62+
android:layout_height="wrap_content"
63+
android:layout_gravity="center"
64+
android:layout_weight="0"
65+
android:visibility="gone"
66+
android:layout="@layout/notification_template_part_time"
67+
/>
68+
<ViewStub android:id="@+id/chronometer"
69+
android:layout_width="wrap_content"
70+
android:layout_height="wrap_content"
71+
android:layout_gravity="center"
72+
android:layout_weight="0"
73+
android:visibility="gone"
74+
android:layout="@layout/notification_template_part_chronometer"
75+
/>
76+
</LinearLayout>
77+
<TextView android:id="@+id/text2"
78+
android:textAppearance="@style/TextAppearance.StatusBar.EventContent.Line2"
79+
android:layout_width="match_parent"
80+
android:layout_height="wrap_content"
81+
android:layout_marginTop="-2dp"
82+
android:layout_marginBottom="-2dp"
83+
android:singleLine="true"
84+
android:fadingEdge="horizontal"
85+
android:ellipsize="marquee"
86+
android:visibility="gone"
87+
/>
88+
<TextView android:id="@+id/big_text"
89+
android:textAppearance="@style/TextAppearance.StatusBar.EventContent"
90+
android:layout_width="match_parent"
91+
android:layout_height="wrap_content"
92+
android:singleLine="false"
93+
android:visibility="gone"
94+
/>
95+
<LinearLayout
96+
android:id="@+id/line3"
97+
android:layout_width="match_parent"
98+
android:layout_height="wrap_content"
99+
android:orientation="horizontal"
100+
>
101+
<TextView android:id="@+id/text"
102+
android:textAppearance="@style/TextAppearance.StatusBar.EventContent"
103+
android:layout_width="0dp"
104+
android:layout_height="wrap_content"
105+
android:layout_weight="1"
106+
android:layout_gravity="center"
107+
android:singleLine="true"
108+
android:ellipsize="marquee"
109+
android:fadingEdge="horizontal"
110+
/>
111+
<TextView android:id="@+id/info"
112+
android:textAppearance="@style/TextAppearance.StatusBar.EventContent.Info"
113+
android:layout_width="wrap_content"
114+
android:layout_height="wrap_content"
115+
android:layout_gravity="center"
116+
android:layout_weight="0"
117+
android:singleLine="true"
118+
android:gravity="center"
119+
android:paddingLeft="8dp"
120+
/>
121+
<ImageView android:id="@+id/right_icon"
122+
android:layout_width="wrap_content"
123+
android:layout_height="wrap_content"
124+
android:layout_gravity="center"
125+
android:layout_weight="0"
126+
android:scaleType="center"
127+
android:paddingLeft="8dp"
128+
android:visibility="gone"
129+
android:drawableAlpha="180"
130+
/>
131+
</LinearLayout>
132+
<ProgressBar
133+
android:id="@android:id/progress"
134+
android:layout_width="match_parent"
135+
android:layout_height="wrap_content"
136+
android:visibility="gone"
137+
style="?android:attr/progressBarStyleHorizontal"
138+
/>
139+
<LinearLayout
140+
android:id="@+id/actions"
141+
android:layout_width="match_parent"
142+
android:layout_height="wrap_content"
143+
android:visibility="gone"
144+
>
145+
<!-- actions will be added here -->
146+
</LinearLayout>
147+
</LinearLayout>
148+
</FrameLayout>

core/res/res/values/public.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,6 +1097,7 @@
10971097
<java-symbol type="layout" name="notification_action" />
10981098
<java-symbol type="layout" name="notification_intruder_content" />
10991099
<java-symbol type="layout" name="notification_template_base" />
1100+
<java-symbol type="layout" name="notification_template_big_base" />
11001101
<java-symbol type="layout" name="notification_template_big_picture" />
11011102
<java-symbol type="layout" name="notification_template_big_text" />
11021103
<java-symbol type="layout" name="notification_template_part_time" />

0 commit comments

Comments
 (0)