diff options
author | Hyunyoung Song <hyunyoungs@google.com> | 2015-05-12 15:36:20 -0700 |
---|---|---|
committer | Hyunyoung Song <hyunyoungs@google.com> | 2015-05-12 15:40:09 -0700 |
commit | 5cd1d92f6c40b47eff12859d4e13b6431aa778c0 (patch) | |
tree | 044fd811140620ef5c03b0b764f99d19c5ef4172 /res | |
parent | fc9d3d8bcb70216de7709d3edaf9759ac8156b45 (diff) | |
download | android_packages_apps_Trebuchet-5cd1d92f6c40b47eff12859d4e13b6431aa778c0.tar.gz android_packages_apps_Trebuchet-5cd1d92f6c40b47eff12859d4e13b6431aa778c0.tar.bz2 android_packages_apps_Trebuchet-5cd1d92f6c40b47eff12859d4e13b6431aa778c0.zip |
Fixing several layout issues.
- N7/N9 indented area should not block scroll view
- separator at the end of the widget cell should not show up on the last item.
Not covered in this CL:
- Guarantee that last item is showing only 20~40%. Right now, the
hand picked constant works for N5,6,7,9
b/20338324
b/20763871
Change-Id: I274ab95c6c3e2fc8be8ceafb2e8172c0174a41a5
Diffstat (limited to 'res')
-rw-r--r-- | res/drawable/widgets_row_divider.xml | 20 | ||||
-rw-r--r-- | res/layout/widget_cell.xml | 12 | ||||
-rw-r--r-- | res/layout/widgets_list_row_view.xml | 37 | ||||
-rw-r--r-- | res/values/dimens.xml | 1 |
4 files changed, 40 insertions, 30 deletions
diff --git a/res/drawable/widgets_row_divider.xml b/res/drawable/widgets_row_divider.xml new file mode 100644 index 000000000..46caacbbe --- /dev/null +++ b/res/drawable/widgets_row_divider.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2015 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<?xml version="1.0" encoding="utf-8"?> +<shape xmlns:android="http://schemas.android.com/apk/res/android" > + <size android:width="@dimen/widget_row_divider" /> + <solid android:color="@color/widget_text_panel" /> +</shape> diff --git a/res/layout/widget_cell.xml b/res/layout/widget_cell.xml index 196dfca66..a85f0aa16 100644 --- a/res/layout/widget_cell.xml +++ b/res/layout/widget_cell.xml @@ -16,13 +16,12 @@ <com.android.launcher3.widget.WidgetCell xmlns:android="http://schemas.android.com/apk/res/android" xmlns:launcher="http://schemas.android.com/apk/res-auto" - android:layout_width="@dimen/widget_preview_container_width" - android:layout_height="@dimen/widget_cell_height" + android:layout_width="wrap_content" + android:layout_height="wrap_content" android:layout_weight="1" - android:layout_marginEnd="@dimen/widget_row_divider" android:orientation="vertical" - android:background="@color/widgets_cell_color" android:focusable="true" + android:background="@color/widgets_cell_color" android:gravity="center_horizontal"> <LinearLayout @@ -73,9 +72,8 @@ <com.android.launcher3.widget.WidgetImageView android:id="@+id/widget_preview" style="@style/WidgetImageView" - android:layout_width="match_parent" + android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:scaleType="matrix" /> - -</com.android.launcher3.widget.WidgetCell> +</com.android.launcher3.widget.WidgetCell>
\ No newline at end of file diff --git a/res/layout/widgets_list_row_view.xml b/res/layout/widgets_list_row_view.xml index 8bc8be44a..2cbdb5cff 100644 --- a/res/layout/widgets_list_row_view.xml +++ b/res/layout/widgets_list_row_view.xml @@ -48,26 +48,19 @@ launcher:iconSizeOverride="@dimen/widget_section_icon_size" launcher:layoutHorizontal="true" /> - <!-- Widget list --> - <com.android.launcher3.widget.WidgetRowView - android:id="@+id/widget_row" - android:layout_width="match_parent" - android:layout_height="@dimen/widget_cell_height" - android:layout_gravity="end" - android:layout_marginLeft="@dimen/widget_row_padding" - android:background="@color/widgets_cell_color" - > - <HorizontalScrollView - android:id="@+id/widgets_scroll_container" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:scrollbars="none" > - <LinearLayout - android:id="@+id/widgets_cell_list" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:orientation="horizontal" - android:background="@color/widget_text_panel"/> - </HorizontalScrollView> - </com.android.launcher3.widget.WidgetRowView> + <HorizontalScrollView + android:id="@+id/widgets_scroll_container" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:scrollbars="none" > + <LinearLayout + android:id="@+id/widgets_cell_list" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginStart="@dimen/widget_row_padding" + android:orientation="horizontal" + android:divider="@drawable/widgets_row_divider" + android:showDividers="middle" + android:background="@color/widgets_cell_color"/> + </HorizontalScrollView> </LinearLayout> diff --git a/res/values/dimens.xml b/res/values/dimens.xml index 6280e5247..f944d4b3c 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -101,7 +101,6 @@ <!-- Equation: widget_preview_size + 2 * widget_preview_padding_horizontal --> <dimen name="widget_preview_container_width">146dp</dimen> - <dimen name="widget_cell_height">150dp</dimen> <dimen name="widget_row_padding">8dp</dimen> <dimen name="widget_row_divider">2dp</dimen> |