summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-03-23 23:30:02 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-03-23 23:30:02 +0000
commit8df027a38f2618591ec4f3094cdb0c3d34b44f4d (patch)
treeac792ecea880a5c27c6ef37f9f0287d19fe2f6ab
parent0f34c5f771990b672566a8dcd455a58f8279c64e (diff)
parenta455f4e3a5f1f2724a1b0b1f60069e2aeeabe26f (diff)
Snap for 9803571 from a455f4e3a5f1f2724a1b0b1f60069e2aeeabe26f to tm-qpr3-release
Change-Id: I9b5b7278f3f32b1ff0ad0e759297530649129a33
-rw-r--r--res/drawable/exit_full_preview_cross.xml20
-rw-r--r--res/drawable/ic_close.xml11
-rw-r--r--res/layout/fragment_wallpaper_preview.xml15
-rwxr-xr-xres/values/colors.xml2
-rw-r--r--src/com/android/wallpaper/picker/individual/IndividualPickerFragment2.kt36
5 files changed, 69 insertions, 15 deletions
diff --git a/res/drawable/exit_full_preview_cross.xml b/res/drawable/exit_full_preview_cross.xml
new file mode 100644
index 00000000..e3d341fe
--- /dev/null
+++ b/res/drawable/exit_full_preview_cross.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2022 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 android:drawable="@drawable/wallpaper_control_button_on_background" />
+ <item android:drawable="@drawable/ic_close" />
+</layer-list> \ No newline at end of file
diff --git a/res/drawable/ic_close.xml b/res/drawable/ic_close.xml
new file mode 100644
index 00000000..bd0d8341
--- /dev/null
+++ b/res/drawable/ic_close.xml
@@ -0,0 +1,11 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="48dp"
+ android:height="48dp"
+ android:viewportWidth="960"
+ android:viewportHeight="960"
+ android:tintMode="multiply"
+ android:tint="@color/text_color_on_accent">
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="M249,753L207,711L438,480L207,249L249,207L480,438L711,207L753,249L522,480L753,711L711,753L480,522L249,753Z"/>
+</vector>
diff --git a/res/layout/fragment_wallpaper_preview.xml b/res/layout/fragment_wallpaper_preview.xml
index ed8e2bb5..cf0f52ca 100644
--- a/res/layout/fragment_wallpaper_preview.xml
+++ b/res/layout/fragment_wallpaper_preview.xml
@@ -70,6 +70,21 @@
app:layout_constraintTop_toTopOf="@+id/toolbar"
app:layout_constraintBottom_toBottomOf="@+id/toolbar" />
+ <View
+ android:id="@+id/exit_full_preview_button"
+ android:layout_width="@dimen/wallpaper_control_button_size"
+ android:layout_height="@dimen/wallpaper_control_button_size"
+ android:layout_gravity="center_vertical"
+ android:foreground="@drawable/exit_full_preview_cross"
+ android:elevation="@dimen/wallpaper_preview_buttons_elevation"
+ android:gravity="center"
+ android:layout_marginEnd="@dimen/set_wallpaper_button_margin_end"
+ android:visibility="gone"
+ android:clickable="true"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintTop_toTopOf="@+id/toolbar"
+ app:layout_constraintBottom_toBottomOf="@+id/toolbar" />
+
<com.android.wallpaper.widget.WallpaperDownloadButton
android:id="@+id/button_download_wallpaper"
android:layout_width="@dimen/wallpaper_control_button_size"
diff --git a/res/values/colors.xml b/res/values/colors.xml
index a2567ef2..ec437ad3 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">#66000000</color>
+ <color name="wallpaper_preview_scrim_color">#99000000</color>
</resources>
diff --git a/src/com/android/wallpaper/picker/individual/IndividualPickerFragment2.kt b/src/com/android/wallpaper/picker/individual/IndividualPickerFragment2.kt
index fb2a2f89..198b3fde 100644
--- a/src/com/android/wallpaper/picker/individual/IndividualPickerFragment2.kt
+++ b/src/com/android/wallpaper/picker/individual/IndividualPickerFragment2.kt
@@ -197,22 +197,12 @@ class IndividualPickerFragment2 :
if (mToolbar != null && isRotationEnabled()) {
setUpToolbarMenu(R.menu.individual_picker_menu)
}
- fetchWallpapers(false)
+ var shouldForceReload = false
if (category.supportsThirdParty()) {
- appStatusListener =
- PackageStatusNotifier.Listener { pkgName: String?, status: Int ->
- if (
- status != PackageStatusNotifier.PackageStatus.REMOVED ||
- category.containsThirdParty(pkgName)
- ) {
- fetchWallpapers(true)
- }
- }
- packageStatusNotifier?.addListener(
- appStatusListener,
- WallpaperService.SERVICE_INTERFACE
- )
+ shouldForceReload = true
}
+ fetchWallpapers(shouldForceReload)
+ registerPackageListener(category)
}
private fun fetchWallpapers(forceReload: Boolean) {
@@ -266,6 +256,24 @@ class IndividualPickerFragment2 :
)
}
+ private fun registerPackageListener(category: Category) {
+ if (category.supportsThirdParty()) {
+ appStatusListener =
+ PackageStatusNotifier.Listener { pkgName: String?, status: Int ->
+ if (
+ status != PackageStatusNotifier.PackageStatus.REMOVED ||
+ category.containsThirdParty(pkgName)
+ ) {
+ fetchWallpapers(true)
+ }
+ }
+ packageStatusNotifier?.addListener(
+ appStatusListener,
+ WallpaperService.SERVICE_INTERFACE
+ )
+ }
+ }
+
private fun updateLoading() {
if (isWallpapersReceived) {
loading?.hide()