From 614e31a986a36a50b9a2f6cf14511246a8c97439 Mon Sep 17 00:00:00 2001
From: Maary <24504742+Steve-Mr@users.noreply.github.com>
Date: Fri, 28 Jun 2024 18:05:23 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=A5=87=E6=80=AA=20bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../com/maary/shareas/activity/StartActivity.kt | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/app/src/main/java/com/maary/shareas/activity/StartActivity.kt b/app/src/main/java/com/maary/shareas/activity/StartActivity.kt
index cc1aa1f..6382307 100644
--- a/app/src/main/java/com/maary/shareas/activity/StartActivity.kt
+++ b/app/src/main/java/com/maary/shareas/activity/StartActivity.kt
@@ -94,7 +94,7 @@ class StartActivity : AppCompatActivity(){
val homePFD:ParcelFileDescriptor?
var lockPFD:ParcelFileDescriptor?
val homeBitmap: Bitmap
- var lockBitmap: Bitmap?
+ var lockBitmap: Bitmap
if (checkPermission()){
homePFD = wallpaperManager.getWallpaperFile(WallpaperManager.FLAG_SYSTEM)
@@ -109,10 +109,15 @@ class StartActivity : AppCompatActivity(){
}else{
homeBitmap = (wallpaperManager.getBuiltInDrawable(WallpaperManager.FLAG_SYSTEM)).toBitmap()
- lockBitmap = (wallpaperManager.getBuiltInDrawable(WallpaperManager.FLAG_LOCK)).toBitmapOrNull()
- if (lockBitmap == null){
+ /**
+ * 持续产生
+ * java.lang.NullPointerException: wallpaperManager.getBuil…llpaperManager.FLAG_LOCK) must not be null
+ * 问题
+ * */
+// lockBitmap = (wallpaperManager.getBuiltInDrawable(WallpaperManager.FLAG_LOCK)).toBitmap()
+// if (lockBitmap == null){
lockBitmap = homeBitmap
- }
+// }
}
binding.homeContainer.setImageBitmap(homeBitmap)
binding.lockContainer.setImageBitmap(lockBitmap)
From bdd5d89af8e136e6a88271f2dda90d1a39b1bd6e Mon Sep 17 00:00:00 2001
From: Maary <24504742+Steve-Mr@users.noreply.github.com>
Date: Fri, 28 Jun 2024 18:09:36 +0800
Subject: [PATCH 2/2] add more ic drawable tint
---
app/src/main/res/drawable/ic_center_horizontal.xml | 3 ++-
app/src/main/res/drawable/ic_center_vertical.xml | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/app/src/main/res/drawable/ic_center_horizontal.xml b/app/src/main/res/drawable/ic_center_horizontal.xml
index f036e81..95011fe 100644
--- a/app/src/main/res/drawable/ic_center_horizontal.xml
+++ b/app/src/main/res/drawable/ic_center_horizontal.xml
@@ -2,7 +2,8 @@
android:width="800dp"
android:height="800dp"
android:viewportWidth="24"
- android:viewportHeight="24">
+ android:viewportHeight="24"
+ android:tint="?android:attr/textColorPrimary">
diff --git a/app/src/main/res/drawable/ic_center_vertical.xml b/app/src/main/res/drawable/ic_center_vertical.xml
index eb5853f..b148d84 100644
--- a/app/src/main/res/drawable/ic_center_vertical.xml
+++ b/app/src/main/res/drawable/ic_center_vertical.xml
@@ -2,7 +2,8 @@
android:width="800dp"
android:height="800dp"
android:viewportWidth="24"
- android:viewportHeight="24">
+ android:viewportHeight="24"
+ android:tint="?android:attr/textColorPrimary">