summaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorKunhung Li <kunhungli@google.com>2019-04-12 17:16:53 +0800
committerKunhung Li <kunhungli@google.com>2019-04-30 20:36:51 +0800
commitfaf0af1fe4855ad05f1c7c24db8206d3e0ab420d (patch)
treea1938fea9bd94b62a2a87971dad960d65dda02c3 /res
parentecbe70007c06d97cc06d8c2df3143947470911f7 (diff)
downloadandroid_packages_wallpapers_LivePicker-faf0af1fe4855ad05f1c7c24db8206d3e0ab420d.tar.gz
android_packages_wallpapers_LivePicker-faf0af1fe4855ad05f1c7c24db8206d3e0ab420d.tar.bz2
android_packages_wallpapers_LivePicker-faf0af1fe4855ad05f1c7c24db8206d3e0ab420d.zip
Add preview checkbox for LivePicker
Enable preview checkbox to hide bottom panel, otherwise to show it. Default behavior will show bottom panel with preview unchecked. Bug: 130383883 Test: Manual Test Change-Id: Ida5a5fa7ece501aefd906b70b6990eb89fe14c74
Diffstat (limited to 'res')
-rw-r--r--res/layout/live_wallpaper_preview.xml34
-rw-r--r--res/layout/preview_action.xml24
-rw-r--r--res/layout/set_wallpaper_action.xml24
-rw-r--r--res/menu/menu_preview.xml5
-rw-r--r--res/values/dimensions.xml1
-rw-r--r--res/values/strings.xml10
6 files changed, 61 insertions, 37 deletions
diff --git a/res/layout/live_wallpaper_preview.xml b/res/layout/live_wallpaper_preview.xml
index 0c35b68..b6bbd7c 100644
--- a/res/layout/live_wallpaper_preview.xml
+++ b/res/layout/live_wallpaper_preview.xml
@@ -46,29 +46,37 @@
android:layout_height="match_parent"
android:fitsSystemWindows="true">
- <LinearLayout
- android:id="@+id/bottom_pane"
+ <androidx.coordinatorlayout.widget.CoordinatorLayout
+ android:id="@+id/coordinator_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
- android:background="@color/translucent_black"
android:orientation="vertical">
- <com.google.android.material.tabs.TabLayout
- android:id="@+id/tablayout"
+ <LinearLayout
+ android:id="@+id/bottom_pane"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- style="@style/TabLayoutStyle"
- android:visibility="gone" />
+ android:background="@color/translucent_black"
+ android:orientation="vertical"
+ app:behavior_peekHeight="@dimen/preview_attribution_pane_collapsed_height"
+ app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">
- <com.android.wallpaper.livepicker.widget.ConstraintViewPager
- android:id="@+id/viewpager"
- android:layout_width="match_parent"
- android:layout_height="wrap_content">
+ <com.google.android.material.tabs.TabLayout
+ android:id="@+id/tablayout"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ style="@style/TabLayoutStyle"
+ android:visibility="gone"/>
+
+ <com.android.wallpaper.livepicker.widget.ConstraintViewPager
+ android:id="@+id/viewpager"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"/>
- </com.android.wallpaper.livepicker.widget.ConstraintViewPager>
+ </LinearLayout>
- </LinearLayout>
+ </androidx.coordinatorlayout.widget.CoordinatorLayout>
<android.widget.Toolbar
android:id="@+id/toolbar"
diff --git a/res/layout/preview_action.xml b/res/layout/preview_action.xml
new file mode 100644
index 0000000..89a3c9e
--- /dev/null
+++ b/res/layout/preview_action.xml
@@ -0,0 +1,24 @@
+<!-- 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.
+-->
+
+<CheckBox
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ style="?android:attr/checkboxStyle"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:text="@string/preview"
+ android:textAllCaps="false"
+ android:textAppearance="?android:attr/actionMenuTextAppearance"
+ android:background="?android:attr/selectableItemBackgroundBorderless"/>
diff --git a/res/layout/set_wallpaper_action.xml b/res/layout/set_wallpaper_action.xml
deleted file mode 100644
index 02f4fcd..0000000
--- a/res/layout/set_wallpaper_action.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<!--
- ~ Copyright (C) 2016 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
- -->
-
-<Button
- xmlns:android="http://schemas.android.com/apk/res/android"
- style="?android:attr/actionButtonStyle"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:text="@string/set_live_wallpaper"
- android:textAppearance="?android:attr/actionMenuTextAppearance"
- android:background="?android:attr/selectableItemBackgroundBorderless"/> \ No newline at end of file
diff --git a/res/menu/menu_preview.xml b/res/menu/menu_preview.xml
index c8d450a..183ffd4 100644
--- a/res/menu/menu_preview.xml
+++ b/res/menu/menu_preview.xml
@@ -16,6 +16,11 @@
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
+ <item android:id="@+id/preview"
+ android:checkable="true"
+ android:showAsAction="ifRoom"
+ android:actionLayout="@layout/preview_action"/>
+
<item
android:id="@+id/configure"
android:icon="@drawable/ic_settings"
diff --git a/res/values/dimensions.xml b/res/values/dimensions.xml
index 85ce7db..a1ccd3f 100644
--- a/res/values/dimensions.xml
+++ b/res/values/dimensions.xml
@@ -33,6 +33,7 @@
<dimen name="preview_gradient_background_height">256dp</dimen>
<!-- Dimensions for the preview attribution pane. -->
+ <dimen name="preview_attribution_pane_collapsed_height">0dp</dimen>
<dimen name="preview_attribution_pane_horizontal_padding">24dp</dimen>
<dimen name="preview_attribution_pane_extra_spacer_height">16dp</dimen>
<dimen name="preview_attribution_pane_inner_spacer_height">14dp</dimen>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 824c23b..4ade992 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -33,6 +33,8 @@
<string name="configure_wallpaper">Settingsā€¦</string>
<!-- List item for deleting the current wallpaper -->
<string name="delete_live_wallpaper">Delete</string>
+ <!-- List item for showing the current wallpaper by hiding bottom panel. -->
+ <string name="preview">Preview</string>
<!-- Button label on Wallpaper Gallery screen; user selects this button to set a specific wallpaper -->
<string name="wallpaper_instructions">Set wallpaper</string>
<!-- Warning message, no live wallpapers available. -->
@@ -61,4 +63,12 @@
<!-- Confirmation dialog. Shown after user selects to delete one wallpaper. [CHAR LIMIT=NONE] -->
<string name="delete_wallpaper_confirmation">Delete this wallpaper from your phone?</string>
+
+ <!-- Content description for a checkbox letting the user collapse a visual panel showing info
+ about the wallpaper being previewed. [CHAR LIMIT=none] -->
+ <string name="collapse_attribution_panel">Collapse wallpaper info panel</string>
+
+ <!-- Content description for a checkbox letting the user expand a visual panel showing info
+ about the wallpaper being previewed. [CHAR LIMIT=none] -->
+ <string name="expand_attribution_panel">Expand wallpaper info panel</string>
</resources>