Skip to content
This repository has been archived by the owner on Nov 23, 2024. It is now read-only.

Commit

Permalink
Test Update (#632)
Browse files Browse the repository at this point in the history
* Test Update

* Test Update 2.0

* Test Update 3.0
  • Loading branch information
HeCodes2Much authored Nov 21, 2024
1 parent 0868d8d commit 8a49f4f
Show file tree
Hide file tree
Showing 5 changed files with 247 additions and 120 deletions.
125 changes: 66 additions & 59 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,20 @@ android {
isShrinkResources = false
isDebuggable = true
applicationIdSuffix = ".debug"
proguardFiles (getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
resValue("string", "app_name", "mLauncher Debug")
}

getByName("release") {
isMinifyEnabled = false
isShrinkResources = false
proguardFiles (getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
resValue("string", "app_name", "mLauncher")
}
}
Expand Down Expand Up @@ -81,67 +87,68 @@ 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)
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ class Prefs(val context: Context) {
editor.putFloat(key, value.toFloat())
}
}

is MutableSet<*> -> {
val list = value.filterIsInstance<String>().toSet()
editor.putStringSet(key, list)
Expand Down Expand Up @@ -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()
Expand Down
132 changes: 74 additions & 58 deletions app/src/main/res/layout/fragment_home.xml
Original file line number Diff line number Diff line change
@@ -1,73 +1,89 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/mainLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:animateLayoutChanges="true"
android:orientation="vertical"
tools:context=".ui.HomeFragment">
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/mainLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:animateLayoutChanges="true"
android:orientation="vertical"
tools:context=".ui.HomeFragment">

<FrameLayout
android:id="@+id/touchArea"
android:layout_marginTop="50dp"
android:layout_marginBottom="50dp"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
android:layout_height="match_parent"
android:layout_marginTop="50dp"
android:layout_marginBottom="50dp" />

<!-- Clock and calendar-->
<LinearLayout
android:id="@+id/dateTimeLayout"
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/mainView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="56dp"
android:layout_marginEnd="24dp"
android:orientation="vertical"
tools:visibility="visible">

<TextClock
android:id="@+id/clock"
style="@style/TextDefault"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/time_size"
tools:text="02:34" />

<TextClock
android:id="@+id/date"
style="@style/TextDefault"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingHorizontal="2dp"
android:textSize="@dimen/date_size"
tools:text="Thu, 30 Dec" />
android:layout_height="match_parent"
android:layout_marginHorizontal="20dp"
android:layout_marginVertical="32dp"
android:orientation="vertical">

<LinearLayout
android:id="@+id/batteryLayout"
android:layout_width="wrap_content"
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
tools:visibility="visible">
android:layout_marginTop="16dp"
android:orientation="vertical">

<TextView
android:id="@+id/batteryIcon"
style="@style/TextDefault"
<LinearLayout
android:id="@+id/batteryLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingVertical="2dp"
android:textSize="@dimen/date_size"
android:visibility="gone" />
android:layout_gravity="end"
android:orientation="horizontal"
tools:visibility="visible">

<TextView
android:id="@+id/batteryText"
style="@style/TextDefault"
android:layout_width="wrap_content"
<TextView
android:id="@+id/batteryIcon"
style="@style/TextDefault"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingVertical="2dp"
android:textSize="@dimen/date_size"
android:visibility="gone" />

<TextView
android:id="@+id/batteryText"
style="@style/TextDefault"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingVertical="2dp"
android:textSize="@dimen/date_size" />
</LinearLayout>

<!-- Clock and calendar-->
<LinearLayout
android:id="@+id/dateTimeLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingVertical="2dp"
android:textSize="@dimen/date_size" />
</LinearLayout>
</LinearLayout>
android:layout_marginVertical="2dp"
android:orientation="vertical"
tools:visibility="visible">

<TextClock
android:id="@+id/clock"
style="@style/TextDefault"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/time_size"
tools:text="02:34" />

<TextClock
android:id="@+id/date"
style="@style/TextDefault"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingHorizontal="2dp"
android:textSize="@dimen/date_size"
tools:text="Thu, 30 Dec" />
</LinearLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>


<!-- Home apps-->
<LinearLayout
Expand All @@ -77,8 +93,8 @@
android:gravity="center_vertical"
android:orientation="vertical"
android:paddingHorizontal="20dp"
android:paddingBottom="80dp"
android:paddingTop="112dp" />
android:paddingTop="112dp"
android:paddingBottom="80dp" />

<TextView
android:id="@+id/homeScreenPager"
Expand Down
Loading

0 comments on commit 8a49f4f

Please sign in to comment.