Skip to content

Commit

Permalink
Fixed blank new settings screen in an single-column mode,
Browse files Browse the repository at this point in the history
Optimized app launch,
Null-safe setting values,
Enabled gradle caching, parallel building and non-final res ids to reduce speed time,
Updated libraries,
Add an foojay-resolver-convention plugin to automatically install an required jdk

Signed-off-by: MrBoom <[email protected]>
  • Loading branch information
MrBoomDeveloper committed Dec 25, 2024
1 parent 7adc91b commit 41f104d
Show file tree
Hide file tree
Showing 69 changed files with 1,080 additions and 1,052 deletions.
32 changes: 17 additions & 15 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import com.android.build.api.dsl.ApplicationProductFlavor
import com.mrboomdev.awery.gradle.ProjectVersion.generateVersionCode
import com.mrboomdev.awery.gradle.ProjectVersion.getGitCommitHash
import com.mrboomdev.awery.gradle.SettingsClassGenerator.generatedSettingsDir
import com.mrboomdev.awery.gradle.SettingsGenerateTask
import com.mrboomdev.awery.gradle.settings.GenerateSettingsTask
import com.mrboomdev.awery.gradle.settings.generatedSettingsKotlinDirectory
import com.mrboomdev.awery.gradle.settings.generatedSettingsResourcesDirectory

plugins {
alias(libs.plugins.android.app)
Expand Down Expand Up @@ -38,13 +39,12 @@ android {
androidResources {
generateLocaleConfig = true
}

sourceSets {
get("main").apply {
java.srcDirs(layout.buildDirectory.file("generated/awery/kotlin"), generatedSettingsDir)
}

sourceSets["main"].apply {
kotlin.srcDir(generatedSettingsKotlinDirectory)
resources.srcDir(generatedSettingsResourcesDirectory)
}

buildTypes {
debug {
isDebuggable = true
Expand Down Expand Up @@ -133,8 +133,8 @@ dependencies {
implementation(libs.retrostreams)
implementation(libs.bundles.aniyomi)
implementation(projects.ext)

// Database
// Database
ksp(libs.androidx.room.compiler)
implementation(libs.androidx.room.runtime)

Expand Down Expand Up @@ -163,6 +163,9 @@ dependencies {
implementation(libs.androidx.navigation.compose)
implementation(libs.compose.tv.material)
implementation(libs.compose.tv.foundation)
implementation(libs.androidx.adaptive)
implementation(libs.androidx.adaptive.layout)
implementation(libs.androidx.adaptive.navigation)

// Markdown
implementation(libs.markwon.core)
Expand Down Expand Up @@ -204,12 +207,11 @@ dependencies {
debugImplementation(libs.leakcanary)
}

tasks.register<SettingsGenerateTask>("generateClasses") {
outputFile = layout.buildDirectory.file("generated/awery/kotlin/com/mrboomdev/awery/AwerySettings.kt")
tasks.register<GenerateSettingsTask>("generateSettings") {
packageName = "com.mrboomdev.awery.generated"
className = "AwerySettings"
inputFiles = listOf(
layout.projectDirectory.file("src/main/assets/app_settings.json"),
layout.projectDirectory.file("src/main/assets/system_settings.json")
)
}

tasks["preBuild"].dependsOn(tasks["generateClasses"])
}.let { tasks["preBuild"].dependsOn(it) }
51 changes: 26 additions & 25 deletions app/src/main/assets/app_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,49 +179,49 @@
{
"key": "player_double_tap_seek_length",
"type": "select",
"value": "10",
"value": 10,
"title": "double_tap_seek",
"icon": "ic_round_touch_app_24",
"description": "${VALUE}",
"show_if": ["!tv"],
"items": [
{
"key": "0",
"key": 0,
"title": "disabled"
},

{
"key": "3",
"key": 3,
"title": "3s"
},

{
"key": "5",
"key": 5,
"title": "5s"
},

{
"key": "10",
"key": 10,
"title": "10s"
},

{
"key": "15",
"key": 15,
"title": "15s"
},

{
"key": "30",
"key": 30,
"title": "30s"
},

{
"key": "60",
"key": 60,
"title": "60s"
},

{
"key": "120",
"key": 120,
"title": "120s"
}
]
Expand All @@ -230,43 +230,43 @@
{
"key": "player_big_seek_length",
"type": "select",
"value": "60",
"value": 60,
"title": "quick_rewind",
"icon": "ic_fast_forward_outlined",
"description": "${VALUE}",
"items": [
{
"key": "0",
"key": 0,
"title": "Disabled"
},

{
"key": "30",
"key": 30,
"title": "30s"
},

{
"key": "45",
"key": 45,
"title": "45s"
},

{
"key": "60",
"key": 60,
"title": "1m"
},

{
"key": "120",
"key": 120,
"title": "2m"
},

{
"key": "180",
"key": 180,
"title": "3m"
},

{
"key": "240",
"key": 240,
"title": "4m"
}
]
Expand Down Expand Up @@ -330,42 +330,42 @@
},

{
"key": "144",
"key": 144,
"title": "144p"
},

{
"key": "240",
"key": 240,
"title": "240p"
},

{
"key": "360",
"key": 360,
"title": "360p"
},

{
"key": "480",
"key": 480,
"title": "480p"
},

{
"key": "720",
"key": 720,
"title": "720p"
},

{
"key": "1080",
"key": 1080,
"title": "1080p"
},

{
"key": "1440",
"key": 1440,
"title": "1440p"
},

{
"key": "2160",
"key": 2160,
"title": "2160p"
}
]
Expand Down Expand Up @@ -520,6 +520,7 @@
"key": "log_network",
"type": "boolean",
"restart": true,
"value": false,
"title": "Verbose network logging"
},

Expand Down
9 changes: 6 additions & 3 deletions app/src/main/assets/system_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"items": [
{
"key": "did_suggest_material_you",
"type": "boolean"
"type": "boolean",
"value": false
},

{
Expand All @@ -13,13 +14,13 @@

{
"key": "last_opened_version",
"type": "integer", "value": 0
"type": "integer", "value": -1
},

{
"key": "setup_version_finished",
"type": "integer",
"value": 0
"value": -1
},

{
Expand Down Expand Up @@ -86,6 +87,7 @@
{
"key": "use_amoled_theme",
"type": "boolean",
"value": false,
"restart": true,
"title": "amoled",
"icon": "ic_contrast",
Expand All @@ -95,6 +97,7 @@
{
"key": "extract_banner_color",
"type": "boolean",
"value": true,
"title": "use_unique_theme_for_each_item",
"icon": "ic_round_movie_filter_24",
"show_if": ["never"]
Expand Down
Loading

0 comments on commit 41f104d

Please sign in to comment.