Compare commits

..
8 Commits
Author SHA1 Message Date
Anthonyy232 0e20f211f2 Removed android.permission.USE_EXACT_ALARM 2024-06-14 09:07:34 -07:00
Anthonyy232 6f4a2bec97 Push gradle-wrapper.jar 2024-06-13 02:16:47 -07:00
Anthonyy232 85e5e3007b Removed delay notification on first set as it no longer applies due to shift from foreground service to alarm approach
Changed wallpaper scaling 4x->1x to reduce required RAM usage and optimize computation time. Verified that the difference is marginal
2024-06-13 02:15:54 -07:00
Anthonyy232 4760ab01d5 Added additional error catching
Updated Kotlin to 2.0.0
Updated KSP to 2.0.0
Updated AboutLibraries to 11.2.1
2024-06-11 12:18:22 -07:00
Anthonyy232 d8fc106a89 Refactored refreshing album method to separate service call 2024-06-11 02:00:32 -07:00
Anthonyy232 f4bf2786de Updated version code 2024-06-07 23:25:56 -07:00
Anthonyy232 c2e7e38f97 Updated localization
Credit to Jesse205 for Simplified Chinese
Credit to abdalmoniem for Egyptian Arabic
2024-06-07 23:16:04 -07:00
Anthonyy232 343d358d22 Refactored code to be more readable 2024-06-07 12:10:13 -07:00
26 changed files with 966 additions and 530 deletions

No files matched your search

