Skip to content

Commit

Permalink
Merge pull request #30 from Steve-Mr/wheel
Browse files Browse the repository at this point in the history
[fix] small fix
  • Loading branch information
Steve-Mr authored Jun 28, 2024
2 parents 220f846 + bdd5d89 commit 2bec1d3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
13 changes: 9 additions & 4 deletions app/src/main/java/com/maary/shareas/activity/StartActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/drawable/ic_center_horizontal.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
android:width="800dp"
android:height="800dp"
android:viewportWidth="24"
android:viewportHeight="24">
android:viewportHeight="24"
android:tint="?android:attr/textColorPrimary">
<path
android:fillColor="#FF000000"
android:pathData="M16.707,12H23v1h-6.295l2.648,2.647 -0.707,0.707 -3.854,-3.853 3.854,-3.854 0.707,0.707zM5.647,9.354L8.293,12H2v1h6.295l-2.648,2.647 0.707,0.707 3.854,-3.853 -3.854,-3.854zM12,19h1V6h-1z"/>
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/drawable/ic_center_vertical.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
android:width="800dp"
android:height="800dp"
android:viewportWidth="24"
android:viewportHeight="24">
android:viewportHeight="24"
android:tint="?android:attr/textColorPrimary">
<path
android:fillColor="#FF000000"
android:pathData="M12.501,14.792l3.854,3.854 -0.707,0.707L13,16.705V23h-1v-6.293l-2.646,2.646 -0.707,-0.707zM8.647,6.354l3.854,3.854 3.854,-3.854 -0.707,-0.707L13,8.295V2h-1v6.293L9.354,5.647zM6,13h13v-1H6z"/>
Expand Down

0 comments on commit 2bec1d3

Please sign in to comment.