diff options
author | Tony Wickham <twickham@google.com> | 2017-04-10 14:05:34 -0700 |
---|---|---|
committer | Tony Wickham <twickham@google.com> | 2017-04-11 16:44:38 -0700 |
commit | ce44516dd869dff1d6a744e26625a662d9567a10 (patch) | |
tree | 9bdca8838804fefb913d73fcf92d62883a3699cc /res | |
parent | cd4cc97f6f761b8cc377821a2214432a376dd4f8 (diff) | |
download | android_packages_apps_Trebuchet-ce44516dd869dff1d6a744e26625a662d9567a10.tar.gz android_packages_apps_Trebuchet-ce44516dd869dff1d6a744e26625a662d9567a10.tar.bz2 android_packages_apps_Trebuchet-ce44516dd869dff1d6a744e26625a662d9567a10.zip |
Update popup to match redlines
- Update specs in dimens.xml and colors.xml
- Move notification count to top right, and keep "Notifications" in left
- Also removed NotificationHeaderView and instead use FrameLayout
- Limit to 2 shortcuts instead of 3 if there are notifications
- Use SP instead of DP for text (b/35869307)
Bug: 35766387
Change-Id: I892640933ad6351946af3df6c805b98bb4e7cb50
Diffstat (limited to 'res')
-rw-r--r-- | res/layout/deep_shortcut.xml | 6 | ||||
-rw-r--r-- | res/layout/notification.xml | 31 | ||||
-rw-r--r-- | res/layout/notification_main.xml | 4 | ||||
-rw-r--r-- | res/layout/system_shortcut.xml | 6 | ||||
-rw-r--r-- | res/layout/system_shortcut_icon_only.xml | 9 | ||||
-rw-r--r-- | res/layout/system_shortcut_icons.xml | 3 | ||||
-rw-r--r-- | res/values/colors.xml | 5 | ||||
-rw-r--r-- | res/values/dimens.xml | 54 | ||||
-rw-r--r-- | res/values/strings.xml | 10 |
9 files changed, 65 insertions, 63 deletions
diff --git a/res/layout/deep_shortcut.xml b/res/layout/deep_shortcut.xml index 60131e4fb..7744906bc 100644 --- a/res/layout/deep_shortcut.xml +++ b/res/layout/deep_shortcut.xml @@ -27,7 +27,7 @@ android:gravity="start|center_vertical" android:textAlignment="viewStart" android:paddingStart="@dimen/bg_popup_item_height" - android:paddingEnd="@dimen/deep_shortcut_padding_end" + android:paddingEnd="@dimen/popup_padding_end" android:drawableEnd="@drawable/deep_shortcuts_drag_handle" android:drawablePadding="@dimen/deep_shortcut_drawable_padding" android:textSize="14sp" @@ -40,8 +40,8 @@ android:id="@+id/icon" android:layout_width="@dimen/deep_shortcut_icon_size" android:layout_height="@dimen/deep_shortcut_icon_size" - android:layout_margin="@dimen/deep_shortcut_padding_start" - android:layout_gravity="start" /> + android:layout_marginStart="@dimen/popup_padding_start" + android:layout_gravity="start|center_vertical" /> <View android:id="@+id/divider" diff --git a/res/layout/notification.xml b/res/layout/notification.xml index 6922ad9d3..4250e1e54 100644 --- a/res/layout/notification.xml +++ b/res/layout/notification.xml @@ -29,30 +29,33 @@ android:orientation="vertical" android:clipChildren="false"> - <com.android.launcher3.notification.NotificationHeaderView + <FrameLayout android:id="@+id/header" android:layout_width="match_parent" android:layout_height="@dimen/notification_header_height" - android:orientation="horizontal" - android:paddingStart="@dimen/notification_padding" + android:paddingStart="@dimen/notification_padding_start" + android:paddingEnd="@dimen/notification_padding_end" android:background="@color/notification_header_background_color" android:elevation="@dimen/notification_elevation"> <TextView - android:id="@+id/notification_count" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:gravity="start|center_vertical" - android:paddingEnd="@dimen/notification_header_padding_after_count" - android:textSize="@dimen/notification_main_text_size" - android:textColor="?android:attr/textColorPrimary" /> - <TextView android:id="@+id/notification_text" android:layout_width="wrap_content" android:layout_height="match_parent" - android:gravity="start|center_vertical" - android:textSize="@dimen/notification_main_text_size" + android:layout_gravity="start" + android:gravity="center_vertical" + android:text="@string/notifications_header" + android:textSize="@dimen/notification_header_text_size" android:textColor="?android:attr/textColorSecondary" /> - </com.android.launcher3.notification.NotificationHeaderView> + <TextView + android:id="@+id/notification_count" + android:layout_width="@dimen/notification_icon_size" + android:layout_height="match_parent" + android:layout_gravity="end" + android:gravity="center" + android:textSize="@dimen/notification_header_count_text_size" + android:fontFamily="sans-serif-medium" + android:textColor="?android:attr/textColorPrimary" /> + </FrameLayout> <include layout="@layout/notification_main" android:id="@+id/main_view" diff --git a/res/layout/notification_main.xml b/res/layout/notification_main.xml index 9c5847f39..8fa1b68f8 100644 --- a/res/layout/notification_main.xml +++ b/res/layout/notification_main.xml @@ -29,7 +29,7 @@ android:orientation="vertical" android:gravity="center_vertical" android:background="@color/notification_background_color" - android:paddingStart="@dimen/notification_padding" + android:paddingStart="@dimen/notification_padding_start" android:paddingEnd="@dimen/notification_main_text_padding_end"> <TextView android:id="@+id/title" @@ -57,7 +57,7 @@ android:id="@+id/popup_item_icon" android:layout_width="@dimen/notification_icon_size" android:layout_height="@dimen/notification_icon_size" - android:layout_marginEnd="@dimen/notification_padding" + android:layout_marginEnd="@dimen/notification_padding_end" android:layout_gravity="center_vertical|end" /> </com.android.launcher3.notification.NotificationMainView> diff --git a/res/layout/system_shortcut.xml b/res/layout/system_shortcut.xml index 3baddc480..113b1bed1 100644 --- a/res/layout/system_shortcut.xml +++ b/res/layout/system_shortcut.xml @@ -27,7 +27,7 @@ android:gravity="start|center_vertical" android:textAlignment="viewStart" android:paddingStart="@dimen/bg_popup_item_height" - android:paddingEnd="@dimen/deep_shortcut_padding_end" + android:paddingEnd="@dimen/popup_padding_end" android:textSize="14sp" android:fontFamily="sans-serif" launcher:layoutHorizontal="true" /> @@ -36,8 +36,8 @@ android:id="@+id/icon" android:layout_width="@dimen/system_shortcut_icon_size" android:layout_height="@dimen/system_shortcut_icon_size" - android:layout_margin="@dimen/system_shortcut_padding_start" - android:layout_gravity="start" /> + android:layout_marginStart="@dimen/system_shortcut_margin_start" + android:layout_gravity="start|center_vertical" /> <View android:id="@+id/divider" diff --git a/res/layout/system_shortcut_icon_only.xml b/res/layout/system_shortcut_icon_only.xml index 02d4ef818..313c69c69 100644 --- a/res/layout/system_shortcut_icon_only.xml +++ b/res/layout/system_shortcut_icon_only.xml @@ -16,8 +16,7 @@ <ImageView xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="@dimen/deep_shortcut_icon_size" - android:layout_height="@dimen/deep_shortcut_icon_size" - android:background="?android:attr/selectableItemBackground" - android:layout_marginEnd="@dimen/deep_shortcut_padding_start" - android:padding="4dp" /> + android:layout_width="@dimen/system_shortcut_header_icon_touch_size" + android:layout_height="@dimen/system_shortcut_header_icon_touch_size" + android:background="?android:attr/selectableItemBackgroundBorderless" + android:padding="@dimen/system_shortcut_header_icon_padding" /> diff --git a/res/layout/system_shortcut_icons.xml b/res/layout/system_shortcut_icons.xml index bf0a2512a..9dc56e41d 100644 --- a/res/layout/system_shortcut_icons.xml +++ b/res/layout/system_shortcut_icons.xml @@ -18,8 +18,7 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/system_shortcut_icons" android:layout_width="match_parent" - android:layout_height="@dimen/bg_popup_item_height" - android:paddingEnd="@dimen/deep_shortcut_padding_start" + android:layout_height="@dimen/system_shortcut_header_height" android:orientation="horizontal" android:gravity="end|center_vertical" android:background="@color/notification_header_background_color" /> diff --git a/res/values/colors.xml b/res/values/colors.xml index 028c98206..3ce7baae2 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -37,12 +37,13 @@ <!-- Notifications --> <color name="notification_icon_default_color">#757575</color> <!-- Gray 600 --> - <color name="notification_header_background_color">#F5F5F5</color> <!-- Gray 100 --> + <color name="notification_header_background_color">#EEEEEE</color> <!-- Gray 200 --> <color name="notification_background_color">#FFF</color> <color name="notification_color_beneath">#E0E0E0</color> <!-- Gray 300 --> <color name="divider_color">@color/notification_color_beneath</color> - <color name="icon_background">#E0E0E0</color> <!-- Gray 300 --> <!-- System shortcuts --> <color name="system_shortcuts_icon_color">@android:color/tertiary_text_light</color> + + <color name="icon_background">#E0E0E0</color> <!-- Gray 300 --> </resources> diff --git a/res/values/dimens.xml b/res/values/dimens.xml index 7b1d24720..0b6100f52 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -151,51 +151,57 @@ <!-- Deep shortcuts --> <dimen name="deep_shortcuts_elevation">9dp</dimen> <dimen name="bg_popup_item_width">208dp</dimen> - <dimen name="bg_popup_item_height">48dp</dimen> + <dimen name="bg_popup_item_height">56dp</dimen> <dimen name="popup_items_spacing">4dp</dimen> <dimen name="pre_drag_view_scale">6dp</dimen> <!-- an icon with shortcuts must be dragged this far before the container is removed. --> <dimen name="deep_shortcuts_start_drag_threshold">16dp</dimen> <dimen name="deep_shortcut_icon_size">36dp</dimen> - <dimen name="deep_shortcut_padding_start">6dp</dimen> - <dimen name="deep_shortcut_padding_end">16dp</dimen> <dimen name="deep_shortcut_drawable_padding">8dp</dimen> - <dimen name="deep_shortcut_anim_translation_y">5dp</dimen> <dimen name="deep_shortcut_drag_handle_size">16dp</dimen> - <dimen name="deep_shortcuts_arrow_width">10dp</dimen> - <dimen name="deep_shortcuts_arrow_height">8dp</dimen> - <dimen name="deep_shortcuts_arrow_vertical_offset">-2dp</dimen> - <!-- deep_shortcut_padding_start + deep_shortcut_icon_size / 2 - deep_shortcuts_arrow_width / 2--> + <dimen name="popup_padding_start">6dp</dimen> + <dimen name="popup_padding_end">16dp</dimen> + <dimen name="popup_arrow_width">10dp</dimen> + <dimen name="popup_arrow_height">8dp</dimen> + <dimen name="popup_arrow_vertical_offset">-2dp</dimen> + <!-- popup_padding_start + deep_shortcut_icon_size / 2 --> <!-- Note that this works for right-aligned shortcuts, too, because - deep_shortcut_padding_end + deep_shortcut_drag_handle_size / 2 - deep_shortcuts_arrow_width / 2 - also happens to equal 19dp--> - <dimen name="deep_shortcuts_arrow_horizontal_offset">19dp</dimen> + popup_padding_end + deep_shortcut_drag_handle_size / 2 also equals 24dp--> + <dimen name="popup_arrow_horizontal_center">24dp</dimen> + <!-- popup_arrow_center - popup_arrow_width / 2--> + <dimen name="popup_arrow_horizontal_offset">19dp</dimen> <!-- popup_item_width - icon_size - padding_start - drawable_padding --> <dimen name="deep_shortcuts_divider_width">158dp</dimen> - <dimen name="system_shortcut_icon_size">28dp</dimen> - <dimen name="system_shortcut_padding_start">10dp</dimen> + <dimen name="system_shortcut_icon_size">24dp</dimen> + <!-- popup_arrow_center - system_shortcut_icon_size / 2 --> + <dimen name="system_shortcut_margin_start">12dp</dimen> + <dimen name="system_shortcut_header_height">40dp</dimen> + <dimen name="system_shortcut_header_icon_touch_size">48dp</dimen> + <!-- (touch_size - icon_size) / 2 --> + <dimen name="system_shortcut_header_icon_padding">12dp</dimen> <!-- Icon badges (with notification counts) --> <dimen name="badge_size">24dp</dimen> <dimen name="badge_text_size">12dp</dimen> <dimen name="badge_small_padding">0dp</dimen> <dimen name="badge_large_padding">3dp</dimen> - <dimen name="notification_icon_size">24dp</dimen> - <dimen name="notification_footer_icon_size">18dp</dimen> <!-- Notifications --> <dimen name="bg_round_rect_radius">12dp</dimen> - <dimen name="notification_padding">12dp</dimen> - <!-- notification_padding + (icon_size - footer_icon_size) / 2 --> + <dimen name="notification_padding_start">16dp</dimen> + <dimen name="notification_padding_end">12dp</dimen> + <!-- notification_padding_end + (icon_size - footer_icon_size) / 2 --> <dimen name="notification_footer_icon_row_padding">15dp</dimen> - <dimen name="notification_header_padding_after_count">8dp</dimen> <dimen name="notification_header_height">32dp</dimen> - <dimen name="notification_main_height">60dp</dimen> - <dimen name="notification_footer_height">@dimen/bg_popup_item_height</dimen> - <dimen name="notification_header_text_size">12dp</dimen> - <dimen name="notification_main_text_size">14dp</dimen> - <!-- notification_icon_size + notification+padding + padding we want between icon and text --> - <dimen name="notification_main_text_padding_end">40dp</dimen> + <dimen name="notification_main_height">80dp</dimen> + <dimen name="notification_footer_height">32dp</dimen> + <dimen name="notification_header_text_size">13sp</dimen> + <dimen name="notification_header_count_text_size">12sp</dimen> + <dimen name="notification_main_text_size">15sp</dimen> + <dimen name="notification_icon_size">24dp</dimen> + <dimen name="notification_footer_icon_size">18dp</dimen> + <!-- notification_icon_size + notification_padding_end + 16dp padding between icon and text --> + <dimen name="notification_main_text_padding_end">52dp</dimen> <dimen name="notification_elevation">2dp</dimen> <dimen name="horizontal_ellipsis_size">18dp</dimen> <!-- arrow_horizontal_offset - (ellipsis_size - arrow_width) / 2 --> diff --git a/res/values/strings.xml b/res/values/strings.xml index 0461e4a02..eddae621e 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -67,15 +67,9 @@ <!-- Label for the button which allows the user to get app search results. [CHAR_LIMIT=50] --> <string name="all_apps_search_market_message">Search for more apps</string> - <!-- Deep items --> - <!-- Text to indicate more items that couldn't be displayed due to space constraints. - The text must fit in the size of a small icon [CHAR_LIMIT=3] --> - <string name="deep_notifications_overflow" translatable="false">+%1$d</string> + <!-- Popup items --> <!-- Text to display as the header above notifications. [CHAR_LIMIT=30] --> - <plurals name="notifications_header" translatable="false"> - <item quantity="one">Notification</item> - <item quantity="other">Notifications</item> - </plurals> + <string name="notifications_header">Notifications</string> <!-- Drag and drop --> <skip /> |