From 5af4c34a3352f4f62485d01964227aaec886c2cf Mon Sep 17 00:00:00 2001 From: HeCodes2Much Date: Thu, 21 Nov 2024 17:06:05 +0000 Subject: [PATCH] Test Update --- app/build.gradle.kts | 116 +++++++-------- .../mlauncher/data/Constants.kt | 2 +- .../droidworksstudio/mlauncher/data/Prefs.kt | 5 +- app/src/main/res/layout/fragment_home.xml | 132 ++++++++++-------- gradle/libs.versions.toml | 80 +++++++++++ 5 files changed, 216 insertions(+), 119 deletions(-) create mode 100644 gradle/libs.versions.toml diff --git a/app/build.gradle.kts b/app/build.gradle.kts index d474411e..b5bae746 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -81,67 +81,67 @@ android { } dependencies { - val androidxTestKotlin = "1.7.5" - implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar")))) - implementation("androidx.core:core-ktx:1.15.0") - implementation("androidx.appcompat:appcompat:1.7.0") - implementation("androidx.recyclerview:recyclerview:1.3.2") + // Core libraries + implementation(libs.core.ktx) + implementation(libs.appcompat) + implementation(libs.recyclerview) - // Android lifecycle - implementation("androidx.lifecycle:lifecycle-extensions:2.2.0") - implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.7") + // Android Lifecycle + implementation(libs.lifecycle.extensions) + implementation(libs.lifecycle.viewmodel.ktx) // Navigation - implementation("androidx.navigation:navigation-fragment-ktx:2.8.3") + implementation(libs.navigation.fragment.ktx) + implementation(libs.navigation.ui.ktx) // Work Manager - implementation("androidx.work:work-runtime-ktx:2.10.0") - implementation("androidx.constraintlayout:constraintlayout:2.1.4") - implementation("androidx.constraintlayout:constraintlayout-compose:1.1.0") - - // Text similarity - implementation("org.apache.commons:commons-text:1.12.0") - implementation("com.google.code.gson:gson:2.11.0") - - // JETPACK - // Integration with activities - //noinspection GradleDependency - implementation("androidx.activity:activity-compose:1.9.1") - // Compose Material Design - implementation("androidx.compose.material:material:$androidxTestKotlin") - implementation("com.github.SmartToolFactory:Compose-Colorful-Sliders:1.2.0") - // Animations - implementation("androidx.compose.animation:animation:$androidxTestKotlin") - implementation("androidx.navigation:navigation-ui-ktx:2.8.4") - - // AndroidX - implementation("androidx.compose.ui:ui:$androidxTestKotlin") - implementation("androidx.compose.ui:ui-tooling:$androidxTestKotlin") - implementation("androidx.compose.foundation:foundation:$androidxTestKotlin") - implementation("androidx.biometric:biometric-ktx:1.4.0-alpha02") - - //color picker - implementation("net.mm2d.color-chooser:color-chooser:0.7.3") - - val acraVersion = "5.11.3" - implementation("ch.acra:acra-core:$acraVersion") - implementation("ch.acra:acra-dialog:$acraVersion") - implementation("ch.acra:acra-mail:$acraVersion") - - val androidxTestEspresso = "3.6.1" - androidTestImplementation("androidx.test.espresso:espresso-core:$androidxTestEspresso") - androidTestImplementation("androidx.test.espresso:espresso-contrib:$androidxTestEspresso") - implementation("androidx.test.espresso:espresso-idling-resource:$androidxTestEspresso") - implementation("androidx.test.espresso:espresso-idling-resource:$androidxTestEspresso") - - // Test rules and transitive dependencies: - androidTestImplementation("androidx.compose.ui:ui-test-junit4:$androidxTestKotlin") - // Needed for createComposeRule, but not createAndroidComposeRule: - debugImplementation("androidx.compose.ui:ui-test-manifest:$androidxTestKotlin") - androidTestImplementation("androidx.navigation:navigation-testing:2.8.4") - debugImplementation("androidx.fragment:fragment-testing:1.8.5") - implementation("androidx.test:core-ktx:1.6.1") - androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1") - androidTestImplementation("androidx.test:runner:1.6.2") - androidTestImplementation("androidx.test:rules:1.6.1") + implementation(libs.work.runtime.ktx) + + // UI Components + implementation(libs.constraintlayout) + implementation(libs.constraintlayout.compose) + implementation(libs.activity.compose) + + // Jetpack Compose + implementation(libs.compose.material) // Compose Material Design + implementation(libs.compose.animation) // Animations + implementation(libs.compose.ui) // Core UI library + implementation(libs.compose.foundation) // Foundation library + implementation(libs.compose.ui.tooling) // UI tooling for previews + + // Text similarity and JSON handling + implementation(libs.commons.text) + implementation(libs.gson) + + // Color picker and sliders + implementation(libs.color.chooser) // Simple color picker + implementation(libs.compose.colorful.sliders) // Compose colorful sliders + + // Biometric support + implementation(libs.biometric.ktx) + + // ACRA for crash reporting + implementation(libs.acra.core) + implementation(libs.acra.dialog) + implementation(libs.acra.mail) + + // AndroidX Test - Espresso + androidTestImplementation(libs.espresso.core) + androidTestImplementation(libs.espresso.contrib) + implementation(libs.espresso.idling.resource) // Idling resources for Espresso tests + + // Test rules and other testing dependencies + androidTestImplementation(libs.test.runner) + androidTestImplementation(libs.test.rules) + implementation(libs.test.core.ktx) // Test core utilities + + // Jetpack Compose Testing + androidTestImplementation(libs.ui.test.junit4) // For createComposeRule + debugImplementation(libs.ui.test.manifest) // Debug-only dependencies for Compose testing + + // Fragment testing + debugImplementation(libs.fragment.testing) + + // Navigation testing + androidTestImplementation(libs.navigation.testing) } diff --git a/app/src/main/java/com/github/droidworksstudio/mlauncher/data/Constants.kt b/app/src/main/java/com/github/droidworksstudio/mlauncher/data/Constants.kt index a3975136..ee7c517f 100644 --- a/app/src/main/java/com/github/droidworksstudio/mlauncher/data/Constants.kt +++ b/app/src/main/java/com/github/droidworksstudio/mlauncher/data/Constants.kt @@ -36,7 +36,7 @@ object Constants { const val CLOCK_DATE_SIZE_MIN = 20 const val CLOCK_DATE_SIZE_MAX = 150 - const val BATTERY_SIZE_MIN = 20 + const val BATTERY_SIZE_MIN = 10 const val BATTERY_SIZE_MAX = 150 const val TEXT_MARGIN_MIN = 0 diff --git a/app/src/main/java/com/github/droidworksstudio/mlauncher/data/Prefs.kt b/app/src/main/java/com/github/droidworksstudio/mlauncher/data/Prefs.kt index 5182e678..26538d15 100644 --- a/app/src/main/java/com/github/droidworksstudio/mlauncher/data/Prefs.kt +++ b/app/src/main/java/com/github/droidworksstudio/mlauncher/data/Prefs.kt @@ -112,6 +112,7 @@ class Prefs(val context: Context) { editor.putFloat(key, value.toFloat()) } } + is MutableSet<*> -> { val list = value.filterIsInstance().toSet() editor.putStringSet(key, list) @@ -541,9 +542,9 @@ class Prefs(val context: Context) { var batterySize: Int get() { return try { - prefs.getInt(BATTERY_SIZE_TEXT, 18) + prefs.getInt(BATTERY_SIZE_TEXT, 14) } catch (_: Exception) { - 18 + 14 } } set(value) = prefs.edit().putInt(BATTERY_SIZE_TEXT, value).apply() diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml index 7ba5ddfd..c3fcf4fc 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_home.xml @@ -1,73 +1,89 @@ - + + android:layout_height="match_parent" + android:layout_marginTop="50dp" + android:layout_marginBottom="50dp" /> - - - - - - + android:layout_height="match_parent" + android:layout_marginHorizontal="20dp" + android:layout_marginVertical="32dp" + android:orientation="vertical"> - + android:layout_marginTop="16dp" + android:orientation="vertical"> - + android:layout_gravity="end" + android:orientation="horizontal" + tools:visibility="visible"> - + + + + + + - - + android:layout_marginVertical="2dp" + android:orientation="vertical" + tools:visibility="visible"> + + + + + + + + + android:paddingTop="112dp" + android:paddingBottom="80dp" />