diff options
author | George Lin <giolin@google.com> | 2023-03-20 16:18:17 +0000 |
---|---|---|
committer | George Lin <giolin@google.com> | 2023-03-21 13:59:07 +0000 |
commit | 4e1ea35fa7e4b5764908093dff16fcdac52e9eef (patch) | |
tree | eb840d344b0a979f9408193716b69652f97a214a | |
parent | d83706f73143b89ae2ecbda621a57eafaf2664e4 (diff) |
[WPP2] Animate hide wallpaper preview controller
1. Make the black scrim gradient at top and bottom only
2. Hide all the control when on click
Test: https://drive.google.com/file/d/1kkomcgWui1FdCR23_HsvQ62fgJNDqBZB/view?usp=sharing&resourcekey=0-lAkkTdoN_kYSuR5ltUe7lQ
Bug: 274184171
Change-Id: I94f20d62bcd056b58ef3c633d6817df9e31fe1fe
-rw-r--r-- | res/drawable/gradient_black_scrim.xml | 39 | ||||
-rw-r--r-- | res/layout/fragment_wallpaper_preview.xml | 2 | ||||
-rwxr-xr-x | res/values/colors.xml | 2 |
3 files changed, 41 insertions, 2 deletions
diff --git a/res/drawable/gradient_black_scrim.xml b/res/drawable/gradient_black_scrim.xml new file mode 100644 index 00000000..494b3714 --- /dev/null +++ b/res/drawable/gradient_black_scrim.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2023 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. +--> +<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> + <item> + <shape> + <gradient + android:angle="90" + android:startColor="@android:color/transparent" + android:centerColor="@android:color/transparent" + android:endColor="@color/wallpaper_preview_scrim_color" + android:centerY="0.8" /> + </shape> + </item> + + <item> + <shape> + <gradient + android:angle="90" + android:startColor="@color/wallpaper_preview_scrim_color" + android:centerColor="@android:color/transparent" + android:endColor="@android:color/transparent" + android:centerY="0.2" /> + </shape> + </item> +</layer-list>
\ No newline at end of file diff --git a/res/layout/fragment_wallpaper_preview.xml b/res/layout/fragment_wallpaper_preview.xml index f6a9c707..ed8e2bb5 100644 --- a/res/layout/fragment_wallpaper_preview.xml +++ b/res/layout/fragment_wallpaper_preview.xml @@ -38,7 +38,7 @@ android:id="@+id/preview_scrim" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@color/wallpaper_preview_scrim_color" + android:background="@drawable/gradient_black_scrim" android:importantForAccessibility="noHideDescendants" /> <androidx.constraintlayout.widget.ConstraintLayout diff --git a/res/values/colors.xml b/res/values/colors.xml index 4268ddfd..a2567ef2 100755 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -55,5 +55,5 @@ <color name="text_color_secondary">@color/settingslib_text_color_secondary</color> <color name="text_color_secondary_inverse">@color/settingslib_text_color_secondary_device_default</color> - <color name="wallpaper_preview_scrim_color">#4d000000</color> + <color name="wallpaper_preview_scrim_color">#66000000</color> </resources> |