+1 -1
View File
@@ -4,6 +4,6 @@
<option name="jvmTarget" value="1.8" /> <option name="jvmTarget" value="1.8" />
</component> </component>
<component name="KotlinJpsPluginSettings"> <component name="KotlinJpsPluginSettings">
<option name="version" value="1.9.22" /> <option name="version" value="2.0.0" />
</component> </component>
</project> </project>
+263
View File
@@ -0,0 +1,263 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="direct_access_persist.xml">
<option name="deviceSelectionList">
<list>
<PersistentDeviceSelectionData>
<option name="api" value="27" />
<option name="brand" value="DOCOMO" />
<option name="codename" value="F01L" />
<option name="id" value="F01L" />
<option name="manufacturer" value="FUJITSU" />
<option name="name" value="F-01L" />
<option name="screenDensity" value="360" />
<option name="screenX" value="720" />
<option name="screenY" value="1280" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="28" />
<option name="brand" value="DOCOMO" />
<option name="codename" value="SH-01L" />
<option name="id" value="SH-01L" />
<option name="manufacturer" value="SHARP" />
<option name="name" value="AQUOS sense2 SH-01L" />
<option name="screenDensity" value="480" />
<option name="screenX" value="1080" />
<option name="screenY" value="2160" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="31" />
<option name="brand" value="samsung" />
<option name="codename" value="a51" />
<option name="id" value="a51" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy A51" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="google" />
<option name="codename" value="akita" />
<option name="id" value="akita" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 8a" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="samsung" />
<option name="codename" value="b0q" />
<option name="id" value="b0q" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy S22 Ultra" />
<option name="screenDensity" value="600" />
<option name="screenX" value="1440" />
<option name="screenY" value="3088" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="32" />
<option name="brand" value="google" />
<option name="codename" value="bluejay" />
<option name="id" value="bluejay" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 6a" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="29" />
<option name="brand" value="samsung" />
<option name="codename" value="crownqlteue" />
<option name="id" value="crownqlteue" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy Note9" />
<option name="screenDensity" value="420" />
<option name="screenX" value="2220" />
<option name="screenY" value="1080" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="samsung" />
<option name="codename" value="dm3q" />
<option name="id" value="dm3q" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy S23 Ultra" />
<option name="screenDensity" value="600" />
<option name="screenX" value="1440" />
<option name="screenY" value="3088" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="google" />
<option name="codename" value="felix" />
<option name="id" value="felix" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel Fold" />
<option name="screenDensity" value="420" />
<option name="screenX" value="2208" />
<option name="screenY" value="1840" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="google" />
<option name="codename" value="felix_camera" />
<option name="id" value="felix_camera" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel Fold (Camera-enabled)" />
<option name="screenDensity" value="420" />
<option name="screenX" value="2208" />
<option name="screenY" value="1840" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="samsung" />
<option name="codename" value="gts8uwifi" />
<option name="id" value="gts8uwifi" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy Tab S8 Ultra" />
<option name="screenDensity" value="320" />
<option name="screenX" value="1848" />
<option name="screenY" value="2960" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="google" />
<option name="codename" value="husky" />
<option name="id" value="husky" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 8 Pro" />
<option name="screenDensity" value="390" />
<option name="screenX" value="1008" />
<option name="screenY" value="2244" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="30" />
<option name="brand" value="motorola" />
<option name="codename" value="java" />
<option name="id" value="java" />
<option name="manufacturer" value="Motorola" />
<option name="name" value="G20" />
<option name="screenDensity" value="280" />
<option name="screenX" value="720" />
<option name="screenY" value="1600" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="google" />
<option name="codename" value="lynx" />
<option name="id" value="lynx" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 7a" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="31" />
<option name="brand" value="google" />
<option name="codename" value="oriole" />
<option name="id" value="oriole" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 6" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="google" />
<option name="codename" value="panther" />
<option name="id" value="panther" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 7" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="31" />
<option name="brand" value="samsung" />
<option name="codename" value="q2q" />
<option name="id" value="q2q" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy Z Fold3" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1768" />
<option name="screenY" value="2208" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="samsung" />
<option name="codename" value="q5q" />
<option name="id" value="q5q" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy Z Fold5" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1812" />
<option name="screenY" value="2176" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="30" />
<option name="brand" value="google" />
<option name="codename" value="r11" />
<option name="id" value="r11" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel Watch" />
<option name="screenDensity" value="320" />
<option name="screenX" value="384" />
<option name="screenY" value="384" />
<option name="type" value="WEAR_OS" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="30" />
<option name="brand" value="google" />
<option name="codename" value="redfin" />
<option name="id" value="redfin" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 5" />
<option name="screenDensity" value="440" />
<option name="screenX" value="1080" />
<option name="screenY" value="2340" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="google" />
<option name="codename" value="shiba" />
<option name="id" value="shiba" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel 8" />
<option name="screenDensity" value="420" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="33" />
<option name="brand" value="google" />
<option name="codename" value="tangorpro" />
<option name="id" value="tangorpro" />
<option name="manufacturer" value="Google" />
<option name="name" value="Pixel Tablet" />
<option name="screenDensity" value="320" />
<option name="screenX" value="1600" />
<option name="screenY" value="2560" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="29" />
<option name="brand" value="samsung" />
<option name="codename" value="x1q" />
<option name="id" value="x1q" />
<option name="manufacturer" value="Samsung" />
<option name="name" value="Galaxy S20" />
<option name="screenDensity" value="480" />
<option name="screenX" value="1440" />
<option name="screenY" value="3200" />
</PersistentDeviceSelectionData>
</list>
</option>
</component>
</project>
+22 -21
View File
@@ -3,8 +3,9 @@ plugins {
id("org.jetbrains.kotlin.android") id("org.jetbrains.kotlin.android")
id("com.google.devtools.ksp") id("com.google.devtools.ksp")
id("com.google.dagger.hilt.android") id("com.google.dagger.hilt.android")
id ("com.mikepenz.aboutlibraries.plugin") id("com.mikepenz.aboutlibraries.plugin")
id ("org.jetbrains.kotlin.plugin.serialization") id("org.jetbrains.kotlin.plugin.serialization")
id("org.jetbrains.kotlin.plugin.compose")
} }
ksp { ksp {
arg("room.schemaLocation", "$projectDir/schemas") arg("room.schemaLocation", "$projectDir/schemas")
@@ -18,8 +19,8 @@ android {
applicationId = "com.anthonyla.paperize" applicationId = "com.anthonyla.paperize"
minSdk = 26 minSdk = 26
targetSdk = 34 targetSdk = 34
versionCode = 20 versionCode = 23
versionName = "1.5.2" versionName = "1.5.5"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables { vectorDrawables {
@@ -76,47 +77,47 @@ androidComponents {
dependencies { dependencies {
implementation("androidx.core:core-ktx:1.13.1") implementation("androidx.core:core-ktx:1.13.1")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.1") implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.2")
implementation("androidx.activity:activity-compose:1.9.0") implementation("androidx.activity:activity-compose:1.9.0")
implementation(platform("androidx.compose:compose-bom:2024.05.00")) implementation(platform("androidx.compose:compose-bom:2024.06.00"))
implementation("androidx.compose.ui:ui:1.7.0-beta02") implementation("androidx.compose.ui:ui:1.7.0-beta03")
implementation("androidx.compose.ui:ui-graphics:1.7.0-beta02") implementation("androidx.compose.ui:ui-graphics:1.7.0-beta03")
implementation("androidx.compose.ui:ui-tooling-preview:1.7.0-beta02") implementation("androidx.compose.ui:ui-tooling-preview:1.7.0-beta03")
implementation("androidx.compose.material3:material3:1.3.0-beta02") implementation("androidx.compose.material3:material3:1.3.0-beta03")
implementation("androidx.navigation:navigation-compose:2.8.0-beta02") implementation("androidx.navigation:navigation-compose:2.8.0-beta03")
implementation("androidx.compose.material:material:1.7.0-beta02") implementation("androidx.compose.material:material:1.7.0-beta03")
implementation("androidx.datastore:datastore:1.1.1") implementation("androidx.datastore:datastore:1.1.1")
implementation("androidx.datastore:datastore-preferences:1.1.1") implementation("androidx.datastore:datastore-preferences:1.1.1")
implementation("androidx.compose.material:material-icons-extended:1.7.0-beta02") implementation("androidx.compose.material:material-icons-extended:1.7.0-beta03")
implementation("com.google.accompanist:accompanist-adaptive:0.34.0") implementation("com.google.accompanist:accompanist-adaptive:0.34.0")
implementation("androidx.hilt:hilt-navigation-compose:1.2.0") implementation("androidx.hilt:hilt-navigation-compose:1.2.0")
implementation("androidx.compose.animation:animation:1.7.0-beta02") implementation("androidx.compose.animation:animation:1.7.0-beta03")
implementation("androidx.core:core-splashscreen:1.2.0-alpha01") implementation("androidx.core:core-splashscreen:1.2.0-alpha01")
implementation("androidx.lifecycle:lifecycle-runtime-compose:2.8.1") implementation("androidx.lifecycle:lifecycle-runtime-compose:2.8.2")
implementation("com.google.code.gson:gson:2.11.0") implementation("com.google.code.gson:gson:2.11.0")
implementation("androidx.documentfile:documentfile:1.1.0-alpha01") implementation("androidx.documentfile:documentfile:1.1.0-alpha01")
implementation("net.engawapg.lib:zoomable:1.7.0-beta02") implementation("net.engawapg.lib:zoomable:1.7.0-beta02")
implementation("com.github.skydoves:landscapist-glide:2.3.3") implementation("com.github.skydoves:landscapist-glide:2.3.4")
implementation("androidx.work:work-runtime-ktx:2.10.0-alpha02") implementation("androidx.work:work-runtime-ktx:2.10.0-alpha02")
implementation("androidx.hilt:hilt-work:1.2.0") implementation("androidx.hilt:hilt-work:1.2.0")
implementation("com.airbnb.android:lottie-compose:6.4.1") implementation("com.airbnb.android:lottie-compose:6.4.1")
implementation("com.google.accompanist:accompanist-permissions:0.35.0-alpha") implementation("com.google.accompanist:accompanist-permissions:0.35.0-alpha")
implementation("com.mikepenz:aboutlibraries-core:11.2.1") implementation("com.mikepenz:aboutlibraries-core:11.2.1")
implementation("com.mikepenz:aboutlibraries-compose-m3:11.2.1") implementation("com.mikepenz:aboutlibraries-compose-m3:11.2.1")
implementation("androidx.compose.foundation:foundation:1.7.0-beta02") implementation("androidx.compose.foundation:foundation:1.7.0-beta03")
testImplementation("junit:junit:4.13.2") testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5") androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.6.0-rc01") androidTestImplementation("androidx.test.espresso:espresso-core:3.6.0-rc01")
androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.7.0-beta02") androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.7.0-beta03")
debugImplementation("androidx.compose.ui:ui-tooling:1.7.0-beta02") debugImplementation("androidx.compose.ui:ui-tooling:1.7.0-beta03")
debugImplementation("androidx.compose.ui:ui-test-manifest:1.7.0-beta02") debugImplementation("androidx.compose.ui:ui-test-manifest:1.7.0-beta03")
implementation("com.google.dagger:hilt-android:2.51.1") implementation("com.google.dagger:hilt-android:2.51.1")
ksp("com.google.dagger:hilt-android-compiler:2.51.1") ksp("com.google.dagger:hilt-android-compiler:2.51.1")
implementation("androidx.room:room-runtime:2.6.1") implementation("androidx.room:room-runtime:2.6.1")
ksp("androidx.room:room-compiler:2.6.1") ksp("androidx.room:room-compiler:2.6.1")
implementation("androidx.room:room-ktx:2.6.1") implementation("androidx.room:room-ktx:2.6.1")
implementation("com.lazygeniouz:dfc:1.0.8") implementation("com.lazygeniouz:dfc:1.0.8")
implementation ("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3") implementation ("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.0")
implementation("com.github.android:renderscript-intrinsics-replacement-toolkit:b6363490c3") implementation("com.github.android:renderscript-intrinsics-replacement-toolkit:b6363490c3")
} }
-1
View File
@@ -3,7 +3,6 @@
xmlns:tools="http://schemas.android.com/tools"> xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" /> <uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
<uses-permission android:name="android.permission.USE_EXACT_ALARM" />
<uses-permission android:name="android.permission.SET_WALLPAPER"/> <uses-permission android:name="android.permission.SET_WALLPAPER"/>
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" /> <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
@@ -1,4 +1,5 @@
package com.anthonyla.paperize.core package com.anthonyla.paperize.core
import android.app.WallpaperManager
import android.content.Context import android.content.Context
import android.graphics.Bitmap import android.graphics.Bitmap
import android.graphics.BitmapFactory import android.graphics.BitmapFactory
@@ -18,7 +19,7 @@ import com.anthonyla.paperize.feature.wallpaper.domain.model.Wallpaper
import com.google.android.renderscript.Toolkit import com.google.android.renderscript.Toolkit
import com.lazygeniouz.dfc.file.DocumentFileCompat import com.lazygeniouz.dfc.file.DocumentFileCompat
enum class Type { HOME, LOCK, BOTH } enum class Type { HOME, LOCK, BOTH, REFRESH }
/** /**
* Get the dimensions of the image from the uri * Get the dimensions of the image from the uri
@@ -156,7 +157,6 @@ fun getWallpaperFromFolder(folderUri: String, context: Context): List<String> {
val folderDocumentFile = DocumentFile.fromTreeUri(context, folderUri.toUri()) val folderDocumentFile = DocumentFile.fromTreeUri(context, folderUri.toUri())
return listFilesRecursive(folderDocumentFile, context) return listFilesRecursive(folderDocumentFile, context)
} }
} }
/** /**
@@ -198,16 +198,30 @@ fun listFilesRecursive(parent: DocumentFile?, context: Context): List<String> {
*/ */
fun findFirstValidUri(context: Context, wallpapers: List<Wallpaper>, folders: List<Folder>): String? { fun findFirstValidUri(context: Context, wallpapers: List<Wallpaper>, folders: List<Folder>): String? {
wallpapers.forEach { wallpaper -> wallpapers.forEach { wallpaper ->
val file = DocumentFile.fromSingleUri(context, wallpaper.wallpaperUri.toUri()) try {
if (file?.exists() == true) { val file = DocumentFileCompat.fromSingleUri(context, wallpaper.wallpaperUri.toUri())
return wallpaper.wallpaperUri if (file?.exists() == true) {
return wallpaper.wallpaperUri
}
} catch (e: Exception) {
val file = DocumentFile.fromSingleUri(context, wallpaper.wallpaperUri.toUri())
if (file?.exists() == true) {
return wallpaper.wallpaperUri
}
} }
} }
folders.forEach { folder -> folders.forEach { folder ->
folder.wallpapers.forEach { wallpaper -> folder.wallpapers.forEach { wallpaper ->
val file = DocumentFile.fromSingleUri(context, wallpaper.toUri()) try {
if (file?.exists() == true) { val file = DocumentFileCompat.fromSingleUri(context, wallpaper.toUri())
return wallpaper if (file?.exists() == true) {
return wallpaper
}
} catch (e: Exception) {
val file = DocumentFile.fromSingleUri(context, wallpaper.toUri())
if (file?.exists() == true) {
return wallpaper
}
} }
} }
} }
@@ -239,3 +253,11 @@ fun isValidUri(context: Context, uriString: String?): Boolean {
} catch (e: Exception) { false } } catch (e: Exception) { false }
} }
/**
* Check if device uses a live wallpaper
*/
fun isLiveWallpaperSet(context: Context): Boolean {
val wallpaperManager = WallpaperManager.getInstance(context)
return wallpaperManager.wallpaperInfo != null
}
@@ -85,6 +85,7 @@ class MainActivity : ComponentActivity() {
val settingsState = settingsViewModel.state.collectAsStateWithLifecycle() val settingsState = settingsViewModel.state.collectAsStateWithLifecycle()
val isFirstLaunch = runBlocking { settingsDataStoreImpl.getBoolean(SettingsConstants.FIRST_LAUNCH) } ?: true val isFirstLaunch = runBlocking { settingsDataStoreImpl.getBoolean(SettingsConstants.FIRST_LAUNCH) } ?: true
if (isFirstLaunch) { if (isFirstLaunch) {
scheduler.cancelWallpaperAlarm()
wallpaperScreenViewModel.onEvent(WallpaperEvent.Reset) wallpaperScreenViewModel.onEvent(WallpaperEvent.Reset)
settingsViewModel.onEvent(SettingsEvent.Reset) settingsViewModel.onEvent(SettingsEvent.Reset)
albumsViewModel.onEvent(AlbumsEvent.Reset) albumsViewModel.onEvent(AlbumsEvent.Reset)
@@ -258,6 +258,7 @@ fun PaperizeApp(
scheduleSeparately = settingsState.value.scheduleSeparately scheduleSeparately = settingsState.value.scheduleSeparately
) )
alarmItem.let{scheduler.scheduleWallpaperAlarm(it, null, true, true)} alarmItem.let{scheduler.scheduleWallpaperAlarm(it, null, true, true)}
scheduler.scheduleRefresh()
} }
} }
}, },
@@ -272,6 +273,7 @@ fun PaperizeApp(
scheduleSeparately = settingsState.value.scheduleSeparately scheduleSeparately = settingsState.value.scheduleSeparately
) )
alarmItem.let{scheduler.scheduleWallpaperAlarm(it, null, true, true)} alarmItem.let{scheduler.scheduleWallpaperAlarm(it, null, true, true)}
scheduler.scheduleRefresh()
} }
} }
}, },
@@ -287,6 +289,7 @@ fun PaperizeApp(
scheduleSeparately = settingsState.value.scheduleSeparately scheduleSeparately = settingsState.value.scheduleSeparately
) )
alarmItem.let{scheduler.updateWallpaperAlarm(it)} alarmItem.let{scheduler.updateWallpaperAlarm(it)}
scheduler.scheduleRefresh()
} }
} }
@@ -303,6 +306,7 @@ fun PaperizeApp(
scheduleSeparately = settingsState.value.scheduleSeparately scheduleSeparately = settingsState.value.scheduleSeparately
) )
alarmItem.let{scheduler.updateWallpaperAlarm(it)} alarmItem.let{scheduler.updateWallpaperAlarm(it)}
scheduler.scheduleRefresh()
} }
} }
@@ -328,10 +332,23 @@ fun PaperizeApp(
scheduleSeparately = settingsState.value.scheduleSeparately, scheduleSeparately = settingsState.value.scheduleSeparately,
blur = settingsState.value.blur, blur = settingsState.value.blur,
blurPercentage = settingsState.value.blurPercentage, blurPercentage = settingsState.value.blurPercentage,
firstSet = settingsState.value.firstSet,
onToggleChanger = { enableWallpaperChanger -> onToggleChanger = { enableWallpaperChanger ->
settingsViewModel.onEvent(SettingsEvent.SetChangerToggle(enableWallpaperChanger)) settingsViewModel.onEvent(SettingsEvent.SetChangerToggle(enableWallpaperChanger))
if (selectedState.value.selectedAlbum!= null && enableWallpaperChanger && (settingsState.value.setHomeWallpaper || settingsState.value.setLockWallpaper)) { if (selectedState.value.selectedAlbum != null && enableWallpaperChanger && (settingsState.value.setHomeWallpaper || settingsState.value.setLockWallpaper)) {
wallpaperScreenViewModel.onEvent(
WallpaperEvent.UpdateSelectedAlbum(
selectedState.value.selectedAlbum!!.copy(
album = selectedState.value.selectedAlbum!!.album.copy(
currentHomeWallpaper = if (settingsState.value.setHomeWallpaper) selectedState.value.selectedAlbum!!.album.homeWallpapersInQueue.firstOrNull() else null,
currentLockWallpaper = if (settingsState.value.scheduleSeparately && settingsState.value.setLockWallpaper) selectedState.value.selectedAlbum!!.album.lockWallpapersInQueue.firstOrNull() else if (settingsState.value.setLockWallpaper) selectedState.value.selectedAlbum!!.album.homeWallpapersInQueue.firstOrNull() else null
)
),
null,
settingsState.value.scheduleSeparately,
settingsState.value.setHomeWallpaper,
settingsState.value.setLockWallpaper
)
)
job?.cancel() job?.cancel()
job = scope.launch { job = scope.launch {
delay(2000) delay(2000)
@@ -341,16 +358,22 @@ fun PaperizeApp(
scheduleSeparately = settingsState.value.scheduleSeparately scheduleSeparately = settingsState.value.scheduleSeparately
) )
alarmItem.let{scheduler.scheduleWallpaperAlarm(it, null, true, true)} alarmItem.let{scheduler.scheduleWallpaperAlarm(it, null, true, true)}
scheduler.scheduleRefresh()
} }
} }
else { scheduler.cancelWallpaperAlarm() } else { scheduler.cancelWallpaperAlarm() }
}, },
onSelectAlbum = {album -> onSelectAlbum = {album ->
settingsViewModel.onEvent(SettingsEvent.SetChangerToggle(true)) settingsViewModel.onEvent(SettingsEvent.SetChangerToggle(true))
wallpaperScreenViewModel.onEvent(WallpaperEvent.UpdateSelectedAlbum(null, album, settingsState.value.scheduleSeparately)) wallpaperScreenViewModel.onEvent(
if (settingsState.value.firstSet) { WallpaperEvent.UpdateSelectedAlbum(
settingsViewModel.onEvent(SettingsEvent.SetFirstSet) null,
} album,
settingsState.value.scheduleSeparately,
settingsState.value.setHomeWallpaper,
settingsState.value.setLockWallpaper
)
)
job?.cancel() job?.cancel()
job = scope.launch { job = scope.launch {
val alarmItem = WallpaperAlarmItem( val alarmItem = WallpaperAlarmItem(
@@ -359,6 +382,7 @@ fun PaperizeApp(
scheduleSeparately = settingsState.value.scheduleSeparately scheduleSeparately = settingsState.value.scheduleSeparately
) )
alarmItem.let{scheduler.scheduleWallpaperAlarm(it, null, true, true)} alarmItem.let{scheduler.scheduleWallpaperAlarm(it, null, true, true)}
scheduler.scheduleRefresh()
} }
}, },
onDarkenPercentage = { onDarkenPercentage = {
@@ -414,6 +438,7 @@ fun PaperizeApp(
scheduleSeparately = false scheduleSeparately = false
) )
alarmItem.let{scheduler.scheduleWallpaperAlarm(it, null, true, true)} alarmItem.let{scheduler.scheduleWallpaperAlarm(it, null, true, true)}
scheduler.scheduleRefresh()
} }
} }
else if (selectedState.value.selectedAlbum != null && settingsState.value.enableChanger) { else if (selectedState.value.selectedAlbum != null && settingsState.value.enableChanger) {
@@ -443,7 +468,9 @@ fun PaperizeApp(
timeInMinutes2 = settingsState.value.lockInterval, timeInMinutes2 = settingsState.value.lockInterval,
scheduleSeparately = false scheduleSeparately = false
) )
alarmItem.let{scheduler.scheduleWallpaperAlarm(it, null, true, true)}} alarmItem.let{scheduler.scheduleWallpaperAlarm(it, null, true, true)}
scheduler.scheduleRefresh()
}
} }
else if (selectedState.value.selectedAlbum != null && settingsState.value.enableChanger) { else if (selectedState.value.selectedAlbum != null && settingsState.value.enableChanger) {
job?.cancel() job?.cancel()
@@ -456,6 +483,21 @@ fun PaperizeApp(
onScheduleSeparatelyChange = { changeSeparately -> onScheduleSeparatelyChange = { changeSeparately ->
settingsViewModel.onEvent(SettingsEvent.SetScheduleSeparately(changeSeparately)) settingsViewModel.onEvent(SettingsEvent.SetScheduleSeparately(changeSeparately))
if (selectedState.value.selectedAlbum!= null && settingsState.value.enableChanger) { if (selectedState.value.selectedAlbum!= null && settingsState.value.enableChanger) {
wallpaperScreenViewModel.onEvent(
WallpaperEvent.UpdateSelectedAlbum(
selectedState.value.selectedAlbum!!.copy(
album = selectedState.value.selectedAlbum!!.album.copy(
currentHomeWallpaper = if (settingsState.value.setHomeWallpaper) selectedState.value.selectedAlbum!!.album.homeWallpapersInQueue.firstOrNull() else null,
currentLockWallpaper = if (changeSeparately && settingsState.value.setLockWallpaper) selectedState.value.selectedAlbum!!.album.lockWallpapersInQueue.firstOrNull() else if (settingsState.value.setLockWallpaper) selectedState.value.selectedAlbum!!.album.homeWallpapersInQueue.firstOrNull() else null
)
),
null,
settingsState.value.scheduleSeparately,
settingsState.value.setHomeWallpaper,
settingsState.value.setLockWallpaper
)
)
job?.cancel() job?.cancel()
job = scope.launch { job = scope.launch {
delay(2000) delay(2000)
@@ -465,6 +507,7 @@ fun PaperizeApp(
scheduleSeparately = changeSeparately scheduleSeparately = changeSeparately
) )
alarmItem.let{scheduler.scheduleWallpaperAlarm(it, null, true, true)} alarmItem.let{scheduler.scheduleWallpaperAlarm(it, null, true, true)}
scheduler.scheduleRefresh()
} }
} }
}, },
@@ -86,8 +86,17 @@ class AlbumsViewModel @Inject constructor (
albumWithWallpapers.forEach { albumWithWallpaper -> albumWithWallpapers.forEach { albumWithWallpaper ->
// Delete wallpaper if the URI is invalid // Delete wallpaper if the URI is invalid
val invalidWallpapers = albumWithWallpaper.wallpapers.filterNot { wallpaper -> val invalidWallpapers = albumWithWallpaper.wallpapers.filterNot { wallpaper ->
val file = DocumentFileCompat.fromSingleUri(context, wallpaper.wallpaperUri.toUri()) try {
file?.exists() == true val file = DocumentFileCompat.fromSingleUri(
context,
wallpaper.wallpaperUri.toUri()
)
file?.exists() == true
} catch (e: Exception) {
val file =
DocumentFile.fromSingleUri(context, wallpaper.wallpaperUri.toUri())
file?.exists() == true
}
} }
if (invalidWallpapers.isNotEmpty()) { if (invalidWallpapers.isNotEmpty()) {
repository.deleteWallpaperList(invalidWallpapers) repository.deleteWallpaperList(invalidWallpapers)
@@ -96,42 +105,99 @@ class AlbumsViewModel @Inject constructor (
// Update folder cover uri and wallpapers uri // Update folder cover uri and wallpapers uri
albumWithWallpaper.folders.forEach { folder -> albumWithWallpaper.folders.forEach { folder ->
try { try {
DocumentFileCompat.fromTreeUri(context, folder.folderUri.toUri())?.let { folderDirectory -> DocumentFileCompat.fromTreeUri(context, folder.folderUri.toUri())
if (!folderDirectory.isDirectory()) { ?.let { folderDirectory ->
repository.deleteFolder(folder) if (!folderDirectory.isDirectory()) {
} else { repository.deleteFolder(folder)
val wallpapers = getWallpaperFromFolder(folder.folderUri, context) } else {
val folderCoverFile = folder.coverUri?.let { DocumentFile.fromSingleUri(context, it.toUri()) } val wallpapers =
val folderCover = folderCoverFile?.takeIf { it.exists() }?.uri?.toString() ?: wallpapers.randomOrNull() getWallpaperFromFolder(folder.folderUri, context)
repository.updateFolder(folder.copy(coverUri = folderCover, wallpapers = wallpapers)) val folderCoverFile = folder.coverUri?.let {
DocumentFileCompat.fromSingleUri(
context,
it.toUri()
)
}
val folderCover =
folderCoverFile?.takeIf { it.exists() }?.uri?.toString()
?: wallpapers.randomOrNull()
repository.updateFolder(
folder.copy(
coverUri = folderCover,
wallpapers = wallpapers
)
)
}
} }
}
} catch (e: Exception) { } catch (e: Exception) {
DocumentFile.fromTreeUri(context, folder.folderUri.toUri())?.let { folderDirectory -> DocumentFile.fromTreeUri(context, folder.folderUri.toUri())
if (!folderDirectory.isDirectory) { ?.let { folderDirectory ->
repository.deleteFolder(folder) if (!folderDirectory.isDirectory) {
} else { repository.deleteFolder(folder)
val wallpapers = getWallpaperFromFolder(folder.folderUri, context) } else {
val folderCoverFile = folder.coverUri?.let { DocumentFile.fromSingleUri(context, it.toUri()) } val wallpapers =
val folderCover = folderCoverFile?.takeIf { it.exists() }?.uri?.toString() ?: wallpapers.randomOrNull() getWallpaperFromFolder(folder.folderUri, context)
repository.updateFolder(folder.copy(coverUri = folderCover, wallpapers = wallpapers)) try {
val folderCoverFile = folder.coverUri?.let {
DocumentFileCompat.fromSingleUri(
context,
it.toUri()
)
}
val folderCover =
folderCoverFile?.takeIf { it.exists() }?.uri?.toString()
?: wallpapers.randomOrNull()
repository.updateFolder(
folder.copy(
coverUri = folderCover,
wallpapers = wallpapers
)
)
} catch (e: Exception) {
val folderCoverFile = folder.coverUri?.let {
DocumentFile.fromSingleUri(
context,
it.toUri()
)
}
val folderCover =
folderCoverFile?.takeIf { it.exists() }?.uri?.toString()
?: wallpapers.randomOrNull()
repository.updateFolder(
folder.copy(
coverUri = folderCover,
wallpapers = wallpapers
)
)
}
}
} }
}
} }
} }
} albumWithWallpapers = repository.getAlbumsWithWallpaperAndFolder().first()
albumWithWallpapers = repository.getAlbumsWithWallpaperAndFolder().first() albumWithWallpapers.forEach { album ->
albumWithWallpapers.forEach { albumWithWallpaper -> // Delete empty albums
// Delete empty albums if (album.wallpapers.isEmpty() && album.folders.all { it.wallpapers.isEmpty() }) {
if (albumWithWallpaper.wallpapers.isEmpty() && albumWithWallpaper.folders.all { it.wallpapers.isEmpty() }) { repository.deleteAlbum(album.album)
repository.deleteAlbum(albumWithWallpaper.album) } else {
} // Update album cover uri if null or invalid
else { try {
// Update album cover uri if null or invalid val albumCoverFile = album.album.coverUri?.toUri()
val albumCoverFile = albumWithWallpaper.album.coverUri?.toUri()?.let { DocumentFile.fromSingleUri(context, it) } ?.let { DocumentFileCompat.fromSingleUri(context, it) }
if (albumCoverFile == null || !albumCoverFile.exists()) { if (albumCoverFile == null || !albumCoverFile.exists()) {
val newCoverUri = findFirstValidUri(context, albumWithWallpaper.wallpapers, albumWithWallpaper.folders) val newCoverUri =
repository.updateAlbum(albumWithWallpaper.album.copy(coverUri = newCoverUri)) findFirstValidUri(context, album.wallpapers, album.folders)
repository.updateAlbum(album.album.copy(coverUri = newCoverUri))
}
} catch (e: Exception) {
val albumCoverFile = album.album.coverUri?.toUri()
?.let { DocumentFile.fromSingleUri(context, it) }
if (albumCoverFile == null || !albumCoverFile.exists()) {
val newCoverUri =
findFirstValidUri(context, album.wallpapers, album.folders)
repository.updateAlbum(album.album.copy(coverUri = newCoverUri))
}
}
} }
} }
} }
@@ -19,7 +19,6 @@ import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.runtime.snapshotFlow
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import com.anthonyla.paperize.core.ScalingConstants import com.anthonyla.paperize.core.ScalingConstants
@@ -66,17 +65,23 @@ fun HomeScreen(
onBlurPercentageChange: (Int) -> Unit, onBlurPercentageChange: (Int) -> Unit,
onBlurChange: (Boolean) -> Unit, onBlurChange: (Boolean) -> Unit,
blurPercentage: Int, blurPercentage: Int,
firstSet: Boolean
) { ) {
var tabIndex by rememberSaveable { mutableIntStateOf(0) }
val tabItems = getTabItems() val tabItems = getTabItems()
val pagerState = rememberPagerState { tabItems.size } val pagerState = rememberPagerState(0) { tabItems.size }
var tabIndex by rememberSaveable { mutableIntStateOf(pagerState.currentPage) }
var addAlbumDialog by rememberSaveable { mutableStateOf(false) } var addAlbumDialog by rememberSaveable { mutableStateOf(false) }
if (addAlbumDialog) AddAlbumDialog( if (addAlbumDialog) AddAlbumDialog(
onDismissRequest = { addAlbumDialog = false }, onDismissRequest = { addAlbumDialog = false },
onConfirmation = { navigateToAddWallpaperScreen(it) } onConfirmation = { navigateToAddWallpaperScreen(it) }
) )
LaunchedEffect(tabIndex) {
pagerState.animateScrollToPage(tabIndex)
}
LaunchedEffect(pagerState.currentPage) {
tabIndex = pagerState.currentPage
}
Scaffold ( Scaffold (
topBar = { topBar = {
HomeTopBar( HomeTopBar(
@@ -85,20 +90,8 @@ fun HomeScreen(
onSettingsClick = onSettingsClick, onSettingsClick = onSettingsClick,
) )
} }
) { padding -> ) {
LaunchedEffect(tabIndex) { Column(modifier = Modifier.padding(it)) {
if (tabIndex in tabItems.indices) {
pagerState.animateScrollToPage(tabIndex)
}
}
LaunchedEffect(pagerState) {
snapshotFlow { pagerState.currentPage }.collect { page ->
if (page in tabItems.indices) {
tabIndex = page
}
}
}
Column(modifier = Modifier.padding(padding)) {
TabRow( TabRow(
selectedTabIndex = tabIndex, selectedTabIndex = tabIndex,
indicator = { tabPositions -> indicator = { tabPositions ->
@@ -124,10 +117,8 @@ fun HomeScreen(
icon = { icon = {
Icon( Icon(
imageVector = imageVector =
if (index == tabIndex) if (index == tabIndex) item.filledIcon
item.filledIcon else item.unfilledIcon,
else
item.unfilledIcon,
contentDescription = item.title contentDescription = item.title
) )
} }
@@ -136,8 +127,7 @@ fun HomeScreen(
} }
HorizontalPager( HorizontalPager(
state = pagerState, state = pagerState,
beyondViewportPageCount = 1, beyondViewportPageCount = 1
userScrollEnabled = true,
) { index -> ) { index ->
when(index) { when(index) {
0 -> WallpaperScreen( 0 -> WallpaperScreen(
@@ -155,23 +145,22 @@ fun HomeScreen(
onDarkenPercentage = onDarkenPercentage, onDarkenPercentage = onDarkenPercentage,
onHomeCheckedChange = onHomeCheckedChange, onHomeCheckedChange = onHomeCheckedChange,
onLockCheckedChange = onLockCheckedChange, onLockCheckedChange = onLockCheckedChange,
scheduleSeparately = scheduleSeparately,
onScheduleSeparatelyChange = onScheduleSeparatelyChange,
onScheduleWallpaperChanger1 = onScheduleWallpaperChanger1, onScheduleWallpaperChanger1 = onScheduleWallpaperChanger1,
onScheduleWallpaperChanger2 = onScheduleWallpaperChanger2, onScheduleWallpaperChanger2 = onScheduleWallpaperChanger2,
onScalingChange = onScalingChange, onScalingChange = onScalingChange,
onSelectAlbum = onSelectAlbum, onSelectAlbum = onSelectAlbum,
onTimeChange1 = onTimeChange1,
onTimeChange2 = onTimeChange2,
onStop = onStop, onStop = onStop,
onToggleChanger = onToggleChanger, onToggleChanger = onToggleChanger,
scaling = scaling, scaling = scaling,
selectedAlbum = selectedAlbum, selectedAlbum = selectedAlbum,
scheduleSeparately = scheduleSeparately,
onScheduleSeparatelyChange = onScheduleSeparatelyChange,
onTimeChange1 = onTimeChange1,
onTimeChange2 = onTimeChange2,
blur = blur, blur = blur,
onBlurPercentageChange = onBlurPercentageChange, onBlurPercentageChange = onBlurPercentageChange,
onBlurChange = onBlurChange, onBlurChange = onBlurChange,
blurPercentage = blurPercentage, blurPercentage = blurPercentage
firstSet = firstSet
) )
1 -> LibraryScreen( 1 -> LibraryScreen(
onAddNewAlbumClick = { addAlbumDialog = true }, onAddNewAlbumClick = { addAlbumDialog = true },
@@ -7,7 +7,6 @@ sealed class SettingsEvent {
data object Refresh: SettingsEvent() data object Refresh: SettingsEvent()
data object Reset: SettingsEvent() data object Reset: SettingsEvent()
data object SetFirstLaunch: SettingsEvent() data object SetFirstLaunch: SettingsEvent()
data object SetFirstSet: SettingsEvent()
data object RefreshNextSetTime: SettingsEvent() data object RefreshNextSetTime: SettingsEvent()
data class SetDarkMode(val darkMode: Boolean?): SettingsEvent() data class SetDarkMode(val darkMode: Boolean?): SettingsEvent()
data class SetDynamicTheming(val dynamicTheming: Boolean): SettingsEvent() data class SetDynamicTheming(val dynamicTheming: Boolean): SettingsEvent()
@@ -4,7 +4,6 @@ import com.anthonyla.paperize.core.SettingsConstants.WALLPAPER_CHANGE_INTERVAL_D
data class SettingsState( data class SettingsState(
val firstLaunch: Boolean = true, val firstLaunch: Boolean = true,
val firstSet: Boolean = true,
// App settings // App settings
val darkMode: Boolean? = null, val darkMode: Boolean? = null,
val dynamicTheming: Boolean = false, val dynamicTheming: Boolean = false,
@@ -35,7 +35,6 @@ class SettingsViewModel @Inject constructor (
init { init {
currentGetJob = viewModelScope.launch(Dispatchers.IO) { currentGetJob = viewModelScope.launch(Dispatchers.IO) {
val firstLaunch = async { settingsDataStoreImpl.getBoolean(SettingsConstants.FIRST_LAUNCH) ?: true } val firstLaunch = async { settingsDataStoreImpl.getBoolean(SettingsConstants.FIRST_LAUNCH) ?: true }
val firstSet = async { settingsDataStoreImpl.getBoolean(SettingsConstants.FIRST_SET) ?: false }
val darkMode = async { settingsDataStoreImpl.getBoolean(SettingsConstants.DARK_MODE_TYPE) } val darkMode = async { settingsDataStoreImpl.getBoolean(SettingsConstants.DARK_MODE_TYPE) }
val dynamicTheming = async { settingsDataStoreImpl.getBoolean(SettingsConstants.DYNAMIC_THEME_TYPE) ?: false } val dynamicTheming = async { settingsDataStoreImpl.getBoolean(SettingsConstants.DYNAMIC_THEME_TYPE) ?: false }
val enableChanger = async { settingsDataStoreImpl.getBoolean(SettingsConstants.ENABLE_CHANGER) ?: true } val enableChanger = async { settingsDataStoreImpl.getBoolean(SettingsConstants.ENABLE_CHANGER) ?: true }
@@ -60,7 +59,6 @@ class SettingsViewModel @Inject constructor (
homeInterval = homeWallpaperInterval.await(), homeInterval = homeWallpaperInterval.await(),
lockInterval = lockWallpaperInterval.await(), lockInterval = lockWallpaperInterval.await(),
firstLaunch = firstLaunch.await(), firstLaunch = firstLaunch.await(),
firstSet = firstSet.await(),
lastSetTime = lastSetTime.await(), lastSetTime = lastSetTime.await(),
nextSetTime = nextSetTime.await(), nextSetTime = nextSetTime.await(),
animate = animate.await(), animate = animate.await(),
@@ -121,7 +119,6 @@ class SettingsViewModel @Inject constructor (
val scheduleSeparately = async { settingsDataStoreImpl.getBoolean(SettingsConstants.SCHEDULE_SEPARATELY) ?: false } val scheduleSeparately = async { settingsDataStoreImpl.getBoolean(SettingsConstants.SCHEDULE_SEPARATELY) ?: false }
val blur = async { settingsDataStoreImpl.getBoolean(SettingsConstants.BLUR) ?: false } val blur = async { settingsDataStoreImpl.getBoolean(SettingsConstants.BLUR) ?: false }
val blurPercentage = async { settingsDataStoreImpl.getInt(SettingsConstants.BLUR_PERCENTAGE) ?: 0 } val blurPercentage = async { settingsDataStoreImpl.getInt(SettingsConstants.BLUR_PERCENTAGE) ?: 0 }
val firstSet = async { settingsDataStoreImpl.getBoolean(SettingsConstants.FIRST_SET) ?: true }
_state.update { _state.update {
it.copy( it.copy(
darkMode = darkMode.await(), darkMode = darkMode.await(),
@@ -140,7 +137,6 @@ class SettingsViewModel @Inject constructor (
scheduleSeparately = scheduleSeparately.await(), scheduleSeparately = scheduleSeparately.await(),
blur = blur.await(), blur = blur.await(),
blurPercentage = blurPercentage.await(), blurPercentage = blurPercentage.await(),
firstSet = firstSet.await()
) )
} }
} }
@@ -183,17 +179,6 @@ class SettingsViewModel @Inject constructor (
} }
} }
is SettingsEvent.SetFirstSet -> {
viewModelScope.launch(Dispatchers.IO) {
settingsDataStoreImpl.putBoolean(SettingsConstants.FIRST_SET, false)
_state.update {
it.copy(
firstSet = false
)
}
}
}
is SettingsEvent.SetHomeWallpaperInterval -> { is SettingsEvent.SetHomeWallpaperInterval -> {
viewModelScope.launch(Dispatchers.IO) { viewModelScope.launch(Dispatchers.IO) {
settingsDataStoreImpl.putInt(SettingsConstants.HOME_WALLPAPER_CHANGE_INTERVAL, event.interval) settingsDataStoreImpl.putInt(SettingsConstants.HOME_WALLPAPER_CHANGE_INTERVAL, event.interval)
@@ -407,8 +392,7 @@ class SettingsViewModel @Inject constructor (
homeInterval = SettingsConstants.WALLPAPER_CHANGE_INTERVAL_DEFAULT, homeInterval = SettingsConstants.WALLPAPER_CHANGE_INTERVAL_DEFAULT,
scheduleSeparately = false, scheduleSeparately = false,
blur = false, blur = false,
blurPercentage = 0, blurPercentage = 0
firstSet = true
) )
} }
} }
@@ -7,8 +7,10 @@ sealed class WallpaperEvent {
data class UpdateSelectedAlbum( data class UpdateSelectedAlbum(
val selectedAlbum: SelectedAlbum?, val selectedAlbum: SelectedAlbum?,
val album: AlbumWithWallpaperAndFolder?, val album: AlbumWithWallpaperAndFolder?,
val scheduleSeparately: Boolean = false val scheduleSeparately: Boolean = false,
val setHome: Boolean = false,
val setLock: Boolean = false
): WallpaperEvent() ): WallpaperEvent()
object Reset : WallpaperEvent() data object Reset : WallpaperEvent()
object Refresh : WallpaperEvent() data object Refresh : WallpaperEvent()
} }
@@ -46,7 +46,6 @@ import com.anthonyla.paperize.feature.wallpaper.presentation.wallpaper_screen.co
import com.anthonyla.paperize.feature.wallpaper.presentation.wallpaper_screen.components.CurrentAndNextChange import com.anthonyla.paperize.feature.wallpaper.presentation.wallpaper_screen.components.CurrentAndNextChange
import com.anthonyla.paperize.feature.wallpaper.presentation.wallpaper_screen.components.CurrentSelectedAlbum import com.anthonyla.paperize.feature.wallpaper.presentation.wallpaper_screen.components.CurrentSelectedAlbum
import com.anthonyla.paperize.feature.wallpaper.presentation.wallpaper_screen.components.DarkenSwitchAndSlider import com.anthonyla.paperize.feature.wallpaper.presentation.wallpaper_screen.components.DarkenSwitchAndSlider
import com.anthonyla.paperize.feature.wallpaper.presentation.wallpaper_screen.components.ShowDelayNoticeDialog
import com.anthonyla.paperize.feature.wallpaper.presentation.wallpaper_screen.components.ShowLiveWallpaperEnabledDialog import com.anthonyla.paperize.feature.wallpaper.presentation.wallpaper_screen.components.ShowLiveWallpaperEnabledDialog
import com.anthonyla.paperize.feature.wallpaper.presentation.wallpaper_screen.components.TimeSliders import com.anthonyla.paperize.feature.wallpaper.presentation.wallpaper_screen.components.TimeSliders
import com.anthonyla.paperize.feature.wallpaper.presentation.wallpaper_screen.components.WallpaperPreviewAndScale import com.anthonyla.paperize.feature.wallpaper.presentation.wallpaper_screen.components.WallpaperPreviewAndScale
@@ -84,8 +83,7 @@ fun WallpaperScreen(
blur: Boolean, blur: Boolean,
onBlurPercentageChange: (Int) -> Unit, onBlurPercentageChange: (Int) -> Unit,
onBlurChange: (Boolean) -> Unit, onBlurChange: (Boolean) -> Unit,
blurPercentage: Int, blurPercentage: Int
firstSet: Boolean
) { ) {
val context = LocalContext.current val context = LocalContext.current
val albumState = albumsViewModel.state.collectAsStateWithLifecycle() val albumState = albumsViewModel.state.collectAsStateWithLifecycle()
@@ -93,22 +91,14 @@ fun WallpaperScreen(
val scope = rememberCoroutineScope() val scope = rememberCoroutineScope()
val snackbarHostState = remember { SnackbarHostState() } val snackbarHostState = remember { SnackbarHostState() }
val openLiveDialog = rememberSaveable { mutableStateOf(false) } val openLiveDialog = rememberSaveable { mutableStateOf(false) }
val openNoticeDialog = rememberSaveable { mutableStateOf(false) }
val showInterval = rememberSaveable { mutableStateOf(false) } val showInterval = rememberSaveable { mutableStateOf(false) }
val scrollState = rememberScrollState()
if (openLiveDialog.value) { if (openLiveDialog.value) {
ShowLiveWallpaperEnabledDialog( ShowLiveWallpaperEnabledDialog(
onDismissRequest = { openLiveDialog.value = false } onDismissRequest = { openLiveDialog.value = false }
) )
} }
if (openNoticeDialog.value) {
ShowDelayNoticeDialog(
onDismissRequest = {
openNoticeDialog.value = false
openBottomSheet = true
}
)
}
val scrollState = rememberScrollState()
Scaffold( Scaffold(
snackbarHost = { snackbarHost = {
@@ -145,12 +135,7 @@ fun WallpaperScreen(
if (isLiveWallpaperSet(context)) { if (isLiveWallpaperSet(context)) {
openLiveDialog.value = true openLiveDialog.value = true
} else { } else {
if (firstSet) { openBottomSheet = true
openNoticeDialog.value = true
}
else {
openBottomSheet = true
}
} }
} else { } else {
scope.launch { scope.launch {
@@ -43,6 +43,7 @@ class WallpaperScreenViewModel @Inject constructor (
when (event) { when (event) {
is WallpaperEvent.UpdateSelectedAlbum -> { is WallpaperEvent.UpdateSelectedAlbum -> {
viewModelScope.launch(Dispatchers.IO) { viewModelScope.launch(Dispatchers.IO) {
if (!event.setHome && !event.setLock) return@launch
if (event.selectedAlbum != null) { if (event.selectedAlbum != null) {
_state.update { _state.update {
it.copy( it.copy(
@@ -67,8 +68,8 @@ class WallpaperScreenViewModel @Inject constructor (
album = event.album.album.copy( album = event.album.album.copy(
homeWallpapersInQueue = shuffledWallpapers1, homeWallpapersInQueue = shuffledWallpapers1,
lockWallpapersInQueue = shuffledWallpapers2, lockWallpapersInQueue = shuffledWallpapers2,
currentHomeWallpaper = shuffledWallpapers1.firstOrNull(), currentHomeWallpaper = if (event.setHome) shuffledWallpapers1.firstOrNull() else null,
currentLockWallpaper = if (event.scheduleSeparately) shuffledWallpapers2.firstOrNull() else shuffledWallpapers1.firstOrNull(), currentLockWallpaper = if (event.scheduleSeparately && event.setLock) shuffledWallpapers2.firstOrNull() else if (event.setLock) shuffledWallpapers1.firstOrNull() else null,
), ),
wallpapers = wallpapers wallpapers = wallpapers
) )
@@ -1,37 +0,0 @@
package com.anthonyla.paperize.feature.wallpaper.presentation.wallpaper_screen.components
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Notifications
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Button
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.res.stringResource
import com.anthonyla.paperize.R
/**
* Dialog to let the user know of the app's potential delays when it comes to scheduling wallpapers.
*/
@Composable
fun ShowDelayNoticeDialog(
onDismissRequest: () -> Unit
) {
AlertDialog(
onDismissRequest = { onDismissRequest() },
icon = { Icon(Icons.Filled.Notifications, stringResource(R.string.delay_notice)) },
title = {
Text(stringResource(R.string.delay_notice_dialog))
},
text = {
Text(stringResource(R.string.to_minimize_battery_usage_changing_wallpapers_may_have_some_delays_once_scheduled_when_the_device_is_asleep_the_wallpaper_may_take_longer_to_apply))
},
confirmButton = {
Button(
onClick = { onDismissRequest() }
) {
Text(stringResource(R.string.ok))
}
}
)
}
@@ -3,7 +3,6 @@ package com.anthonyla.paperize.feature.wallpaper.wallpaper_alarmmanager
import android.content.BroadcastReceiver import android.content.BroadcastReceiver
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.util.Log
import com.anthonyla.paperize.core.SettingsConstants.WALLPAPER_CHANGE_INTERVAL_DEFAULT import com.anthonyla.paperize.core.SettingsConstants.WALLPAPER_CHANGE_INTERVAL_DEFAULT
import com.anthonyla.paperize.core.Type import com.anthonyla.paperize.core.Type
import com.anthonyla.paperize.feature.wallpaper.wallpaper_service.WallpaperService1 import com.anthonyla.paperize.feature.wallpaper.wallpaper_service.WallpaperService1
@@ -17,37 +16,47 @@ import dagger.hilt.android.AndroidEntryPoint
class WallpaperReceiver: BroadcastReceiver() { class WallpaperReceiver: BroadcastReceiver() {
override fun onReceive(context: Context?, intent: Intent?) { override fun onReceive(context: Context?, intent: Intent?) {
if (context != null) { if (context != null) {
val timeInMinutes1 = intent?.getIntExtra("timeInMinutes1", WALLPAPER_CHANGE_INTERVAL_DEFAULT) ?: WALLPAPER_CHANGE_INTERVAL_DEFAULT val refresh = intent?.getBooleanExtra("refresh", false) ?: false
val timeInMinutes2 = intent?.getIntExtra("timeInMinutes2", WALLPAPER_CHANGE_INTERVAL_DEFAULT) ?: WALLPAPER_CHANGE_INTERVAL_DEFAULT if (refresh) {
val scheduleSeparately = intent?.getBooleanExtra("scheduleSeparately", false) ?: false val serviceIntent = Intent(context, WallpaperService1::class.java).apply {
val type = intent?.getIntExtra("type", Type.BOTH.ordinal) ?: Type.BOTH.ordinal action = WallpaperService1.Actions.REFRESH.toString()
val serviceIntent = Intent().apply {
putExtra("timeInMinutes1", timeInMinutes1)
putExtra("timeInMinutes2", timeInMinutes2)
putExtra("scheduleSeparately", scheduleSeparately)
putExtra("type", type)
}
if (type == Type.BOTH.ordinal || type == Type.HOME.ordinal) {
serviceIntent.setClass(context, WallpaperService1::class.java).apply {
action = WallpaperService1.Actions.START.toString()
}
} else {
serviceIntent.setClass(context, WallpaperService2::class.java).apply {
action = WallpaperService2.Actions.START.toString()
} }
context.startService(serviceIntent)
WallpaperScheduler(context).scheduleRefresh()
} }
context.startService(serviceIntent) else {
val timeInMinutes1 = intent?.getIntExtra("timeInMinutes1", WALLPAPER_CHANGE_INTERVAL_DEFAULT) ?: WALLPAPER_CHANGE_INTERVAL_DEFAULT
val timeInMinutes2 = intent?.getIntExtra("timeInMinutes2", WALLPAPER_CHANGE_INTERVAL_DEFAULT) ?: WALLPAPER_CHANGE_INTERVAL_DEFAULT
val scheduleSeparately = intent?.getBooleanExtra("scheduleSeparately", false) ?: false
val type = intent?.getIntExtra("type", Type.BOTH.ordinal) ?: Type.BOTH.ordinal
val serviceIntent = Intent().apply {
putExtra("timeInMinutes1", timeInMinutes1)
putExtra("timeInMinutes2", timeInMinutes2)
putExtra("scheduleSeparately", scheduleSeparately)
putExtra("type", type)
}
if (type == Type.BOTH.ordinal || type == Type.HOME.ordinal) {
serviceIntent.setClass(context, WallpaperService1::class.java).apply {
action = WallpaperService1.Actions.START.toString()
}
} else {
serviceIntent.setClass(context, WallpaperService2::class.java).apply {
action = WallpaperService2.Actions.START.toString()
}
}
context.startService(serviceIntent)
// Schedule next alarm for next wallpaper change // Schedule next alarm for next wallpaper change
val origin = intent?.getIntExtra("origin", -1)?.takeIf { it != -1 } val origin = intent?.getIntExtra("origin", -1)?.takeIf { it != -1 }
WallpaperScheduler(context).scheduleWallpaperAlarm( WallpaperScheduler(context).scheduleWallpaperAlarm(
WallpaperAlarmItem( WallpaperAlarmItem(
timeInMinutes1 = timeInMinutes1, timeInMinutes1 = timeInMinutes1,
timeInMinutes2 = timeInMinutes2, timeInMinutes2 = timeInMinutes2,
scheduleSeparately = scheduleSeparately scheduleSeparately = scheduleSeparately
), ),
origin origin
) )
}
} }
} }
} }
@@ -5,7 +5,6 @@ import android.app.PendingIntent
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.os.Build import android.os.Build
import android.provider.Settings
import com.anthonyla.paperize.core.Type import com.anthonyla.paperize.core.Type
import com.anthonyla.paperize.feature.wallpaper.wallpaper_service.WallpaperService1 import com.anthonyla.paperize.feature.wallpaper.wallpaper_service.WallpaperService1
import com.anthonyla.paperize.feature.wallpaper.wallpaper_service.WallpaperService2 import com.anthonyla.paperize.feature.wallpaper.wallpaper_service.WallpaperService2
@@ -22,6 +21,9 @@ class WallpaperScheduler (
): WallpaperAlarmScheduler { ): WallpaperAlarmScheduler {
private val alarmManager = context.getSystemService(Context.ALARM_SERVICE) as AlarmManager private val alarmManager = context.getSystemService(Context.ALARM_SERVICE) as AlarmManager
/**
* Schedules the wallpaper alarm based on the origin and changeImmediate
*/
override fun scheduleWallpaperAlarm(wallpaperAlarmItem: WallpaperAlarmItem, origin: Int?, changeImmediate: Boolean, cancelImmediate: Boolean) { override fun scheduleWallpaperAlarm(wallpaperAlarmItem: WallpaperAlarmItem, origin: Int?, changeImmediate: Boolean, cancelImmediate: Boolean) {
if (cancelImmediate) cancelWallpaperAlarm() if (cancelImmediate) cancelWallpaperAlarm()
else { else {
@@ -37,21 +39,21 @@ class WallpaperScheduler (
} }
if (wallpaperAlarmItem.scheduleSeparately) { if (wallpaperAlarmItem.scheduleSeparately) {
when (origin) { when (origin) {
Type.HOME.ordinal -> {
if (changeImmediate) changeWallpaperImmediate(wallpaperAlarmItem, Type.HOME)
scheduleWallpaper(wallpaperAlarmItem, Type.HOME, origin)
}
Type.LOCK.ordinal -> { Type.LOCK.ordinal -> {
if (changeImmediate) changeWallpaperImmediate(wallpaperAlarmItem, Type.LOCK) if (changeImmediate) changeWallpaperImmediate(wallpaperAlarmItem, Type.LOCK)
scheduleWallpaper(wallpaperAlarmItem, Type.LOCK, origin) scheduleWallpaper(wallpaperAlarmItem, Type.LOCK, origin)
} }
Type.HOME.ordinal -> {
if (changeImmediate) changeWallpaperImmediate(wallpaperAlarmItem, Type.HOME)
scheduleWallpaper(wallpaperAlarmItem, Type.HOME, origin)
}
null -> { null -> {
if (changeImmediate) { if (changeImmediate) {
changeWallpaperImmediate(wallpaperAlarmItem, Type.HOME)
changeWallpaperImmediate(wallpaperAlarmItem, Type.LOCK) changeWallpaperImmediate(wallpaperAlarmItem, Type.LOCK)
changeWallpaperImmediate(wallpaperAlarmItem, Type.HOME)
} }
scheduleWallpaper(wallpaperAlarmItem, Type.HOME, Type.HOME.ordinal)
scheduleWallpaper(wallpaperAlarmItem, Type.LOCK, Type.LOCK.ordinal) scheduleWallpaper(wallpaperAlarmItem, Type.LOCK, Type.LOCK.ordinal)
scheduleWallpaper(wallpaperAlarmItem, Type.HOME, Type.HOME.ordinal)
} }
} }
} }
@@ -61,31 +63,41 @@ class WallpaperScheduler (
} }
} }
/**
* Update the alarms
*/
override fun updateWallpaperAlarm(wallpaperAlarmItem: WallpaperAlarmItem) { override fun updateWallpaperAlarm(wallpaperAlarmItem: WallpaperAlarmItem) {
cancelWallpaperAlarm() cancelWallpaperAlarm()
if (wallpaperAlarmItem.scheduleSeparately) { if (wallpaperAlarmItem.scheduleSeparately) {
scheduleWallpaper(wallpaperAlarmItem, Type.HOME, null, true)
scheduleWallpaper(wallpaperAlarmItem, Type.LOCK, null, true) scheduleWallpaper(wallpaperAlarmItem, Type.LOCK, null, true)
scheduleWallpaper(wallpaperAlarmItem, Type.HOME, null, true)
} }
else { else {
scheduleWallpaper(wallpaperAlarmItem, Type.BOTH, null, true) scheduleWallpaper(wallpaperAlarmItem, Type.BOTH, null, true)
} }
} }
/**
* Update the wallpaper without scheduling alarms
*/
override fun updateWallpaper(scheduleSeparately: Boolean) { override fun updateWallpaper(scheduleSeparately: Boolean) {
if (scheduleSeparately) { if (scheduleSeparately) {
updateWallpaper(Type.HOME)
updateWallpaper(Type.LOCK) updateWallpaper(Type.LOCK)
updateWallpaper(Type.HOME)
} }
else { else {
updateWallpaper(Type.BOTH) updateWallpaper(Type.BOTH)
} }
} }
/**
* Cancels all active alarms
*/
override fun cancelWallpaperAlarm() { override fun cancelWallpaperAlarm() {
cancelAlarm(Type.HOME) cancelAlarm(Type.HOME)
cancelAlarm(Type.LOCK) cancelAlarm(Type.LOCK)
cancelAlarm(Type.BOTH) cancelAlarm(Type.BOTH)
cancelAlarm(Type.REFRESH)
} }
/** /**
@@ -95,6 +107,7 @@ class WallpaperScheduler (
val nextTime = when (type) { val nextTime = when (type) {
Type.HOME, Type.BOTH -> LocalDateTime.now().plusMinutes(wallpaperAlarmItem.timeInMinutes1.toLong()) Type.HOME, Type.BOTH -> LocalDateTime.now().plusMinutes(wallpaperAlarmItem.timeInMinutes1.toLong())
Type.LOCK -> LocalDateTime.now().plusMinutes(wallpaperAlarmItem.timeInMinutes2.toLong()) Type.LOCK -> LocalDateTime.now().plusMinutes(wallpaperAlarmItem.timeInMinutes2.toLong())
else -> LocalDateTime.now()
} }
val intent = Intent(context, WallpaperReceiver::class.java).apply { val intent = Intent(context, WallpaperReceiver::class.java).apply {
putExtra("timeInMinutes1", wallpaperAlarmItem.timeInMinutes1) putExtra("timeInMinutes1", wallpaperAlarmItem.timeInMinutes1)
@@ -106,10 +119,7 @@ class WallpaperScheduler (
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
if (!alarmManager.canScheduleExactAlarms()) { if (!alarmManager.canScheduleExactAlarms()) {
Intent().also { cancelWallpaperAlarm()
it.action = Settings.ACTION_REQUEST_SCHEDULE_EXACT_ALARM
context.startActivity(it)
}
} }
else { else {
alarmManager.setExactAndAllowWhileIdle( alarmManager.setExactAndAllowWhileIdle(
@@ -156,6 +166,46 @@ class WallpaperScheduler (
} }
} }
/**
* Schedules a refresh alarm every 24hrs
*/
fun scheduleRefresh() {
cancelAlarm(Type.REFRESH)
val intent = Intent(context, WallpaperReceiver::class.java).apply {
putExtra("refresh", true)
}
val nextMidnight = LocalDateTime.now().plusDays(1).withHour(0).withMinute(0).withSecond(0).withNano(0)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
if (!alarmManager.canScheduleExactAlarms()) {
cancelWallpaperAlarm()
}
else {
alarmManager.setExact(
AlarmManager.RTC_WAKEUP,
nextMidnight.atZone(ZoneId.systemDefault()).toEpochSecond() * 1000,
PendingIntent.getBroadcast(
context,
Type.REFRESH.ordinal,
intent,
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_MUTABLE
)
)
}
}
else {
alarmManager.setExact(
AlarmManager.RTC_WAKEUP,
nextMidnight.atZone(ZoneId.systemDefault()).toEpochSecond() * 1000,
PendingIntent.getBroadcast(
context,
Type.REFRESH.ordinal,
intent,
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_MUTABLE
)
)
}
}
/** /**
* Use the service to change the wallpaper * Use the service to change the wallpaper
*/ */
@@ -72,7 +72,8 @@ class WallpaperService1: Service() {
enum class Actions { enum class Actions {
START, START,
REQUEUE, REQUEUE,
UPDATE UPDATE,
REFRESH
} }
override fun onBind(p0: Intent?): IBinder? { override fun onBind(p0: Intent?): IBinder? {
@@ -110,6 +111,9 @@ class WallpaperService1: Service() {
Actions.UPDATE.toString() -> { Actions.UPDATE.toString() -> {
workerTaskUpdate() workerTaskUpdate()
} }
Actions.REFRESH.toString() -> {
workerTaskRefresh()
}
} }
} }
return START_NOT_STICKY return START_NOT_STICKY
@@ -124,8 +128,7 @@ class WallpaperService1: Service() {
private fun workerTaskStart(setHomeOrLock: Boolean? = null) { private fun workerTaskStart(setHomeOrLock: Boolean? = null) {
workerHandler.post { workerHandler.post {
CoroutineScope(Dispatchers.IO).launch { CoroutineScope(Dispatchers.IO).launch {
refreshAlbum(this@WallpaperService1) if (scheduleSeparately) delay(5000)
delay(2000)
changeWallpaper(this@WallpaperService1, setHomeOrLock) changeWallpaper(this@WallpaperService1, setHomeOrLock)
} }
stopSelf() stopSelf()
@@ -155,6 +158,15 @@ class WallpaperService1: Service() {
} }
} }
private fun workerTaskRefresh() {
workerHandler.post {
CoroutineScope(Dispatchers.IO).launch {
refreshAlbum(this@WallpaperService1)
}
stopSelf()
}
}
/** /**
* Creates a notification for the wallpaper service * Creates a notification for the wallpaper service
*/ */
@@ -252,9 +264,7 @@ class WallpaperService1: Service() {
it.copy( it.copy(
album = it.album.copy( album = it.album.copy(
homeWallpapersInQueue = if (setHomeOrLock) it.album.homeWallpapersInQueue.drop(1) else it.album.homeWallpapersInQueue, homeWallpapersInQueue = if (setHomeOrLock) it.album.homeWallpapersInQueue.drop(1) else it.album.homeWallpapersInQueue,
lockWallpapersInQueue = if (!setHomeOrLock) it.album.lockWallpapersInQueue.drop(1) else it.album.lockWallpapersInQueue, lockWallpapersInQueue = if (!setHomeOrLock) it.album.lockWallpapersInQueue.drop(1) else it.album.lockWallpapersInQueue
currentHomeWallpaper = if (setHomeOrLock) wallpaper else it.album.currentHomeWallpaper,
currentLockWallpaper = if (!setHomeOrLock) wallpaper else it.album.currentLockWallpaper
), ),
wallpapers = it.wallpapers.filter { it == it1 }, wallpapers = it.wallpapers.filter { it == it1 },
) )
@@ -299,9 +309,7 @@ class WallpaperService1: Service() {
it.copy( it.copy(
album = it.album.copy( album = it.album.copy(
homeWallpapersInQueue = if (setHomeOrLock) newWallpaperInQueue.drop(1) else it.album.homeWallpapersInQueue, homeWallpapersInQueue = if (setHomeOrLock) newWallpaperInQueue.drop(1) else it.album.homeWallpapersInQueue,
lockWallpapersInQueue = if (!setHomeOrLock) newWallpaperInQueue.drop(1) else it.album.lockWallpapersInQueue, lockWallpapersInQueue = if (!setHomeOrLock) newWallpaperInQueue.drop(1) else it.album.lockWallpapersInQueue
currentHomeWallpaper = if (setHomeOrLock) wallpaper else it.album.currentHomeWallpaper,
currentLockWallpaper = if (!setHomeOrLock) wallpaper else it.album.currentLockWallpaper
), ),
wallpapers = it.wallpapers.filter { it == it1 } wallpapers = it.wallpapers.filter { it == it1 }
) )
@@ -344,9 +352,7 @@ class WallpaperService1: Service() {
it.copy( it.copy(
album = it.album.copy( album = it.album.copy(
homeWallpapersInQueue = it.album.homeWallpapersInQueue.drop(1), homeWallpapersInQueue = it.album.homeWallpapersInQueue.drop(1),
lockWallpapersInQueue = it.album.lockWallpapersInQueue.filter { it != wallpaper }, lockWallpapersInQueue = it.album.lockWallpapersInQueue.filter { it != wallpaper }
currentHomeWallpaper = null,
currentLockWallpaper = null
), ),
wallpapers = it.wallpapers.filter { it == it1 }, wallpapers = it.wallpapers.filter { it == it1 },
) )
@@ -391,9 +397,7 @@ class WallpaperService1: Service() {
it.copy( it.copy(
album = it.album.copy( album = it.album.copy(
homeWallpapersInQueue = it.album.homeWallpapersInQueue.drop(1), homeWallpapersInQueue = it.album.homeWallpapersInQueue.drop(1),
lockWallpapersInQueue = it.album.lockWallpapersInQueue.filter { it != wallpaper }, lockWallpapersInQueue = it.album.lockWallpapersInQueue.filter { it != wallpaper }
currentHomeWallpaper = null,
currentLockWallpaper = null
), ),
wallpapers = it.wallpapers.filter { it == it1 } wallpapers = it.wallpapers.filter { it == it1 }
) )
@@ -468,8 +472,7 @@ class WallpaperService1: Service() {
it.copy( it.copy(
album = it.album.copy( album = it.album.copy(
homeWallpapersInQueue = it.album.homeWallpapersInQueue.filter { it != wallpaper1 }, homeWallpapersInQueue = it.album.homeWallpapersInQueue.filter { it != wallpaper1 },
lockWallpapersInQueue = it.album.lockWallpapersInQueue.filter { it != wallpaper1 }, lockWallpapersInQueue = it.album.lockWallpapersInQueue.filter { it != wallpaper1 }
currentHomeWallpaper = null
), ),
wallpapers = it.wallpapers.filter { it == it1 }, wallpapers = it.wallpapers.filter { it == it1 },
) )
@@ -498,8 +501,7 @@ class WallpaperService1: Service() {
it.copy( it.copy(
album = it.album.copy( album = it.album.copy(
homeWallpapersInQueue = it.album.homeWallpapersInQueue.filter { it != wallpaper1 }, homeWallpapersInQueue = it.album.homeWallpapersInQueue.filter { it != wallpaper1 },
lockWallpapersInQueue = it.album.lockWallpapersInQueue.filter { it != wallpaper1 }, lockWallpapersInQueue = it.album.lockWallpapersInQueue.filter { it != wallpaper1 }
currentLockWallpaper = null
), ),
wallpapers = it.wallpapers.filter { it == it1 }, wallpapers = it.wallpapers.filter { it == it1 },
) )
@@ -527,14 +529,14 @@ class WallpaperService1: Service() {
setHome: Boolean, setLock: Boolean, setHome: Boolean, setLock: Boolean,
setLockOrHome: Boolean? = null, setLockOrHome: Boolean? = null,
blur: Boolean = false, blur: Boolean = false,
blurPercent: Int blurPercent: Int,
): Boolean { ): Boolean {
val wallpaperManager = WallpaperManager.getInstance(context) val wallpaperManager = WallpaperManager.getInstance(context)
try { try {
val imageSize = wallpaper.getImageDimensions(context) ?: return false val imageSize = wallpaper.getImageDimensions(context) ?: return false
val aspectRatio = imageSize.height.toFloat() / imageSize.width.toFloat() val aspectRatio = imageSize.height.toFloat() / imageSize.width.toFloat()
val device = context.resources.displayMetrics val device = context.resources.displayMetrics
val targetWidth = min(4 * device.widthPixels, imageSize.width) val targetWidth = min(device.widthPixels, imageSize.width)
val targetHeight = (targetWidth * aspectRatio).toInt() val targetHeight = (targetWidth * aspectRatio).toInt()
val bitmap = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { val bitmap = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
@@ -631,7 +633,7 @@ class WallpaperService1: Service() {
albumWithWallpapers.forEach { albumWithWallpaper -> albumWithWallpapers.forEach { albumWithWallpaper ->
// Delete wallpaper if the URI is invalid // Delete wallpaper if the URI is invalid
val invalidWallpapers = albumWithWallpaper.wallpapers.filterNot { wallpaper -> val invalidWallpapers = albumWithWallpaper.wallpapers.filterNot { wallpaper ->
val file = DocumentFile.fromSingleUri(context, wallpaper.wallpaperUri.toUri()) val file = DocumentFileCompat.fromSingleUri(context, wallpaper.wallpaperUri.toUri())
file?.exists() == true file?.exists() == true
} }
if (invalidWallpapers.isNotEmpty()) { if (invalidWallpapers.isNotEmpty()) {
@@ -646,7 +648,7 @@ class WallpaperService1: Service() {
albumRepository.deleteFolder(folder) albumRepository.deleteFolder(folder)
} else { } else {
val wallpapers = getWallpaperFromFolder(folder.folderUri, context) val wallpapers = getWallpaperFromFolder(folder.folderUri, context)
val folderCoverFile = folder.coverUri?.let { DocumentFile.fromSingleUri(context, it.toUri()) } val folderCoverFile = folder.coverUri?.let { DocumentFileCompat.fromSingleUri(context, it.toUri()) }
val folderCover = folderCoverFile?.takeIf { it.exists() }?.uri?.toString() ?: wallpapers.randomOrNull() val folderCover = folderCoverFile?.takeIf { it.exists() }?.uri?.toString() ?: wallpapers.randomOrNull()
albumRepository.updateFolder(folder.copy(coverUri = folderCover, wallpapers = wallpapers)) albumRepository.updateFolder(folder.copy(coverUri = folderCover, wallpapers = wallpapers))
} }
@@ -657,7 +659,7 @@ class WallpaperService1: Service() {
albumRepository.deleteFolder(folder) albumRepository.deleteFolder(folder)
} else { } else {
val wallpapers = getWallpaperFromFolder(folder.folderUri, context) val wallpapers = getWallpaperFromFolder(folder.folderUri, context)
val folderCoverFile = folder.coverUri?.let { DocumentFile.fromSingleUri(context, it.toUri()) } val folderCoverFile = folder.coverUri?.let { DocumentFileCompat.fromSingleUri(context, it.toUri()) }
val folderCover = folderCoverFile?.takeIf { it.exists() }?.uri?.toString() ?: wallpapers.randomOrNull() val folderCover = folderCoverFile?.takeIf { it.exists() }?.uri?.toString() ?: wallpapers.randomOrNull()
albumRepository.updateFolder(folder.copy(coverUri = folderCover, wallpapers = wallpapers)) albumRepository.updateFolder(folder.copy(coverUri = folderCover, wallpapers = wallpapers))
} }
@@ -19,7 +19,6 @@ import android.util.DisplayMetrics
import android.util.Log import android.util.Log
import androidx.core.app.NotificationCompat import androidx.core.app.NotificationCompat
import androidx.core.net.toUri import androidx.core.net.toUri
import androidx.documentfile.provider.DocumentFile
import com.anthonyla.paperize.R import com.anthonyla.paperize.R
import com.anthonyla.paperize.core.ScalingConstants import com.anthonyla.paperize.core.ScalingConstants
import com.anthonyla.paperize.core.SettingsConstants import com.anthonyla.paperize.core.SettingsConstants
@@ -30,19 +29,14 @@ import com.anthonyla.paperize.core.darkenBitmap
import com.anthonyla.paperize.core.fillBitmap import com.anthonyla.paperize.core.fillBitmap
import com.anthonyla.paperize.core.fitBitmap import com.anthonyla.paperize.core.fitBitmap
import com.anthonyla.paperize.core.getImageDimensions import com.anthonyla.paperize.core.getImageDimensions
import com.anthonyla.paperize.core.getWallpaperFromFolder
import com.anthonyla.paperize.core.stretchBitmap import com.anthonyla.paperize.core.stretchBitmap
import com.anthonyla.paperize.data.settings.SettingsDataStore import com.anthonyla.paperize.data.settings.SettingsDataStore
import com.anthonyla.paperize.feature.wallpaper.domain.model.SelectedAlbum
import com.anthonyla.paperize.feature.wallpaper.domain.model.Wallpaper
import com.anthonyla.paperize.feature.wallpaper.domain.repository.AlbumRepository import com.anthonyla.paperize.feature.wallpaper.domain.repository.AlbumRepository
import com.anthonyla.paperize.feature.wallpaper.domain.repository.SelectedAlbumRepository import com.anthonyla.paperize.feature.wallpaper.domain.repository.SelectedAlbumRepository
import com.anthonyla.paperize.feature.wallpaper.presentation.MainActivity import com.anthonyla.paperize.feature.wallpaper.presentation.MainActivity
import com.lazygeniouz.dfc.file.DocumentFileCompat
import dagger.hilt.android.AndroidEntryPoint import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.first import kotlinx.coroutines.flow.first
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import java.io.IOException import java.io.IOException
@@ -124,9 +118,6 @@ class WallpaperService2: Service() {
private fun workerTaskStart(setHomeOrLock: Boolean? = null) { private fun workerTaskStart(setHomeOrLock: Boolean? = null) {
workerHandler.post { workerHandler.post {
CoroutineScope(Dispatchers.IO).launch { CoroutineScope(Dispatchers.IO).launch {
delay(3000)
refreshAlbum(this@WallpaperService2)
delay(2000)
changeWallpaper(this@WallpaperService2, setHomeOrLock) changeWallpaper(this@WallpaperService2, setHomeOrLock)
} }
stopSelf() stopSelf()
@@ -247,7 +238,7 @@ class WallpaperService2: Service() {
setLock = setLock, setLock = setLock,
setLockOrHome = setHomeOrLock, setLockOrHome = setHomeOrLock,
blur = blur, blur = blur,
blurPercent = blurPercentage blurPercent = blurPercentage,
)) { )) {
selectedAlbum.wallpapers.firstOrNull { it.wallpaperUri == wallpaper } selectedAlbum.wallpapers.firstOrNull { it.wallpaperUri == wallpaper }
?.let { it1 -> ?.let { it1 ->
@@ -257,8 +248,6 @@ class WallpaperService2: Service() {
album = it.album.copy( album = it.album.copy(
homeWallpapersInQueue = if (setHomeOrLock) it.album.homeWallpapersInQueue.drop(1) else it.album.homeWallpapersInQueue, homeWallpapersInQueue = if (setHomeOrLock) it.album.homeWallpapersInQueue.drop(1) else it.album.homeWallpapersInQueue,
lockWallpapersInQueue = if (!setHomeOrLock) it.album.lockWallpapersInQueue.drop(1) else it.album.lockWallpapersInQueue, lockWallpapersInQueue = if (!setHomeOrLock) it.album.lockWallpapersInQueue.drop(1) else it.album.lockWallpapersInQueue,
currentHomeWallpaper = if (setHomeOrLock) wallpaper else it.album.currentHomeWallpaper,
currentLockWallpaper = if (!setHomeOrLock) wallpaper else it.album.currentLockWallpaper
), ),
wallpapers = it.wallpapers.filter { it == it1 }, wallpapers = it.wallpapers.filter { it == it1 },
) )
@@ -303,9 +292,7 @@ class WallpaperService2: Service() {
it.copy( it.copy(
album = it.album.copy( album = it.album.copy(
homeWallpapersInQueue = if (setHomeOrLock) newWallpaperInQueue.drop(1) else it.album.homeWallpapersInQueue, homeWallpapersInQueue = if (setHomeOrLock) newWallpaperInQueue.drop(1) else it.album.homeWallpapersInQueue,
lockWallpapersInQueue = if (!setHomeOrLock) newWallpaperInQueue.drop(1) else it.album.lockWallpapersInQueue, lockWallpapersInQueue = if (!setHomeOrLock) newWallpaperInQueue.drop(1) else it.album.lockWallpapersInQueue
currentHomeWallpaper = if (setHomeOrLock) wallpaper else it.album.currentHomeWallpaper,
currentLockWallpaper = if (!setHomeOrLock) wallpaper else it.album.currentLockWallpaper
), ),
wallpapers = it.wallpapers.filter { it == it1 } wallpapers = it.wallpapers.filter { it == it1 }
) )
@@ -339,7 +326,7 @@ class WallpaperService2: Service() {
setHome = setHome, setHome = setHome,
setLock = setLock, setLock = setLock,
blur = blur, blur = blur,
blurPercent = blurPercentage blurPercent = blurPercentage,
)) { )) {
selectedAlbum.wallpapers.firstOrNull { it.wallpaperUri == wallpaper } selectedAlbum.wallpapers.firstOrNull { it.wallpaperUri == wallpaper }
?.let { it1 -> ?.let { it1 ->
@@ -348,9 +335,7 @@ class WallpaperService2: Service() {
it.copy( it.copy(
album = it.album.copy( album = it.album.copy(
homeWallpapersInQueue = it.album.homeWallpapersInQueue.drop(1), homeWallpapersInQueue = it.album.homeWallpapersInQueue.drop(1),
lockWallpapersInQueue = it.album.lockWallpapersInQueue.filter { it != wallpaper }, lockWallpapersInQueue = it.album.lockWallpapersInQueue.filter { it != wallpaper }
currentHomeWallpaper = null,
currentLockWallpaper = null
), ),
wallpapers = it.wallpapers.filter { it == it1 }, wallpapers = it.wallpapers.filter { it == it1 },
) )
@@ -364,7 +349,7 @@ class WallpaperService2: Service() {
homeWallpapersInQueue = it.album.homeWallpapersInQueue.drop(1), homeWallpapersInQueue = it.album.homeWallpapersInQueue.drop(1),
lockWallpapersInQueue = it.album.lockWallpapersInQueue.filter { it != wallpaper }, lockWallpapersInQueue = it.album.lockWallpapersInQueue.filter { it != wallpaper },
currentHomeWallpaper = wallpaper, currentHomeWallpaper = wallpaper,
currentLockWallpaper = wallpaper currentLockWallpaper = wallpaper,
) )
) )
) )
@@ -385,7 +370,7 @@ class WallpaperService2: Service() {
setLock = setLock, setLock = setLock,
setLockOrHome = setHomeOrLock, setLockOrHome = setHomeOrLock,
blur = blur, blur = blur,
blurPercent = blurPercentage blurPercent = blurPercentage,
) )
) { ) {
selectedAlbum.wallpapers.firstOrNull { it.wallpaperUri == wallpaper } selectedAlbum.wallpapers.firstOrNull { it.wallpaperUri == wallpaper }
@@ -395,9 +380,7 @@ class WallpaperService2: Service() {
it.copy( it.copy(
album = it.album.copy( album = it.album.copy(
homeWallpapersInQueue = it.album.homeWallpapersInQueue.drop(1), homeWallpapersInQueue = it.album.homeWallpapersInQueue.drop(1),
lockWallpapersInQueue = it.album.lockWallpapersInQueue.filter { it != wallpaper }, lockWallpapersInQueue = it.album.lockWallpapersInQueue.filter { it != wallpaper }
currentHomeWallpaper = null,
currentLockWallpaper = null
), ),
wallpapers = it.wallpapers.filter { it == it1 } wallpapers = it.wallpapers.filter { it == it1 }
) )
@@ -472,8 +455,7 @@ class WallpaperService2: Service() {
it.copy( it.copy(
album = it.album.copy( album = it.album.copy(
homeWallpapersInQueue = it.album.homeWallpapersInQueue.filter { it != wallpaper1 }, homeWallpapersInQueue = it.album.homeWallpapersInQueue.filter { it != wallpaper1 },
lockWallpapersInQueue = it.album.lockWallpapersInQueue.filter { it != wallpaper1 }, lockWallpapersInQueue = it.album.lockWallpapersInQueue.filter { it != wallpaper1 }
currentHomeWallpaper = null
), ),
wallpapers = it.wallpapers.filter { it == it1 }, wallpapers = it.wallpapers.filter { it == it1 },
) )
@@ -502,8 +484,7 @@ class WallpaperService2: Service() {
it.copy( it.copy(
album = it.album.copy( album = it.album.copy(
homeWallpapersInQueue = it.album.homeWallpapersInQueue.filter { it != wallpaper1 }, homeWallpapersInQueue = it.album.homeWallpapersInQueue.filter { it != wallpaper1 },
lockWallpapersInQueue = it.album.lockWallpapersInQueue.filter { it != wallpaper1 }, lockWallpapersInQueue = it.album.lockWallpapersInQueue.filter { it != wallpaper1 }
currentLockWallpaper = null
), ),
wallpapers = it.wallpapers.filter { it == it1 }, wallpapers = it.wallpapers.filter { it == it1 },
) )
@@ -531,14 +512,15 @@ class WallpaperService2: Service() {
setHome: Boolean, setLock: Boolean, setHome: Boolean, setLock: Boolean,
setLockOrHome: Boolean? = null, setLockOrHome: Boolean? = null,
blur: Boolean = false, blur: Boolean = false,
blurPercent: Int blurPercent: Int,
lastHomeWallpaper: Uri? = null,
): Boolean { ): Boolean {
val wallpaperManager = WallpaperManager.getInstance(context) val wallpaperManager = WallpaperManager.getInstance(context)
try { try {
val imageSize = wallpaper.getImageDimensions(context) ?: return false val imageSize = wallpaper.getImageDimensions(context) ?: return false
val aspectRatio = imageSize.height.toFloat() / imageSize.width.toFloat() val aspectRatio = imageSize.height.toFloat() / imageSize.width.toFloat()
val device = context.resources.displayMetrics val device = context.resources.displayMetrics
val targetWidth = min(4 * device.widthPixels, imageSize.width) val targetWidth = min(device.widthPixels, imageSize.width)
val targetHeight = (targetWidth * aspectRatio).toInt() val targetHeight = (targetWidth * aspectRatio).toInt()
val bitmap = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { val bitmap = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
@@ -627,101 +609,4 @@ class WallpaperService2: Service() {
return null return null
} }
} }
private fun refreshAlbum(context: Context) {
CoroutineScope(Dispatchers.IO).launch {
try {
var albumWithWallpapers = albumRepository.getAlbumsWithWallpaperAndFolder().first()
albumWithWallpapers.forEach { albumWithWallpaper ->
// Delete wallpaper if the URI is invalid
val invalidWallpapers = albumWithWallpaper.wallpapers.filterNot { wallpaper ->
val file = DocumentFile.fromSingleUri(context, wallpaper.wallpaperUri.toUri())
file?.exists() == true
}
if (invalidWallpapers.isNotEmpty()) {
albumRepository.deleteWallpaperList(invalidWallpapers)
}
// Update folder cover uri and wallpapers uri
albumWithWallpaper.folders.forEach { folder ->
try {
DocumentFileCompat.fromTreeUri(context, folder.folderUri.toUri())?.let { folderDirectory ->
if (!folderDirectory.isDirectory()) {
albumRepository.deleteFolder(folder)
} else {
val wallpapers = getWallpaperFromFolder(folder.folderUri, context)
val folderCoverFile = folder.coverUri?.let { DocumentFile.fromSingleUri(context, it.toUri()) }
val folderCover = folderCoverFile?.takeIf { it.exists() }?.uri?.toString() ?: wallpapers.randomOrNull()
albumRepository.updateFolder(folder.copy(coverUri = folderCover, wallpapers = wallpapers))
}
}
} catch (e: Exception) {
DocumentFile.fromTreeUri(context, folder.folderUri.toUri())?.let { folderDirectory ->
if (!folderDirectory.isDirectory) {
albumRepository.deleteFolder(folder)
} else {
val wallpapers = getWallpaperFromFolder(folder.folderUri, context)
val folderCoverFile = folder.coverUri?.let { DocumentFile.fromSingleUri(context, it.toUri()) }
val folderCover = folderCoverFile?.takeIf { it.exists() }?.uri?.toString() ?: wallpapers.randomOrNull()
albumRepository.updateFolder(folder.copy(coverUri = folderCover, wallpapers = wallpapers))
}
}
}
}
// Delete empty albums
if (albumWithWallpaper.wallpapers.isEmpty() && albumWithWallpaper.folders.all { it.wallpapers.isEmpty() }) {
albumRepository.deleteAlbum(albumWithWallpaper.album)
}
}
// Update selected album
albumWithWallpapers = albumRepository.getAlbumsWithWallpaperAndFolder().first()
val selectedAlbum = selectedRepository.getSelectedAlbum().first().firstOrNull()
if (selectedAlbum != null) {
albumWithWallpapers.find { it.album.initialAlbumName == selectedAlbum.album.initialAlbumName }
?.let { foundAlbum ->
val albumNameHashCode = foundAlbum.album.initialAlbumName.hashCode()
val wallpapers: List<Wallpaper> =
foundAlbum.wallpapers + foundAlbum.folders.flatMap { folder ->
folder.wallpapers.map { wallpaper ->
Wallpaper(
initialAlbumName = foundAlbum.album.initialAlbumName,
wallpaperUri = wallpaper,
key = wallpaper.hashCode() + albumNameHashCode,
)
}
}
val wallpapersUri = wallpapers.map { it.wallpaperUri }.toSet()
if (wallpapersUri.isEmpty()) {
selectedRepository.deleteAll()
onDestroy()
}
else {
val newSelectedAlbum = SelectedAlbum(
album = foundAlbum.album.copy(
homeWallpapersInQueue = if (selectedAlbum.album.homeWallpapersInQueue.firstOrNull() in wallpapersUri) {
val firstElement = selectedAlbum.album.homeWallpapersInQueue.first()
val modifiedWallpapersUri = wallpapersUri.filter { it != firstElement }
listOf(firstElement) + modifiedWallpapersUri.shuffled()
} else { wallpapersUri.shuffled() },
lockWallpapersInQueue = if (selectedAlbum.album.lockWallpapersInQueue.firstOrNull() in wallpapersUri) {
val firstElement = selectedAlbum.album.lockWallpapersInQueue.first()
val modifiedWallpapersUri = wallpapersUri.filter { it != firstElement }
listOf(firstElement) + modifiedWallpapersUri.shuffled()
} else { wallpapersUri.shuffled() },
currentHomeWallpaper = if (selectedAlbum.album.currentHomeWallpaper in wallpapersUri) selectedAlbum.album.currentHomeWallpaper else selectedAlbum.album.homeWallpapersInQueue.firstOrNull { it in wallpapersUri },
currentLockWallpaper = if (selectedAlbum.album.currentLockWallpaper in wallpapersUri) selectedAlbum.album.currentLockWallpaper else selectedAlbum.album.lockWallpapersInQueue.firstOrNull { it in wallpapersUri }
),
wallpapers = wallpapers
)
selectedRepository.upsertSelectedAlbum(newSelectedAlbum)
}
} ?: run { onDestroy() }
}
} catch (e: Exception) {
Log.e("PaperizeWallpaperChanger", "Error refreshing album", e)
}
}
}
} }
+172
View File
@@ -0,0 +1,172 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Paperize</string>
<string name="SettingsIcon">اختيارات</string>
<string name="dropdownmenu_settings">الإعدادات</string>
<string name="home_screen">الرئيسية</string>
<string name="wallpaper_screen">الخلفية</string>
<string name="library_screen">المكتبة</string>
<string name="settings_screen">الإعدادات</string>
<string name="settings_back">ارجع</string>
<string name="LibraryFloatingButton">ضيف للمكتبة</string>
<string name="set_wallpaper_description">شغٌَل الخلفية المتحركة</string>
<string name="add_wallpaper">حط خلفية</string>
<string name="add_images">حط صور</string>
<string name="add_folder">حط مجلد</string>
<string name="contact_button">اتصل</string>
<string name="image_is_selected">اختارت الصورة</string>
<string name="image_is_not_selected">ما اختارتش الصورة</string>
<string name="select_all_images_for_deletion">عَلٌِم على كل الصور للمسح</string>
<string name="delete_confirmation">متأكد عايز تمسح</string>
<string name="all_images_selected_for_deletion">كل الصور متعلِّم عليهم للمسح</string>
<string name="add_album">حط ألبوم</string>
<string name="add_wallpaper_screen">حط شاشة للخلفية</string>
<string name="enter_the_name_of_the_album">دخَّل اسم الألبوم</string>
<string name="album_name">اسم الألبوم</string>
<string name="cancel">الغى</string>
<string name="save">احفظ</string>
<string name="delete_album">امسح</string>
<string name="change_name">عَدِّل الاسم</string>
<string name="click_to_select_a_different_album">اضغط عشان تختار ألبوم تانى</string>
<string name="no_icon">مافيش أيقونة</string>
<string name="no_album_selected">مافيش ألبوم مُختَار</string>
<string name="currently_selected_album">الألبوم المخُتَار</string>
<string name="stop_the_album">وَقَّف الألبوم</string>
<string name="more_options">اختيارات أكتر</string>
<string name="startup">ابدأ</string>
<string name="agree">موافق</string>
<string name="welcome">أهلاً</string>
<string name="notifications">الإشعارات</string>
<string name="continue_button">ياللا بينا</string>
<string name="notification_permission_is_required_for_this_app_to_work_properly">لازم إذن الإشعارات عشان يشتغل البرنامج كويس</string>
<string name="allow">اسمح</string>
<string name="notification_info_message">ممكن تِشَغَّل الإشعارات عشان تعرف لما البرنامج يبقى شغًَال فى الخلفية.</string>
<string name="set_as_lock_screen">ثبت لشاشة القفل</string>
<string name="lock_screen">شاشة القفل</string>
<string name="home">الشاشة الرئيسية</string>
<string name="last_change">آخر تغيير</string>
<string name="next_change">التغيير الجاى</string>
<string name="privacy_policy">سياسة الخصوصية</string>
<string name="privacy_screen">شاشة الخصوصية</string>
<string name="licenses">التراخيص</string>
<string name="licenses_screen">شاشة التراخيص</string>
<string name="contact">اتصل</string>
<string name="contact_the_author_by_email">ابعت لصاحب البرنامج على البريد الالكترونى</string>
<string name="reset_to_default">ارجع للوضع الافتراضى</string>
<string name="reset_all_data">عيد ظبط كل البيانات</string>
<string name="are_you_sure_you_want_to_reset_all_settings_and_data_to_default">متأكد إنك عايز تعيد ظبط كل الإعدادات و البيانات للوضع الافتراضى؟</string>
<string name="confirm">أيوة</string>
<string name="spotlight_animation">تحريك بقعة الضوء</string>
<string name="circle_2_animation">تحريك الدايرة ٢</string>
<string name="circle_1_animation">تحريك الدايرة ١</string>
<string name="circle_3_animation">تحريك الدايرة ٣</string>
<string name="wallpaper_changer_has_been_enabled">مُغَيِّر الخلفية شغَّال.</string>
<string name="wallpaper_changer_has_been_disabled">مُغَيِّر الخلفية مَطفى.</string>
<string name="dismiss">الغى</string>
<string name="has_been_unselected">%1$s مش متعَلِّم عليه.</string>
<string name="interval_home">الشاشة الرئيسية | %1$s</string>
<string name="interval_lock">شاشة القفل | %1$s</string>
<string name="interval">الفترة | %1$s</string>
<plurals name="minutes">
<item quantity="zero">ولا دقيقة (%d)</item>
<item quantity="one">دقيقة واحدة (%d)</item>
<item quantity="two">دقيقتين (%d)</item>
<item quantity="few">%d دقايق</item>
<item quantity="many">%d دقايق</item>
<item quantity="other">%d دقيقة</item>
</plurals>
<plurals name="hours">
<item quantity="zero">ولا ساعة (%d)</item>
<item quantity="one">ساعة واحدة (%d)</item>
<item quantity="two">ساعتين (%d)</item>
<item quantity="few">%d ساعات</item>
<item quantity="many">%d ساعات</item>
<item quantity="other">%d ساعة</item>
</plurals>
<plurals name="days">
<item quantity="zero">ولا يوم (%d)</item>
<item quantity="one">يوم واحد (%d)</item>
<item quantity="two">يومين (%d)</item>
<item quantity="few">%d أيام</item>
<item quantity="many">%d أيام</item>
<item quantity="other">%d يوم</item>
</plurals>
<string name="selected_count">%1$s متعَلِّم عليه</string>
<string name="please_read_and_agree_to_the_following_privacy_notice_to_use_the_app">لو سمحت اقرا و وافق على إشعار الخصوصية الجاى عشان تستخدم البرنامج.</string>
<string name="privacy_notice">إشعار الخصوصية</string>
<string name="please_read_and_agree_to_the_privacy_notice">لو سمحت اقرا و وافق على إشعار الخصوصية.</string>
<string name="view">ورينى</string>
<string name="welcome_animation">حركة الترحيب</string>
<string name="notification_bell_animation">تحريك جرز الإشعارات</string>
<string name="delete_these">امسح دول؟</string>
<string name="are_you_sure_you_want_to_delete_these_wallpapers">انت متأكد إنك عايز تمسح الخلفيات دى؟</string>
<string name="are_you_sure_you_want_to_delete_this">انت متأكد إنك عايز تمسح ده؟</string>
<string name="delete_album_question">امسح الألبوم؟</string>
<string name="animation">التحريك</string>
<string name="increase_visual_appeal">زيادة الجاذبية البصرية</string>
<string name="dark_mode">الوضع الغامق</string>
<string name="automatic_device_mode">وضع الجهاز التلقائى</string>
<string name="light_mode">الوضع الفاتح</string>
<string name="easier_on_the_eyes">أسهل على العيون</string>
<string name="dynamic_theme">السيم الديناميكى</string>
<string name="material_you">ألوان متماشية مع النظام</string>
<string name="dynamic_theming">التسييم الديناميكى</string>
<string name="click_here_to_view_the_licenses">اضغط هنا عشان تشوف التراخيص</string>
<string name="click_here_to_view_our_privacy_policy">اضغط عشان تشوف سياسة الخصوصية بتاعتنا</string>
<string name="add_images_btn">حط صورة</string>
<string name="add_folder_btn">حط مجلد</string>
<string name="version">الإصدار %1$s</string>
<string name="appearance">المظهر</string>
<string name="about">عَنَّا</string>
<string name="coming_soon">قريباً</string>
<string name="new_album">ألبوم جديد</string>
<string name="wallpapers">الخلفيات</string>
<string name="translation">الترجمة</string>
<string name="help_translate_the_app_on_crowdin">ساعد على ترجمة البرنامج على Crowdin!</string>
<plurals name="wallpaper_count">
<item quantity="zero">ولا خلفية (%d)</item>
<item quantity="one">خلفية واحدة (%d)</item>
<item quantity="two">خلفيتين (%d)</item>
<item quantity="few">%d خلفيات</item>
<item quantity="many">%d خلفيات</item>
<item quantity="other">%d خلفية</item>
</plurals>
<string name="privacy_intro_title">المقدمة</string>
<string name="privacy_intro_content">أهلاً بيك فى %1$s! إشعار الخصوصية ده بيوضح ازاى إحنا بنجَمَّع، و نستخدم، و نحمى معلوماتك الشخصية لما تستخدم برنامج التيليفون بتاعنا. باستخدامك لـ %1$s، بتوافق على الشروط اللى متوضَّحَة فى الإشعار ده.</string>
<string name="privacy_data_collection_title">جمع البيانات</string>
<string name="privacy_data_collection_content">استخدام الإشعارات: %1$s عايز يستخدم الإشعارات عشان يبعت لك توصيات خلفية مُخَصَّصَة بناءً على إشعاراتك. إحنا مش بنخَزِّن أي محتوى إشعارات أو معلومات تعريف شخصية (م ت ش) برى جهازك.\n\nالملفات المحلية: %1$s بيستخدم الملفات المِتخَزِّنَة على جهازك عشان تحطها كخلفيات. إحنا مش بنحَمِّل أو ننقل الملفات دى لأي خوادم خارجية.</string>
<string name="privacy_information_usage_title">استخدام المعلومات</string>
<string name="privacy_information_usage_content">البيانات الشخصية: احنا مش بنجَمَّع أو نخزن أي بيانات شخصية زى الأسماء أو عناوين البريد الإلكترونى أو أرقام التليفونات.\n\nتحليلات الاستخدام: %1$s مش بيتَّبع سلوك الاستخدام بتاعك أو يجَمَّع بيانات التحليلات.</string>
<string name="privacy_data_security_title">أمن البيانات</string>
<string name="privacy_data_security_content">التخزين على الجهاز: كل البيانات التي بيستخدمها %1$s بتفضل على جهازك. احنا مش بننقل أو نخَزِّن أي بيانات برى.</string>
<string name="privacy_third_party_services_title">خدمات من جهات تانية</string>
<string name="privacy_third_party_services_content">الإعلانات: %1$s مش بيعرض إعلانات من جهات تانية.\n\nالروابط الخارجية: برنامجنا ممكن يكون فيه روابط لمواقع خارجية. خلى بالك احنا مش مسؤولين عن ممارسات الخصوصية للمواقع دى.</string>
<string name="privacy_children_privacy_title">خصوصية الأطفال</string>
<string name="privacy_children_privacy_content">%1$s مش مُخَصَّص للأطفال تحت ١٣ سنة. احنا مش بنجَمَّع أى معلومات من الأطفال عن قصد.</string>
<string name="privacy_changes_notice_title">اللى اتغير فى الإشعار ده</string>
<string name="privacy_changes_notice_content">احنا ممكن نحدِّث إشعار الخصوصية ده من وقت للتانى. أى تغييرات هتبان فى الرنامج وعلى موقعنا.</string>
<string name="privacy_contact_us_title">اتصل بينا</string>
<string name="privacy_contact_us_content">لو عندك أى أسئلة أو استفسارات بشأن إشعار الخصوصية ده، اتصل بيا على %1$s.</string>
<string name="no_albums_found">مافيش ألبومات موجودة</string>
<string name="disable_live_wallpaper">وَقَّف الخلفية المتحركة</string>
<string name="live_wallpaper_detected">دى خلفية متحركة</string>
<string name="please_disable_your_live_wallpaper_to_use_the_wallpaper_changer">لو سمحت وَقَّ خلفية الشاشة المتحركة عشان تستخدم مُغَيِّر الخلفية.</string>
<string name="ok">ماشى، تمام</string>
<string name="percentage">%1$s٪</string>
<string name="fill">املى</string>
<string name="fit">قَيِّفها</string>
<string name="stretch">مِدَّها</string>
<string name="wallpaper_scaling">حجم الخلفية</string>
<string name="change_brightness">غَيَّر السطوع</string>
<string name="home_screen_btn">الشاشة الرئيسية</string>
<string name="lock_screen_btn">شاشة القفل</string>
<string name="individual_scheduling">جدولة فردية</string>
<string name="show_interval_sliders">بَيِّن شريط الفترات</string>
<string name="interval_text">فترة زمنية</string>
<string name="change_blur">غَيَّر التغييم</string>
<string name="paperize_is_running">توريق شغال</string>
<string name="next_wallpaper_change">تغيير الخلفية الجاى: %1$s</string>
<string name="delay_notice">إشعار التأخير</string>
<string name="delay_notice_dialog">إشعار التأخير</string>
<string name="to_minimize_battery_usage_changing_wallpapers_may_have_some_delays_once_scheduled_when_the_device_is_asleep_the_wallpaper_may_take_longer_to_apply">عشان نقلل استخدام البطارية، ممكن يحصل شوية تأخير في تغيير خلفيات الشاشة بمجرد جدولتها. لما يكون الجهاز في وضع السكون، تفعيل خلفية الشاشة ممكن ياخد وقت أطول.</string>
</resources>
+152
View File
@@ -0,0 +1,152 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Paperize</string>
<string name="SettingsIcon">选项</string>
<string name="dropdownmenu_settings">设置</string>
<string name="home_screen">首页</string>
<string name="wallpaper_screen">壁纸</string>
<string name="library_screen">库</string>
<string name="settings_screen">设置</string>
<string name="settings_back">返回</string>
<string name="LibraryFloatingButton">添加新库</string>
<string name="set_wallpaper_description">启用动态壁纸</string>
<string name="add_wallpaper">添加壁纸</string>
<string name="add_images">添加图片</string>
<string name="add_folder">添加文件夹</string>
<string name="contact_button">联系我们</string>
<string name="image_is_selected">已选择图片</string>
<string name="image_is_not_selected">未选择图片</string>
<string name="select_all_images_for_deletion">选择要删除的所有图片</string>
<string name="delete_confirmation">确认删除</string>
<string name="all_images_selected_for_deletion">已选择删除所有图片</string>
<string name="add_album">添加相册</string>
<string name="add_wallpaper_screen">添加壁纸屏幕</string>
<string name="enter_the_name_of_the_album">输入相册名称</string>
<string name="album_name">相册名称</string>
<string name="cancel">取消</string>
<string name="save">保存</string>
<string name="delete_album">删除</string>
<string name="change_name">编辑名称</string>
<string name="click_to_select_a_different_album">单击选择其他相册</string>
<string name="no_icon">没有图标</string>
<string name="no_album_selected">未选择相册</string>
<string name="currently_selected_album">当前选定的相册</string>
<string name="stop_the_album">停止相册</string>
<string name="more_options">更多选项</string>
<string name="startup">启动</string>
<string name="agree">同意</string>
<string name="welcome">欢迎</string>
<string name="notifications">通知</string>
<string name="continue_button">我在</string>
<string name="notification_permission_is_required_for_this_app_to_work_properly">此应用需要通知权限才能正常运行</string>
<string name="allow">允许</string>
<string name="notification_info_message">可以启用通知来显示应用程序在后台运行时的情况。</string>
<string name="set_as_lock_screen">设置为锁屏</string>
<string name="lock_screen">锁屏</string>
<string name="home">主屏幕</string>
<string name="last_change">上次更改</string>
<string name="next_change">下一个更改</string>
<string name="privacy_policy">隐私政策</string>
<string name="privacy_screen">隐私屏幕</string>
<string name="licenses">许可证</string>
<string name="licenses_screen">许可证屏幕</string>
<string name="contact">联系我们</string>
<string name="contact_the_author_by_email">透過電子郵件聯繫作者</string>
<string name="reset_to_default">重設為預設</string>
<string name="reset_all_data">重置所有數據</string>
<string name="are_you_sure_you_want_to_reset_all_settings_and_data_to_default">您確定要將所有設定和資料重設為預設值嗎?</string>
<string name="confirm">確認</string>
<string name="spotlight_animation">聚光燈動畫</string>
<string name="circle_2_animation">圈2動畫</string>
<string name="circle_1_animation">圈1動畫</string>
<string name="circle_3_animation">圈3動畫</string>
<string name="wallpaper_changer_has_been_enabled">壁紙更換器已啟用。</string>
<string name="wallpaper_changer_has_been_disabled">壁紙更換器已停用。</string>
<string name="dismiss">解僱</string>
<string name="has_been_unselected">%1$s 已取消選擇。</string>
<string name="interval_home">Home Screen | %1$s</string>
<string name="interval_lock">Lock Screen | %1$s</string>
<string name="interval">Interval | %1$s</string>
<plurals name="minutes">
<item quantity="other">%d 分鐘</item>
</plurals>
<plurals name="hours">
<item quantity="other">%d 小時</item>
</plurals>
<plurals name="days">
<item quantity="other">%d 天</item>
</plurals>
<string name="selected_count">%1$s 已選擇</string>
<string name="please_read_and_agree_to_the_following_privacy_notice_to_use_the_app">請閱讀並同意以下隱私權聲明才能使用該應用程式。</string>
<string name="privacy_notice">隱私權聲明</string>
<string name="please_read_and_agree_to_the_privacy_notice">請閱讀並同意隱私權聲明。</string>
<string name="view">看法</string>
<string name="welcome_animation">歡迎動畫</string>
<string name="notification_bell_animation">通知鈴聲動畫</string>
<string name="delete_these">刪除這些?</string>
<string name="are_you_sure_you_want_to_delete_these_wallpapers">您確定要刪除這些桌布嗎?</string>
<string name="are_you_sure_you_want_to_delete_this">你確定要刪除這個嗎?</string>
<string name="delete_album_question">刪除相簿?</string>
<string name="animation">卡通</string>
<string name="increase_visual_appeal">增加視覺吸引力</string>
<string name="dark_mode">深色模式</string>
<string name="automatic_device_mode">自動設備模式</string>
<string name="light_mode">燈光模式</string>
<string name="easier_on_the_eyes">對眼睛更容易</string>
<string name="dynamic_theme">動態主題</string>
<string name="material_you">物質的你</string>
<string name="dynamic_theming">動態主題</string>
<string name="click_here_to_view_the_licenses">按一下此處查看許可證</string>
<string name="click_here_to_view_our_privacy_policy">點擊這裡查看我們的隱私權政策</string>
<string name="add_images_btn">新增圖片</string>
<string name="add_folder_btn">新增資料夾</string>
<string name="version">版本: %1$s</string>
<string name="appearance">外貌</string>
<string name="about">關於</string>
<string name="coming_soon">即將推出</string>
<string name="new_album">新唱片</string>
<string name="wallpapers">壁紙</string>
<string name="translation">翻譯</string>
<string name="help_translate_the_app_on_crowdin">在 Crowdin 上帮助翻译应用程序!</string>
<plurals name="wallpaper_count">
<item quantity="other">%d 壁纸</item>
</plurals>
<string name="privacy_intro_title">介绍</string>
<string name="privacy_intro_content">欢迎来到 %1$s!本隐私声明概述了当您使用我们的移动应用程序时我们如何收集、使用和保护您的个人信息。使用 %1$s即表示您同意本声明中描述的条款。</string>
<string name="privacy_data_collection_title">数据采集</string>
<string name="privacy_data_collection_content">通知访问: %1$s 请求通知访问,以便根据您的通知向您提供个性化壁纸推荐。我们不会在您的设备之外存储任何通知内容或个人身份信息 (PII)。\n\n本地文件: %1$s 访问存储在您设备上的文件,以便您将它们设置为壁纸。我们不会将这些文件上传或传输到任何外部服务器。</string>
<string name="privacy_information_usage_title">信息使用</string>
<string name="privacy_information_usage_content">个人数据:我们不会收集或存储任何个人数据,例如姓名、电子邮件地址或电话号码。\n\n使用情况分析: %1$s 不会跟踪您的使用行为或收集分析数据。</string>
<string name="privacy_data_security_title">数据安全</string>
<string name="privacy_data_security_content">设备存储: %1$s 使用的所有数据都保留在您的设备上。我们不会向外部传输或存储任何数据。</string>
<string name="privacy_third_party_services_title">第三方服务</string>
<string name="privacy_third_party_services_content">广告: %1$s 不显示第三方广告。\n\n外部链接:我们的应用可能包含外部网站的链接。请注意,我们对这些网站的隐私保护不承担任何责任。</string>
<string name="privacy_children_privacy_title">儿童隐私</string>
<string name="privacy_children_privacy_content">%1$s 不适合 13 岁以下的儿童。我们不会故意收集儿童的任何信息。</string>
<string name="privacy_changes_notice_title">本通知的变更</string>
<string name="privacy_changes_notice_content">我们可能会不时更新本隐私声明。任何更改都将反映在应用程序和我们的网站上。</string>
<string name="privacy_contact_us_title">联系我们</string>
<string name="privacy_contact_us_content">如果您对本隐私声明有任何疑问或疑虑,请通过 %1$s与我联系。</string>
<string name="no_albums_found">未找到相册</string>
<string name="disable_live_wallpaper">禁用动态壁纸</string>
<string name="live_wallpaper_detected">检测到动态壁纸</string>
<string name="please_disable_your_live_wallpaper_to_use_the_wallpaper_changer">请禁用动态壁纸才能使用壁纸更换器。</string>
<string name="ok">确定</string>
<string name="percentage">%1$s%%</string>
<string name="fill">填充</string>
<string name="fit">适合</string>
<string name="stretch">拉伸</string>
<string name="wallpaper_scaling">壁纸缩放</string>
<string name="change_brightness">改变亮度</string>
<string name="home_screen_btn">主屏幕</string>
<string name="lock_screen_btn">锁定屏幕</string>
<string name="individual_scheduling">个人排程</string>
<string name="show_interval_sliders">显示间隔滑块</string>
<string name="interval_text">时间间隔</string>
<string name="change_blur">更改模糊</string>
<string name="paperize_is_running">Paperize 正在运行</string>
<string name="next_wallpaper_change">下一个壁纸更改: %1$s</string>
<string name="delay_notice">延迟通知</string>
<string name="delay_notice_dialog">延迟通知</string>
<string name="to_minimize_battery_usage_changing_wallpapers_may_have_some_delays_once_scheduled_when_the_device_is_asleep_the_wallpaper_may_take_longer_to_apply">为了最大限度地减少电池消耗,更换壁纸可能会有一些延迟。当设备处于睡眠状态时,壁纸可能需要更长时间才能应用。</string>
</resources>
-152
View File
@@ -1,152 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Paperize</string>
<string name="SettingsIcon">選項</string>
<string name="dropdownmenu_settings">設定</string>
<string name="home_screen">家</string>
<string name="wallpaper_screen">壁紙</string>
<string name="library_screen">圖書館</string>
<string name="settings_screen">設定</string>
<string name="settings_back">後退</string>
<string name="LibraryFloatingButton">新增庫</string>
<string name="set_wallpaper_description">啟用動態桌布</string>
<string name="add_wallpaper">添加壁紙</string>
<string name="add_images">新增圖片</string>
<string name="add_folder">新增資料夾</string>
<string name="contact_button">接觸</string>
<string name="image_is_selected">影像已選擇</string>
<string name="image_is_not_selected">未選擇影像</string>
<string name="select_all_images_for_deletion">選擇所有要刪除的影像</string>
<string name="delete_confirmation">刪除確認</string>
<string name="all_images_selected_for_deletion">選擇刪除的所有影像</string>
<string name="add_album">添加相簿</string>
<string name="add_wallpaper_screen">添加壁紙螢幕</string>
<string name="enter_the_name_of_the_album">輸入專輯名稱</string>
<string name="album_name">專輯名稱</string>
<string name="cancel">取消</string>
<string name="save">節省</string>
<string name="delete_album">刪除</string>
<string name="change_name">編輯姓名</string>
<string name="click_to_select_a_different_album">點擊以選擇不同的專輯</string>
<string name="no_icon">無圖示</string>
<string name="no_album_selected">未選擇專輯</string>
<string name="currently_selected_album">目前選擇的專輯</string>
<string name="stop_the_album">停止專輯</string>
<string name="more_options">更多的選擇</string>
<string name="startup">啟動</string>
<string name="agree">同意</string>
<string name="welcome">歡迎</string>
<string name="notifications">通知</string>
<string name="continue_button">算我一個</string>
<string name="notification_permission_is_required_for_this_app_to_work_properly">此應用程式需要通知權限才能正常運行</string>
<string name="allow">允許</string>
<string name="notification_info_message">可以啟用通知以顯示應用程式在背景運行時的情況。</string>
<string name="set_as_lock_screen">設定為鎖定螢幕</string>
<string name="lock_screen">鎖定畫面</string>
<string name="home">主螢幕</string>
<string name="last_change">最後一次變更</string>
<string name="next_change">下一步更改</string>
<string name="privacy_policy">隱私權政策</string>
<string name="privacy_screen">隱私螢幕</string>
<string name="licenses">許可證</string>
<string name="licenses_screen">許可證螢幕</string>
<string name="contact">接觸</string>
<string name="contact_the_author_by_email">透過電子郵件聯繫作者</string>
<string name="reset_to_default">重設為預設</string>
<string name="reset_all_data">重置所有數據</string>
<string name="are_you_sure_you_want_to_reset_all_settings_and_data_to_default">您確定要將所有設定和資料重設為預設值嗎?</string>
<string name="confirm">確認</string>
<string name="spotlight_animation">聚光燈動畫</string>
<string name="circle_2_animation">圈2動畫</string>
<string name="circle_1_animation">圈1動畫</string>
<string name="circle_3_animation">圈3動畫</string>
<string name="wallpaper_changer_has_been_enabled">壁紙更換器已啟用。</string>
<string name="wallpaper_changer_has_been_disabled">壁紙更換器已停用。</string>
<string name="dismiss">解僱</string>
<string name="has_been_unselected">%1$s 已取消選擇。</string>
<string name="interval_home">Home Screen | %1$s</string>
<string name="interval_lock">Lock Screen | %1$s</string>
<string name="interval">Interval | %1$s</string>
<plurals name="minutes">
<item quantity="other">%d 分鐘</item>
</plurals>
<plurals name="hours">
<item quantity="other">%d 小時</item>
</plurals>
<plurals name="days">
<item quantity="other">%d 天</item>
</plurals>
<string name="selected_count">%1$s 已選擇</string>
<string name="please_read_and_agree_to_the_following_privacy_notice_to_use_the_app">請閱讀並同意以下隱私權聲明才能使用該應用程式。</string>
<string name="privacy_notice">隱私權聲明</string>
<string name="please_read_and_agree_to_the_privacy_notice">請閱讀並同意隱私權聲明。</string>
<string name="view">看法</string>
<string name="welcome_animation">歡迎動畫</string>
<string name="notification_bell_animation">通知鈴聲動畫</string>
<string name="delete_these">刪除這些?</string>
<string name="are_you_sure_you_want_to_delete_these_wallpapers">您確定要刪除這些桌布嗎?</string>
<string name="are_you_sure_you_want_to_delete_this">你確定要刪除這個嗎?</string>
<string name="delete_album_question">刪除相簿?</string>
<string name="animation">卡通</string>
<string name="increase_visual_appeal">增加視覺吸引力</string>
<string name="dark_mode">深色模式</string>
<string name="automatic_device_mode">自動設備模式</string>
<string name="light_mode">燈光模式</string>
<string name="easier_on_the_eyes">對眼睛更容易</string>
<string name="dynamic_theme">動態主題</string>
<string name="material_you">物質的你</string>
<string name="dynamic_theming">動態主題</string>
<string name="click_here_to_view_the_licenses">按一下此處查看許可證</string>
<string name="click_here_to_view_our_privacy_policy">點擊這裡查看我們的隱私權政策</string>
<string name="add_images_btn">新增圖片</string>
<string name="add_folder_btn">新增資料夾</string>
<string name="version">版本: %1$s</string>
<string name="appearance">外貌</string>
<string name="about">關於</string>
<string name="coming_soon">即將推出</string>
<string name="new_album">新唱片</string>
<string name="wallpapers">壁紙</string>
<string name="translation">翻譯</string>
<string name="help_translate_the_app_on_crowdin">幫忙翻譯 Crowdin 上的應用程式!</string>
<plurals name="wallpaper_count">
<item quantity="other">%d 壁紙</item>
</plurals>
<string name="privacy_intro_title">介紹</string>
<string name="privacy_intro_content">歡迎來到 %1$s!本隱私權聲明概述了當您使用我們的行動應用程式時我們如何收集、使用和保護您的個人資訊。使用 %1$s即表示您同意本通知中所述的條款。</string>
<string name="privacy_data_collection_title">數據採集</string>
<string name="privacy_data_collection_content">通知訪問: %1$s 要求通知訪問,以便根據您的通知為您提供個人化壁紙推薦。我們不會在您的裝置之外儲存任何通知內容或個人識別資訊 (PII)。\n\n本地文件: %1$s 存取裝置上儲存的文件,以便您將它們設定為桌布。我們不會將這些文件上傳或傳輸到任何外部伺服器。</string>
<string name="privacy_information_usage_title">資訊使用</string>
<string name="privacy_information_usage_content">個人資料:我們不收集或儲存任何個人數據,例如姓名、電子郵件地址或電話號碼。\n\n使用狀況分析: %1$s 不會追蹤您的使用行為或收集分析資料。</string>
<string name="privacy_data_security_title">資料安全</string>
<string name="privacy_data_security_content">設備上儲存: %1$s 使用的所有資料都保留在您的裝置上。我們不會向外部傳輸或儲存任何資料。</string>
<string name="privacy_third_party_services_title">第三方服務</string>
<string name="privacy_third_party_services_content">Advertisements: %1$s does not display third-party ads.\n\nExternal Links: Our app may contain links to external websites. Please note that we are not responsible for the privacy practices of these sites.</string>
<string name="privacy_children_privacy_title">兒童隱私</string>
<string name="privacy_children_privacy_content">%1$s 不適合 13 歲以下的兒童。</string>
<string name="privacy_changes_notice_title">本通知的變更</string>
<string name="privacy_changes_notice_content">我們可能會不時更新本隱私權聲明。任何更改都將反映在應用程式和我們的網站上。</string>
<string name="privacy_contact_us_title">聯絡我們</string>
<string name="privacy_contact_us_content">如果您對此隱私權聲明有任何疑問或疑慮,請透過 %1$s與我聯絡。</string>
<string name="no_albums_found">沒有找到專輯</string>
<string name="disable_live_wallpaper">停用動態壁紙</string>
<string name="live_wallpaper_detected">偵測到動態壁紙</string>
<string name="please_disable_your_live_wallpaper_to_use_the_wallpaper_changer">請停用您的動態桌布以使用壁紙更換器。</string>
<string name="ok">好的</string>
<string name="percentage">%1$s%%</string>
<string name="fill">充滿</string>
<string name="fit">合身</string>
<string name="stretch">拉緊</string>
<string name="wallpaper_scaling">壁紙縮放</string>
<string name="change_brightness">改變亮度</string>
<string name="home_screen_btn">主螢幕</string>
<string name="lock_screen_btn">鎖定畫面</string>
<string name="individual_scheduling">個人安排</string>
<string name="show_interval_sliders">顯示間隔滑桿</string>
<string name="interval_text">時間間隔</string>
<string name="change_blur">改變模糊</string>
<string name="paperize_is_running">Paperize 正在運行</string>
<string name="next_wallpaper_change">下次更換壁紙: %1$s</string>
<string name="delay_notice">延誤通知</string>
<string name="delay_notice_dialog">延誤通知</string>
<string name="to_minimize_battery_usage_changing_wallpapers_may_have_some_delays_once_scheduled_when_the_device_is_asleep_the_wallpaper_may_take_longer_to_apply">為了最大限度地減少電池使用量,更換壁紙可能會在預定後出現一些延遲。當設備處於睡眠狀態時,壁紙可能需要更長的時間才能應用。</string>
</resources>
+5 -4
View File
@@ -8,10 +8,11 @@ buildscript {
plugins { plugins {
id("com.android.application") version "8.4.1" apply false id("com.android.application") version "8.4.1" apply false
id("com.android.library") version "8.4.1" apply false id("com.android.library") version "8.4.1" apply false
id("org.jetbrains.kotlin.android") version "1.9.0" apply false id("org.jetbrains.kotlin.android") version "2.0.0" apply false
id("com.google.dagger.hilt.android") version "2.50" apply false id ("org.jetbrains.kotlin.plugin.compose") version "2.0.0" apply false
id("com.google.devtools.ksp") version "1.9.0-1.0.13" apply false id("com.google.dagger.hilt.android") version "2.51" apply false
id ("com.mikepenz.aboutlibraries.plugin") version "11.1.3" apply false id("com.google.devtools.ksp") version "2.0.0-1.0.21" apply false
id ("com.mikepenz.aboutlibraries.plugin") version "11.2.1" apply false
id ("org.jetbrains.kotlin.plugin.serialization") version "1.9.22" apply false id ("org.jetbrains.kotlin.plugin.serialization") version "1.9.22" apply false
} }
Binary file not shown.