diff options
author | Kunhung Li <kunhungli@google.com> | 2019-03-20 18:19:14 +0800 |
---|---|---|
committer | Kunhung Li <kunhungli@google.com> | 2019-04-12 06:57:16 +0000 |
commit | 3712a0cfa01170bfcb7807a191727d57bb3652fe (patch) | |
tree | ff25ff3afde82a05219638e1370aae1fe8f2e573 /res | |
parent | d2cc826dc61035c9e22fcda5b4263ac150d8525f (diff) | |
download | android_packages_wallpapers_LivePicker-3712a0cfa01170bfcb7807a191727d57bb3652fe.tar.gz android_packages_wallpapers_LivePicker-3712a0cfa01170bfcb7807a191727d57bb3652fe.tar.bz2 android_packages_wallpapers_LivePicker-3712a0cfa01170bfcb7807a191727d57bb3652fe.zip |
Keep "Set wallpaper" button the same position in different tabs.
1. Consider both (info > setting) page and (info < setting) page cases,
add extra space to let "Set wallpaper" button can align bottom.
2. Add extra height in info page top area if info page has
enough empty space.
3. Refine info and setting layouts in portrait and landscape.
4. Correct dummy data can't show title.
Bug: 128393998
Test: Manual test
Change-Id: I29a3dc8309fa879d1b93c5db81630f6e0cbd36d8
Diffstat (limited to 'res')
-rw-r--r-- | res/layout/page_info.xml | 29 | ||||
-rw-r--r-- | res/layout/page_settings.xml | 7 | ||||
-rw-r--r-- | res/values-land/dimensions.xml | 20 | ||||
-rw-r--r-- | res/values/dimensions.xml | 11 |
4 files changed, 55 insertions, 12 deletions
diff --git a/res/layout/page_info.xml b/res/layout/page_info.xml index 7187b56..f7baad0 100644 --- a/res/layout/page_info.xml +++ b/res/layout/page_info.xml @@ -15,29 +15,35 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/page_info" android:orientation="vertical" - android:paddingHorizontal="@dimen/preview_attribution_pane_horizontal_padding" - android:paddingVertical="@dimen/preview_attribution_pane_vertical_padding"> + android:paddingHorizontal="@dimen/preview_attribution_pane_horizontal_padding"> + + <Space + android:id="@+id/preview_attribution_pane_title_spacer" + android:layout_width="0dp" + android:layout_height="@dimen/preview_attribution_pane_inner_spacer_height"/> <TextView android:id="@+id/preview_attribution_pane_title" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_gravity="start" + android:minHeight="@dimen/preview_attribution_pane_title_height" android:ellipsize="end" android:forceHasOverlappingRendering="false" - android:gravity="center_horizontal" + android:gravity="center" android:singleLine="true" - android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Title" + android:textAppearance="@*android:style/TextAppearance.DeviceDefault.SearchResult.Title" android:visibility="gone"/> <TextView android:id="@+id/preview_attribution_pane_author" android:layout_width="match_parent" android:layout_height="wrap_content" + android:minHeight="@dimen/preview_attribution_pane_author_height" android:layout_marginTop="@dimen/preview_attribution_pane_author_top_margin" android:forceHasOverlappingRendering="false" - android:gravity="center_horizontal" + android:gravity="center" android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Subhead" android:visibility="gone"/> @@ -45,17 +51,24 @@ android:id="@+id/preview_attribution_pane_description" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginTop="@dimen/preview_attribution_pane_description_top_margin" + android:minHeight="@dimen/preview_attribution_pane_description_height" android:forceHasOverlappingRendering="false" android:gravity="center_horizontal" android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Caption" android:visibility="gone"/> + <Space + android:id="@+id/preview_attribution_pane_spacer" + android:layout_width="0dp" + android:layout_height="0dp" + android:layout_marginTop="@dimen/preview_attribution_pane_inner_spacer_height" + android:layout_weight="1"/> + <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" - android:layout_marginTop="@dimen/preview_attribution_pane_explore_top_margin" + android:layout_marginBottom="@dimen/preview_attribution_pane_button_bottom_margin" android:orientation="horizontal"> <com.google.android.material.button.MaterialButton diff --git a/res/layout/page_settings.xml b/res/layout/page_settings.xml index 25b4aec..5729aa3 100644 --- a/res/layout/page_settings.xml +++ b/res/layout/page_settings.xml @@ -24,10 +24,17 @@ android:layout_width="match_parent" android:layout_height="wrap_content"/> + <Space + android:id="@+id/preview_attribution_pane_spacer" + android:layout_width="0dp" + android:layout_height="0dp" + android:layout_weight="1"/> + <com.google.android.material.button.MaterialButton android:id="@+id/preview_attribution_pane_set_wallpaper_button" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_marginBottom="@dimen/preview_attribution_pane_button_bottom_margin" style="@style/ButtonStyle" android:text="@string/set_live_wallpaper"/> diff --git a/res/values-land/dimensions.xml b/res/values-land/dimensions.xml new file mode 100644 index 0000000..e2d5ffe --- /dev/null +++ b/res/values-land/dimensions.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2019 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. +--> +<resources> + <!-- Dimensions for the preview attribution pane. --> + <dimen name="preview_attribution_pane_author_top_margin">8dp</dimen> + <dimen name="preview_attribution_pane_button_bottom_margin">14dp</dimen> +</resources> diff --git a/res/values/dimensions.xml b/res/values/dimensions.xml index 5066ca3..9e92df7 100644 --- a/res/values/dimensions.xml +++ b/res/values/dimensions.xml @@ -34,10 +34,13 @@ <!-- Dimensions for the preview attribution pane. --> <dimen name="preview_attribution_pane_horizontal_padding">24dp</dimen> - <dimen name="preview_attribution_pane_vertical_padding">13dp</dimen> - <dimen name="preview_attribution_pane_author_top_margin">12dp</dimen> - <dimen name="preview_attribution_pane_description_top_margin">2dp</dimen> - <dimen name="preview_attribution_pane_explore_top_margin">12dp</dimen> + <dimen name="preview_attribution_pane_extra_spacer_height">16dp</dimen> + <dimen name="preview_attribution_pane_inner_spacer_height">14dp</dimen> + <dimen name="preview_attribution_pane_title_height">48dp</dimen> + <dimen name="preview_attribution_pane_author_height">24dp</dimen> + <dimen name="preview_attribution_pane_author_top_margin">0dp</dimen> + <dimen name="preview_attribution_pane_description_height">34dp</dimen> + <dimen name="preview_attribution_pane_button_bottom_margin">8dp</dimen> <!-- Dimensions for the ConstraintViewPager on preview activity. --> <dimen name="preview_viewpager_round_radius">12dp</dimen> |