Files
frameworks_base/tests/StatusBar/res/layout/notification_builder_test.xml
Daniel Sandler a3850b6839 Improve handling of small largeIcons in tablet ticker.
The tablet system bar is too short for a full notification
row, but it will show the largeIcon of a new notification in
its full frame, intruding into the main application content
rectangle a bit. This is a good thing---the notifications
really pop out at you---but it looks a little odd if the
largeIcon is actually *small*: the icon is vertically
centered in the larger (invisible) rectangle, making it look
poorly centered on the system bar.

This change will detect short largeIcons and center them in
the system bar's height instead. Additionally, it applies
the same ticker background all the way to the left
underneath largeIcons that are not full-frame (and therefore
have transparent regions).

Bug: 5708907
Bug: 5560485
Change-Id: I32af45632df164c58fb960110063dbaa08b5536c
2011-12-07 15:53:00 -05:00

825 lines
32 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
>
<LinearLayout
android:layout_width="120dp"
android:layout_height="match_parent"
android:orientation="vertical"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<Button
style="@style/IdButton.Minus"
android:id="@+id/clear_1"
/>
<TextView
style="@style/IdTitle"
android:text="1"
/>
<Button
style="@style/IdButton.Plus"
android:id="@+id/notify_1"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<Button
style="@style/IdButton.Minus"
android:id="@+id/clear_2"
/>
<TextView
style="@style/IdTitle"
android:text="2"
/>
<Button
style="@style/IdButton.Plus"
android:id="@+id/notify_2"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<Button
style="@style/IdButton.Minus"
android:id="@+id/clear_3"
/>
<TextView
style="@style/IdTitle"
android:text="3"
/>
<Button
style="@style/IdButton.Plus"
android:id="@+id/notify_3"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<Button
style="@style/IdButton.Minus"
android:id="@+id/clear_4"
/>
<TextView
style="@style/IdTitle"
android:text="4"
/>
<Button
style="@style/IdButton.Plus"
android:id="@+id/notify_4"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<Button
style="@style/IdButton.Minus"
android:id="@+id/clear_5"
/>
<TextView
style="@style/IdTitle"
android:text="5"
/>
<Button
style="@style/IdButton.Plus"
android:id="@+id/notify_5"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<Button
style="@style/IdButton.Minus"
android:id="@+id/clear_6"
/>
<TextView
style="@style/IdTitle"
android:text="6"
/>
<Button
style="@style/IdButton.Plus"
android:id="@+id/notify_6"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<Button
style="@style/IdButton.Minus"
android:id="@+id/clear_7"
/>
<TextView
style="@style/IdTitle"
android:text="7"
/>
<Button
style="@style/IdButton.Plus"
android:id="@+id/notify_7"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<Button
style="@style/IdButton.Minus"
android:id="@+id/clear_8"
/>
<TextView
style="@style/IdTitle"
android:text="8"
/>
<Button
style="@style/IdButton.Plus"
android:id="@+id/notify_8"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<Button
style="@style/IdButton.Minus"
android:id="@+id/clear_9"
/>
<TextView
style="@style/IdTitle"
android:text="9"
/>
<Button
style="@style/IdButton.Plus"
android:id="@+id/notify_9"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<Button
style="@style/IdButton.Minus"
android:id="@+id/clear_10"
/>
<TextView
style="@style/IdTitle"
android:text="10"
/>
<Button
style="@style/IdButton.Plus"
android:id="@+id/notify_10"
/>
</LinearLayout>
<Button
android:id="@+id/clear_all"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:layout_marginBottom="12dp"
android:text="Clear All"
/>
<Button
android:id="@+id/ten"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Ten notifications"
/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<!-- setWhen -->
<RadioGroup
android:id="@+id/group_when"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<TextView
style="@style/FieldTitle"
android:text="setWhen"
/>
<RadioButton
android:id="@+id/when_midnight"
style="@style/FieldContents"
android:text="midnight"
/>
<RadioButton
android:id="@+id/when_now"
style="@style/FieldContents"
android:text="now"
/>
<RadioButton
android:id="@+id/when_now_plus_1h"
style="@style/FieldContents.Disabled"
android:text="now + 1h"
/>
<RadioButton
android:id="@+id/when_tomorrow"
style="@style/FieldContents.Disabled"
android:text="tomorrow"
/>
</RadioGroup>
<!-- icon -->
<RadioGroup
android:id="@+id/group_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<TextView
style="@style/FieldTitle"
android:text="setSmallIcon"
/>
<RadioButton
android:id="@+id/icon_im"
style="@style/FieldContents"
android:text="IM"
/>
<RadioButton
android:id="@+id/icon_alert"
style="@style/FieldContents"
android:text="alert"
/>
<RadioButton
android:id="@+id/icon_surprise"
style="@style/FieldContents"
android:text="surprise"
/>
<RadioButton
android:id="@+id/icon_level0"
style="@style/FieldContents.Disabled"
android:text="level 0"
/>
<RadioButton
android:id="@+id/icon_level50"
style="@style/FieldContents.Disabled"
android:text="level 50"
/>
<RadioButton
android:id="@+id/icon_level100"
style="@style/FieldContents.Disabled"
android:text="level 100"
/>
<!-- todo setSmallIcon(int icon, int level) -->
</RadioGroup>
<!-- setContentTitle -->
<RadioGroup
android:id="@+id/group_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<TextView
style="@style/FieldTitle"
android:text="setContentTitle"
/>
<RadioButton
android:id="@+id/title_short"
style="@style/FieldContents"
android:text="none"
android:tag=""
/>
<RadioButton
android:id="@+id/title_short"
style="@style/FieldContents"
android:text="short"
android:tag="Title"
/>
<RadioButton
android:id="@+id/title_medium"
style="@style/FieldContents"
android:text="medium"
android:tag="Notification Test"
/>
<RadioButton
android:id="@+id/title_long"
style="@style/FieldContents"
android:text="long"
android:tag="This is one heckuva long title for a notification"
/>
</RadioGroup>
<!-- setContentText -->
<RadioGroup
android:id="@+id/group_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<TextView
style="@style/FieldTitle"
android:text="setContentText"
/>
<RadioButton
android:id="@+id/text_none"
style="@style/FieldContents"
android:text="none"
android:tag=""
/>
<RadioButton
android:id="@+id/text_short"
style="@style/FieldContents"
android:tag="short"
android:text="text"
/>
<RadioButton
android:id="@+id/text_medium"
style="@style/FieldContents"
android:text="medium"
android:tag="Something happened"
/>
<RadioButton
android:id="@+id/text_long"
style="@style/FieldContents"
android:text="long"
android:tag="Oh my goodness. SOMETHING HAPPENED!!!!"
/>
<RadioButton
android:id="@+id/text_haiku"
style="@style/FieldContents"
android:text="haiku"
android:tag="sholes final approach\nlanding gear punted to flan\nrunway foam glistens"
/>
</RadioGroup>
<!-- setContentInfo -->
<RadioGroup
android:id="@+id/group_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<TextView
style="@style/FieldTitle"
android:text="setContentInfo"
/>
<RadioButton
android:id="@+id/info_none"
style="@style/FieldContents"
android:text="none"
android:tag=""
/>
<RadioButton
android:id="@+id/info_number"
style="@style/FieldContents"
android:text="snoozed"
android:tag="snoozed"
/>
<RadioButton
android:id="@+id/info_long"
style="@style/FieldContents"
android:text="longer"
android:tag="this content info is way too long"
/>
</RadioGroup>
<!-- setNumber -->
<RadioGroup
android:id="@+id/group_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<TextView
style="@style/FieldTitle"
android:text="setNumber"
/>
<RadioButton
android:id="@+id/number_0"
style="@style/FieldContents"
android:text="0"
android:tag="0"
/>
<RadioButton
android:id="@+id/number_1"
style="@style/FieldContents"
android:text="1"
android:tag="1"
/>
<RadioButton
android:id="@+id/number_42"
style="@style/FieldContents"
android:text="42"
android:tag="42"
/>
<RadioButton
android:id="@+id/number_334"
style="@style/FieldContents"
android:text="334"
android:tag="334"
/>
<RadioButton
android:id="@+id/number_999"
style="@style/FieldContents"
android:text="999"
android:tag="999"
/>
<RadioButton
android:id="@+id/number_9876"
style="@style/FieldContents"
android:text="9,876"
android:tag="9876"
/>
<RadioButton
android:id="@+id/number_12345"
style="@style/FieldContents"
android:text="12,345"
android:tag="12345"
/>
</RadioGroup>
<!-- setContentIntent -->
<RadioGroup
android:id="@+id/group_intent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<TextView
style="@style/FieldTitle"
android:text="setContentIntent"
/>
<RadioButton
android:id="@+id/intent_none"
style="@style/FieldContents"
android:text="none"
/>
<RadioButton
android:id="@+id/intent_alert"
style="@style/FieldContents"
android:text="alert"
/>
</RadioGroup>
<!-- setDeleteIntent -->
<RadioGroup
android:id="@+id/group_delete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<TextView
style="@style/FieldTitle"
android:text="setDeleteIntent"
/>
<RadioButton
android:id="@+id/delete_none"
style="@style/FieldContents"
android:text="none"
/>
<RadioButton
android:id="@+id/delete_alert"
style="@style/FieldContents"
android:text="alert"
/>
</RadioGroup>
<!-- setFullScreenIntent -->
<RadioGroup
android:id="@+id/group_full_screen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:visibility="gone"
>
<TextView
style="@style/FieldTitle"
android:text="setFullScreenIntent"
/>
<RadioButton
android:id="@+id/full_screen_none"
style="@style/FieldContents.Disabled"
android:text="none"
/>
<RadioButton
android:id="@+id/full_screen_activity"
style="@style/FieldContents.Disabled"
android:text="full screen"
/>
</RadioGroup>
<!-- setTicker -->
<RadioGroup
android:id="@+id/group_ticker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<TextView
style="@style/FieldTitle"
android:text="setTicker"
/>
<RadioButton
android:id="@+id/ticker_none"
style="@style/FieldContents"
android:text="none"
android:tag=""
/>
<RadioButton
android:id="@+id/ticker_short"
style="@style/FieldContents"
android:text="short"
android:tag="tick"
/>
<RadioButton
android:id="@+id/ticker_wrap"
style="@style/FieldContents"
android:text="wrap"
android:tag="tick tick tick tock tock tock something fun has happened but i don't know what it is just yet"
/>
<RadioButton
android:id="@+id/ticker_haiku"
style="@style/FieldContents"
android:text="haiku"
android:tag="sholes final approach\nlanding gear punted to flan\nrunway foam glistens"
/>
<RadioButton
android:id="@+id/ticker_custom"
style="@style/FieldContents.Disabled"
android:text="custom view"
/>
</RadioGroup>
<!-- setLargeIcon -->
<RadioGroup
android:id="@+id/group_large_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<TextView
style="@style/FieldTitle"
android:text="setLargeIcon"
/>
<RadioButton
android:id="@+id/large_icon_none"
style="@style/FieldContents"
android:text="none"
/>
<RadioButton
android:id="@+id/large_icon_pineapple"
style="@style/FieldContents"
android:text="pineapple"
/>
<RadioButton
android:id="@+id/large_icon_pineapple2"
style="@style/FieldContents"
android:text="pineapple2"
/>
<RadioButton
android:id="@+id/large_icon_small"
style="@style/FieldContents"
android:text="small"
/>
</RadioGroup>
<!-- setSound -->
<RadioGroup
android:id="@+id/group_sound"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:visibility="gone"
>
<TextView
style="@style/FieldTitle"
android:text="setSound"
/>
<RadioButton
android:id="@+id/sound_none"
style="@style/FieldContents.Disabled"
android:text="none"
/>
</RadioGroup>
<!-- setVibrate -->
<RadioGroup
android:id="@+id/group_vibrate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<TextView
style="@style/FieldTitle"
android:text="setVibrate"
/>
<RadioButton
android:id="@+id/vibrate_none"
style="@style/FieldContents"
android:text="none"
/>
<RadioButton
android:id="@+id/vibrate_short"
style="@style/FieldContents"
android:text="short"
/>
<RadioButton
android:id="@+id/vibrate_medium"
style="@style/FieldContents"
android:text="long"
/>
<RadioButton
android:id="@+id/vibrate_long"
style="@style/FieldContents"
android:text="long"
/>
<RadioButton
android:id="@+id/vibrate_pattern"
style="@style/FieldContents"
android:text="longer"
/>
</RadioGroup>
<!-- setLights -->
<RadioGroup
android:id="@+id/group_lights_color"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<TextView
style="@style/FieldTitle"
android:text="setLights (color)"
/>
<RadioButton
android:id="@+id/lights_red"
style="@style/FieldContents"
android:text="red"
android:tag="0xff0000"
/>
<RadioButton
android:id="@+id/lights_green"
style="@style/FieldContents"
android:text="green"
android:tag="0x00ff00"
/>
<RadioButton
android:id="@+id/lights_blue"
style="@style/FieldContents"
android:text="blue"
android:tag="0x0000ff"
/>
<RadioButton
android:id="@+id/lights_cyan"
style="@style/FieldContents"
android:text="cyan"
android:tag="0x00ffff"
/>
<RadioButton
android:id="@+id/lights_magenta"
style="@style/FieldContents"
android:text="magenta"
android:tag="0xff00ff"
/>
<RadioButton
android:id="@+id/lights_yellow"
style="@style/FieldContents"
android:text="yellow"
android:tag="0xffff00"
/>
<RadioButton
android:id="@+id/lights_white"
style="@style/FieldContents"
android:text="white"
android:tag="0xffffff"
/>
</RadioGroup>
<!-- setLights -->
<RadioGroup
android:id="@+id/group_lights_blink"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<TextView
style="@style/FieldTitle"
android:text="setLights (blink)"
/>
<RadioButton
android:id="@+id/lights_off"
style="@style/FieldContents"
android:text="off"
/>
<RadioButton
android:id="@+id/lights_slow"
style="@style/FieldContents"
android:text="slow"
/>
<RadioButton
android:id="@+id/lights_fast"
style="@style/FieldContents"
android:text="fast"
/>
<RadioButton
android:id="@+id/lights_on"
style="@style/FieldContents"
android:text="on"
/>
</RadioGroup>
<!-- flags -->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="12dp"
>
<TextView
style="@style/FieldTitle"
android:text="flags"
/>
<CheckBox
android:id="@+id/flag_ongoing"
style="@style/FieldContents"
android:text="setOngoing"
/>
<CheckBox
android:id="@+id/flag_once"
style="@style/FieldContents"
android:text="setOnlyAlertOnce"
/>
<CheckBox
android:id="@+id/flag_auto_cancel"
style="@style/FieldContents"
android:text="setAutoCancel"
/>
</LinearLayout>
<!-- defaults -->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<TextView
style="@style/FieldTitle"
android:text="defaults"
/>
<CheckBox
android:id="@+id/default_sound"
style="@style/FieldContents"
android:text="sound"
/>
<CheckBox
android:id="@+id/default_vibrate"
style="@style/FieldContents"
android:text="vibrate"
/>
<CheckBox
android:id="@+id/default_lights"
style="@style/FieldContents"
android:text="lights"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>