Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c1404ec522 | ||
|
|
bcff2f338f | ||
|
|
5582a5851f | ||
|
|
1d0794d135 | ||
|
|
0e20f211f2 |
No files matched your search
@@ -64,7 +64,7 @@ This project is built using Kotlin, Java, and Gradle. Here are the steps to buil
|
|||||||
### Prerequisites
|
### Prerequisites
|
||||||
- Java 8 (1.8)
|
- Java 8 (1.8)
|
||||||
- Android Studio Jellyfish | 2023.3.1 or later
|
- Android Studio Jellyfish | 2023.3.1 or later
|
||||||
- Android Gradle Plugin 8.4.1 or later
|
- Android Gradle Plugin 8.5.0 or later
|
||||||
- Gradle 8.8
|
- Gradle 8.8
|
||||||
- Minimum SDK 26
|
- Minimum SDK 26
|
||||||
|
|
||||||
|
|||||||
+34
-28
@@ -19,18 +19,13 @@ android {
|
|||||||
applicationId = "com.anthonyla.paperize"
|
applicationId = "com.anthonyla.paperize"
|
||||||
minSdk = 26
|
minSdk = 26
|
||||||
targetSdk = 34
|
targetSdk = 34
|
||||||
versionCode = 22
|
versionCode = 24
|
||||||
versionName = "1.5.4"
|
versionName = "1.5.6"
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
vectorDrawables {
|
vectorDrawables {
|
||||||
useSupportLibrary = true
|
useSupportLibrary = true
|
||||||
}
|
}
|
||||||
ndk {
|
|
||||||
debugSymbolLevel = "FULL"
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
@@ -39,21 +34,28 @@ android {
|
|||||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||||
"proguard-rules.pro"
|
"proguard-rules.pro"
|
||||||
)
|
)
|
||||||
|
ndk {
|
||||||
|
debugSymbolLevel = "FULL"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
targetCompatibility = JavaVersion.VERSION_1_8
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
}
|
}
|
||||||
|
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
jvmTarget = "1.8"
|
jvmTarget = "1.8"
|
||||||
freeCompilerArgs += strongSkippingConfiguration()
|
freeCompilerArgs += strongSkippingConfiguration()
|
||||||
}
|
}
|
||||||
|
|
||||||
buildFeatures {
|
buildFeatures {
|
||||||
compose = true
|
compose = true
|
||||||
viewBinding = true
|
viewBinding = true
|
||||||
buildConfig = true
|
buildConfig = true
|
||||||
}
|
}
|
||||||
|
|
||||||
composeOptions {
|
composeOptions {
|
||||||
kotlinCompilerExtensionVersion = "1.5.10"
|
kotlinCompilerExtensionVersion = "1.5.10"
|
||||||
}
|
}
|
||||||
@@ -61,8 +63,13 @@ android {
|
|||||||
androidResources {
|
androidResources {
|
||||||
generateLocaleConfig = true
|
generateLocaleConfig = true
|
||||||
}
|
}
|
||||||
|
|
||||||
ndkVersion = "26.3.11579264"
|
ndkVersion = "26.3.11579264"
|
||||||
buildToolsVersion = "34.0.0"
|
buildToolsVersion = "34.0.0"
|
||||||
|
dependenciesInfo {
|
||||||
|
includeInApk = true
|
||||||
|
includeInBundle = true
|
||||||
|
}
|
||||||
|
|
||||||
aboutLibraries {
|
aboutLibraries {
|
||||||
excludeFields = arrayOf("generated")
|
excludeFields = arrayOf("generated")
|
||||||
@@ -77,47 +84,46 @@ 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.2")
|
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.3")
|
||||||
implementation("androidx.activity:activity-compose:1.9.0")
|
implementation("androidx.activity:activity-compose:1.9.0")
|
||||||
implementation(platform("androidx.compose:compose-bom:2024.06.00"))
|
implementation(platform("androidx.compose:compose-bom:2024.06.00"))
|
||||||
implementation("androidx.compose.ui:ui:1.7.0-beta03")
|
implementation("androidx.compose.ui:ui:1.7.0-beta04")
|
||||||
implementation("androidx.compose.ui:ui-graphics:1.7.0-beta03")
|
implementation("androidx.compose.ui:ui-graphics:1.7.0-beta04")
|
||||||
implementation("androidx.compose.ui:ui-tooling-preview:1.7.0-beta03")
|
implementation("androidx.compose.ui:ui-tooling-preview:1.7.0-beta04")
|
||||||
implementation("androidx.compose.material3:material3:1.3.0-beta03")
|
implementation("androidx.compose.material3:material3:1.3.0-beta04")
|
||||||
implementation("androidx.navigation:navigation-compose:2.8.0-beta03")
|
implementation("androidx.navigation:navigation-compose:2.8.0-beta04")
|
||||||
implementation("androidx.compose.material:material:1.7.0-beta03")
|
implementation("androidx.compose.material:material:1.7.0-beta04")
|
||||||
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-beta03")
|
implementation("androidx.compose.material:material-icons-extended:1.7.0-beta04")
|
||||||
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-beta03")
|
implementation("androidx.compose.animation:animation:1.7.0-beta04")
|
||||||
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.2")
|
implementation("androidx.lifecycle:lifecycle-runtime-compose:2.8.3")
|
||||||
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.4")
|
implementation("com.github.skydoves:landscapist-glide:2.3.6")
|
||||||
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.2")
|
||||||
implementation("com.mikepenz:aboutlibraries-compose-m3:11.2.1")
|
implementation("com.mikepenz:aboutlibraries-compose-m3:11.2.2")
|
||||||
implementation("androidx.compose.foundation:foundation:1.7.0-beta03")
|
implementation("androidx.compose.foundation:foundation:1.7.0-beta04")
|
||||||
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.2.1")
|
||||||
androidTestImplementation("androidx.test.espresso:espresso-core:3.6.0-rc01")
|
androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")
|
||||||
androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.7.0-beta03")
|
androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.7.0-beta04")
|
||||||
debugImplementation("androidx.compose.ui:ui-tooling:1.7.0-beta03")
|
debugImplementation("androidx.compose.ui:ui-tooling:1.7.0-beta04")
|
||||||
debugImplementation("androidx.compose.ui:ui-test-manifest:1.7.0-beta03")
|
debugImplementation("androidx.compose.ui:ui-test-manifest:1.7.0-beta04")
|
||||||
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.7.0")
|
implementation ("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.1")
|
||||||
implementation("com.github.android:renderscript-intrinsics-replacement-toolkit:b6363490c3")
|
implementation("com.github.android:renderscript-intrinsics-replacement-toolkit:b6363490c3")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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
@@ -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)
|
||||||
|
|||||||
+9
-34
@@ -17,11 +17,9 @@ import androidx.compose.ui.unit.Dp
|
|||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.hilt.navigation.compose.hiltViewModel
|
import androidx.hilt.navigation.compose.hiltViewModel
|
||||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||||
import androidx.navigation.NavType
|
|
||||||
import androidx.navigation.compose.NavHost
|
import androidx.navigation.compose.NavHost
|
||||||
import androidx.navigation.compose.composable
|
import androidx.navigation.compose.composable
|
||||||
import androidx.navigation.compose.rememberNavController
|
import androidx.navigation.compose.rememberNavController
|
||||||
import androidx.navigation.navArgument
|
|
||||||
import androidx.navigation.toRoute
|
import androidx.navigation.toRoute
|
||||||
import com.anthonyla.paperize.feature.wallpaper.domain.model.SelectedAlbum
|
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.model.Wallpaper
|
||||||
@@ -45,10 +43,10 @@ import com.anthonyla.paperize.feature.wallpaper.presentation.wallpaper_screen.Wa
|
|||||||
import com.anthonyla.paperize.feature.wallpaper.presentation.wallpaper_view_screen.WallpaperViewScreen
|
import com.anthonyla.paperize.feature.wallpaper.presentation.wallpaper_view_screen.WallpaperViewScreen
|
||||||
import com.anthonyla.paperize.feature.wallpaper.util.navigation.AddEdit
|
import com.anthonyla.paperize.feature.wallpaper.util.navigation.AddEdit
|
||||||
import com.anthonyla.paperize.feature.wallpaper.util.navigation.AlbumView
|
import com.anthonyla.paperize.feature.wallpaper.util.navigation.AlbumView
|
||||||
|
import com.anthonyla.paperize.feature.wallpaper.util.navigation.FolderView
|
||||||
import com.anthonyla.paperize.feature.wallpaper.util.navigation.Home
|
import com.anthonyla.paperize.feature.wallpaper.util.navigation.Home
|
||||||
import com.anthonyla.paperize.feature.wallpaper.util.navigation.Licenses
|
import com.anthonyla.paperize.feature.wallpaper.util.navigation.Licenses
|
||||||
import com.anthonyla.paperize.feature.wallpaper.util.navigation.NavConstants.INITIAL_OFFSET
|
import com.anthonyla.paperize.feature.wallpaper.util.navigation.NavConstants.INITIAL_OFFSET
|
||||||
import com.anthonyla.paperize.feature.wallpaper.util.navigation.NavScreens
|
|
||||||
import com.anthonyla.paperize.feature.wallpaper.util.navigation.Notification
|
import com.anthonyla.paperize.feature.wallpaper.util.navigation.Notification
|
||||||
import com.anthonyla.paperize.feature.wallpaper.util.navigation.Privacy
|
import com.anthonyla.paperize.feature.wallpaper.util.navigation.Privacy
|
||||||
import com.anthonyla.paperize.feature.wallpaper.util.navigation.Settings
|
import com.anthonyla.paperize.feature.wallpaper.util.navigation.Settings
|
||||||
@@ -58,15 +56,11 @@ import com.anthonyla.paperize.feature.wallpaper.util.navigation.sharedXTransitio
|
|||||||
import com.anthonyla.paperize.feature.wallpaper.util.navigation.sharedXTransitionOut
|
import com.anthonyla.paperize.feature.wallpaper.util.navigation.sharedXTransitionOut
|
||||||
import com.anthonyla.paperize.feature.wallpaper.wallpaper_alarmmanager.WallpaperAlarmItem
|
import com.anthonyla.paperize.feature.wallpaper.wallpaper_alarmmanager.WallpaperAlarmItem
|
||||||
import com.anthonyla.paperize.feature.wallpaper.wallpaper_alarmmanager.WallpaperScheduler
|
import com.anthonyla.paperize.feature.wallpaper.wallpaper_alarmmanager.WallpaperScheduler
|
||||||
import com.google.gson.Gson
|
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.Job
|
import kotlinx.coroutines.Job
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kotlinx.coroutines.runBlocking
|
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
import java.net.URLEncoder
|
|
||||||
import java.nio.charset.StandardCharsets
|
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun PaperizeApp(
|
fun PaperizeApp(
|
||||||
@@ -100,9 +94,7 @@ fun PaperizeApp(
|
|||||||
navController.navigate(Home)
|
navController.navigate(Home)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
albumsViewModel.onEvent(
|
albumsViewModel.onEvent(AlbumsEvent.DeleteAlbumWithWallpapers(albumWithWallpapers))
|
||||||
AlbumsEvent.DeleteAlbumWithWallpapers(albumWithWallpapers)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
selectedState.value.selectedAlbum?.let { selectedAlbum ->
|
selectedState.value.selectedAlbum?.let { selectedAlbum ->
|
||||||
@@ -565,8 +557,7 @@ fun PaperizeApp(
|
|||||||
navController.navigate(WallpaperView(it))
|
navController.navigate(WallpaperView(it))
|
||||||
},
|
},
|
||||||
onShowFolderView = { folderName, wallpapers ->
|
onShowFolderView = { folderName, wallpapers ->
|
||||||
val encodedWallpapers = runBlocking { encodeUri(uri = Gson().toJson(wallpapers)) }
|
navController.navigate(FolderView(folderName, wallpapers))
|
||||||
navController.navigate("${NavScreens.FolderView.route}/${folderName ?: " "}/$encodedWallpapers")
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -600,12 +591,7 @@ fun PaperizeApp(
|
|||||||
animate = settingsState.value.animate
|
animate = settingsState.value.animate
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
composable(
|
composable<FolderView>(
|
||||||
route = NavScreens.FolderView.route.plus("/{folderName}/{wallpapers}"),
|
|
||||||
arguments = listOf(
|
|
||||||
navArgument("folderName") { type = NavType.StringType },
|
|
||||||
navArgument("wallpapers") { type = NavType.StringType }
|
|
||||||
),
|
|
||||||
enterTransition = {
|
enterTransition = {
|
||||||
if (settingsState.value.animate) {
|
if (settingsState.value.animate) {
|
||||||
sharedXTransitionIn(initial = { (it * INITIAL_OFFSET).toInt() })
|
sharedXTransitionIn(initial = { (it * INITIAL_OFFSET).toInt() })
|
||||||
@@ -627,15 +613,11 @@ fun PaperizeApp(
|
|||||||
} else { null }
|
} else { null }
|
||||||
}
|
}
|
||||||
) { backStackEntry ->
|
) { backStackEntry ->
|
||||||
val folderName = backStackEntry.arguments?.getString("folderName")
|
val folderView: FolderView = backStackEntry.toRoute()
|
||||||
val wallpapers = Gson().fromJson(
|
if (folderView.wallpapers.isNotEmpty()) {
|
||||||
backStackEntry.arguments?.getString("wallpapers"),
|
|
||||||
Array<String>::class.java
|
|
||||||
).toList()
|
|
||||||
if (wallpapers.isNotEmpty()) {
|
|
||||||
FolderViewScreen(
|
FolderViewScreen(
|
||||||
folderName = folderName,
|
folderName = folderView.folderName,
|
||||||
wallpapers = wallpapers,
|
wallpapers = folderView.wallpapers,
|
||||||
onBackClick = { navController.navigateUp() },
|
onBackClick = { navController.navigateUp() },
|
||||||
onShowWallpaperView = {
|
onShowWallpaperView = {
|
||||||
navController.navigate(WallpaperView(it))
|
navController.navigate(WallpaperView(it))
|
||||||
@@ -677,8 +659,7 @@ fun PaperizeApp(
|
|||||||
navController.navigate(WallpaperView(it))
|
navController.navigate(WallpaperView(it))
|
||||||
},
|
},
|
||||||
onShowFolderView = { folderName, wallpapers ->
|
onShowFolderView = { folderName, wallpapers ->
|
||||||
val encodedWallpapers = runBlocking { encodeUri(uri = Gson().toJson(wallpapers)) }
|
navController.navigate(FolderView(folderName, wallpapers))
|
||||||
navController.navigate("${NavScreens.FolderView.route}/${folderName ?: " "}/$encodedWallpapers")
|
|
||||||
},
|
},
|
||||||
onDeleteAlbum = {
|
onDeleteAlbum = {
|
||||||
navController.navigateUp()
|
navController.navigateUp()
|
||||||
@@ -807,9 +788,3 @@ fun PaperizeApp(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Encode an URI so it can be passed with navigation
|
|
||||||
suspend fun encodeUri(uri: String): String =
|
|
||||||
withContext(Dispatchers.IO) {
|
|
||||||
URLEncoder.encode(uri, StandardCharsets.UTF_8.toString())
|
|
||||||
}
|
|
||||||
+1
-2
@@ -102,7 +102,6 @@ fun AddAlbumSmallTopBar(
|
|||||||
), label = stringResource(R.string.circle_3_animation)
|
), label = stringResource(R.string.circle_3_animation)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
TopAppBar(
|
TopAppBar(
|
||||||
colors = TopAppBarDefaults.centerAlignedTopAppBarColors(containerColor = MaterialTheme.colorScheme.surface),
|
colors = TopAppBarDefaults.centerAlignedTopAppBarColors(containerColor = MaterialTheme.colorScheme.surface),
|
||||||
title = {
|
title = {
|
||||||
@@ -174,7 +173,7 @@ fun AddAlbumSmallTopBar(
|
|||||||
},
|
},
|
||||||
actions = {
|
actions = {
|
||||||
if(!selectionMode) {
|
if(!selectionMode) {
|
||||||
if (!isEmpty) {
|
if (!isEmpty && editableTitle.isNotEmpty()) {
|
||||||
Box {
|
Box {
|
||||||
val primaryColor = MaterialTheme.colorScheme.inversePrimary
|
val primaryColor = MaterialTheme.colorScheme.inversePrimary
|
||||||
val secondaryColor = MaterialTheme.colorScheme.secondary
|
val secondaryColor = MaterialTheme.colorScheme.secondary
|
||||||
|
|||||||
+3
-3
@@ -95,7 +95,7 @@ fun HomeScreen(
|
|||||||
TabRow(
|
TabRow(
|
||||||
selectedTabIndex = tabIndex,
|
selectedTabIndex = tabIndex,
|
||||||
indicator = { tabPositions ->
|
indicator = { tabPositions ->
|
||||||
if (tabIndex < tabPositions.size) {
|
if (tabIndex in tabPositions.indices) {
|
||||||
TabRowDefaults.PrimaryIndicator(
|
TabRowDefaults.PrimaryIndicator(
|
||||||
modifier = Modifier.tabIndicatorOffset(tabPositions[tabIndex]),
|
modifier = Modifier.tabIndicatorOffset(tabPositions[tabIndex]),
|
||||||
shape = RoundedCornerShape(
|
shape = RoundedCornerShape(
|
||||||
@@ -129,7 +129,7 @@ fun HomeScreen(
|
|||||||
state = pagerState,
|
state = pagerState,
|
||||||
beyondViewportPageCount = 1
|
beyondViewportPageCount = 1
|
||||||
) { index ->
|
) { index ->
|
||||||
when(index) {
|
when(index.coerceIn(tabItems.indices)) {
|
||||||
0 -> WallpaperScreen(
|
0 -> WallpaperScreen(
|
||||||
animate = animate,
|
animate = animate,
|
||||||
darken = darken,
|
darken = darken,
|
||||||
@@ -162,7 +162,7 @@ fun HomeScreen(
|
|||||||
onBlurChange = onBlurChange,
|
onBlurChange = onBlurChange,
|
||||||
blurPercentage = blurPercentage
|
blurPercentage = blurPercentage
|
||||||
)
|
)
|
||||||
1 -> LibraryScreen(
|
else -> LibraryScreen(
|
||||||
onAddNewAlbumClick = { addAlbumDialog = true },
|
onAddNewAlbumClick = { addAlbumDialog = true },
|
||||||
onViewAlbum = onAlbumViewClick,
|
onViewAlbum = onAlbumViewClick,
|
||||||
animate = animate
|
animate = animate
|
||||||
|
|||||||
+2
-6
@@ -57,12 +57,8 @@ data class AddEdit(val wallpaper: String)
|
|||||||
@Serializable
|
@Serializable
|
||||||
data class WallpaperView(val wallpaper: String)
|
data class WallpaperView(val wallpaper: String)
|
||||||
|
|
||||||
/** Reverted back to passing JSON due to bug in navigation compose causing crash
|
/**
|
||||||
* Data class for FolderView screen
|
* Data class for FolderView screen
|
||||||
|
*/
|
||||||
@Serializable
|
@Serializable
|
||||||
data class FolderView(val folderName: String?, val wallpapers: List<String>)
|
data class FolderView(val folderName: String?, val wallpapers: List<String>)
|
||||||
*/
|
|
||||||
|
|
||||||
sealed class NavScreens(val route: String) {
|
|
||||||
data object FolderView : NavScreens("folder_view_screen")
|
|
||||||
}
|
|
||||||
+20
-5
@@ -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
|
||||||
@@ -120,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(
|
||||||
@@ -179,6 +175,11 @@ class WallpaperScheduler (
|
|||||||
putExtra("refresh", true)
|
putExtra("refresh", true)
|
||||||
}
|
}
|
||||||
val nextMidnight = LocalDateTime.now().plusDays(1).withHour(0).withMinute(0).withSecond(0).withNano(0)
|
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.setExact(
|
||||||
AlarmManager.RTC_WAKEUP,
|
AlarmManager.RTC_WAKEUP,
|
||||||
nextMidnight.atZone(ZoneId.systemDefault()).toEpochSecond() * 1000,
|
nextMidnight.atZone(ZoneId.systemDefault()).toEpochSecond() * 1000,
|
||||||
@@ -190,6 +191,20 @@ class WallpaperScheduler (
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
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
|
||||||
|
|||||||
+5
-6
@@ -47,7 +47,7 @@ import javax.inject.Inject
|
|||||||
import kotlin.math.min
|
import kotlin.math.min
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used in conjunction with [WallpaperService1] to schedule home screen and lock screen separately
|
* Used in conjunction with [WallpaperService1] to schedule home screen and lock screen separately -- sets lock screen wallpaper
|
||||||
*/
|
*/
|
||||||
@AndroidEntryPoint
|
@AndroidEntryPoint
|
||||||
class WallpaperService2: Service() {
|
class WallpaperService2: Service() {
|
||||||
@@ -238,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 ->
|
||||||
@@ -326,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 ->
|
||||||
@@ -370,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 }
|
||||||
@@ -513,7 +513,6 @@ class WallpaperService2: Service() {
|
|||||||
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 {
|
||||||
@@ -564,8 +563,8 @@ class WallpaperService2: Service() {
|
|||||||
image.recycle()
|
image.recycle()
|
||||||
}
|
}
|
||||||
bitmap.recycle()
|
bitmap.recycle()
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
return true
|
||||||
} catch (e: IOException) {
|
} catch (e: IOException) {
|
||||||
Log.e("PaperizeWallpaperChanger", "Error setting wallpaper", e)
|
Log.e("PaperizeWallpaperChanger", "Error setting wallpaper", e)
|
||||||
return false
|
return false
|
||||||
|
|||||||
+4
-4
@@ -6,14 +6,14 @@ buildscript {
|
|||||||
}
|
}
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("com.android.application") version "8.4.1" apply false
|
id("com.android.application") version "8.5.0" apply false
|
||||||
id("com.android.library") version "8.4.1" apply false
|
id("com.android.library") version "8.5.0" apply false
|
||||||
id("org.jetbrains.kotlin.android") version "2.0.0" apply false
|
id("org.jetbrains.kotlin.android") version "2.0.0" apply false
|
||||||
id ("org.jetbrains.kotlin.plugin.compose") version "2.0.0" apply false
|
id ("org.jetbrains.kotlin.plugin.compose") version "2.0.0" apply false
|
||||||
id("com.google.dagger.hilt.android") version "2.51" apply false
|
id("com.google.dagger.hilt.android") version "2.51.1" apply false
|
||||||
id("com.google.devtools.ksp") version "2.0.0-1.0.21" 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 ("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 "2.0.0" apply false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user