Migrated build files to kotlin. introduced version catalogue. Attempted to fix main activity rotation bug.

This commit is contained in:
michael-bailey 2025-04-14 16:44:42 +01:00
parent 0271e8d03e
commit 3764abfa85
21 changed files with 469 additions and 339 deletions

View File

@ -4,10 +4,10 @@
<selectionStates>
<SelectionState runConfigName="Main Activity">
<option name="selectionMode" value="DROPDOWN" />
<DropdownSelection timestamp="2025-04-12T08:13:17.128509Z">
<DropdownSelection timestamp="2025-04-14T09:57:00.615341Z">
<Target type="DEFAULT_BOOT">
<handle>
<DeviceId pluginId="LocalEmulator" identifier="path=/Users/michaelbailey/.android/avd/Wear_OS.avd" />
<DeviceId pluginId="LocalEmulator" identifier="path=/Users/michaelbailey/.android/avd/Pixel_8_Pro_Android_14.avd" />
</handle>
</Target>
</DropdownSelection>
@ -18,6 +18,14 @@
</SelectionState>
<SelectionState runConfigName="ExerciseListActivity">
<option name="selectionMode" value="DROPDOWN" />
<DropdownSelection timestamp="2025-04-14T09:56:54.455658Z">
<Target type="DEFAULT_BOOT">
<handle>
<DeviceId pluginId="LocalEmulator" identifier="path=/Users/michaelbailey/.android/avd/Pixel_8_Pro_Android_14.avd" />
</handle>
</Target>
</DropdownSelection>
<DialogSelection />
</SelectionState>
</selectionStates>
</component>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KotlinJpsPluginSettings">
<option name="version" value="2.0.21" />
<option name="version" value="2.1.10" />
</component>
</project>

View File

@ -1,20 +0,0 @@
buildscript {
ext {
compose_version = '1.6.3'
room_version = "2.6.1"
nav_version = "2.7.7"
gson_version = "2.9.0"
work_version = "2.9.0"
security_version = "1.0.0"
hilt_version = "2.51.1"
}
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '8.9.1' apply false
id 'com.android.library' version '8.9.1' apply false
id 'org.jetbrains.kotlin.android' version '1.9.22' apply false
id 'com.google.dagger.hilt.android' version '2.51.1' apply false
id 'org.jetbrains.kotlin.plugin.serialization' version '1.9.22' apply false
id 'org.jetbrains.kotlin.plugin.compose' version '2.0.21' apply false
}

8
build.gradle.kts Normal file
View File

@ -0,0 +1,8 @@
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.hilt) apply false
alias(libs.plugins.serialisation) apply false
alias(libs.plugins.compose) apply false
}

92
gradle/libs.versions.toml Normal file
View File

@ -0,0 +1,92 @@
[versions]
android_version = "8.9.1"
composeBomVersion = "2025.04.00"
kotlin_android_version = "1.9.22"
hilt_version = "2.56.1"
crypto_version = "1.0.0"
lifecycleRuntimeKtxVersion = "2.8.7"
materialIconsExtendedVersion = "1.7.8"
material_version = "1.12.0"
serialisation_plugin_version = "2.1.10"
compose_version = "2.0.21"
android_kotlin_core_version = "1.16.0"
android_appcompat_version = "1.7.0"
android_constraint_layout_version = "2.2.1"
datetime_version = "0.6.2"
hiltAndroidVersion = "2.56.1"
hiltNavigationComposeVersion = "1.2.0"
jbcryptVersion = "0.4"
navigation_version = "2.8.9"
room_version = "2.7.0"
json_serialisation_version = "1.8.1"
nav_version = "2.8.9"
gson_version = "2.9.0"
work_version = "2.10.0"
security_version = "1.0.0"
workRuntimeVersion = "2.10.0"
[libraries]
androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "android_appcompat_version" }
androidx-constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "android_constraint_layout_version" }
androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "android_kotlin_core_version" }
android-crypto = { module = "androidx.security:security-crypto", version.ref = "crypto_version" }
livedata-ktx = { module = "androidx.lifecycle:lifecycle-livedata-ktx" }
lifecycle-ktx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "lifecycleRuntimeKtxVersion" }
androidx-livedata = { module = "androidx.compose.runtime:runtime-livedata" }
compose-bom = { module = "androidx.compose:compose-bom", version.ref = "composeBomVersion" }
compose-activity = { module = "androidx.activity:activity-compose" }
compose-ui = { module = "androidx.compose.ui:ui" }
compose-ui-graphics = { module = "androidx.compose.ui:ui-graphics" }
compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" }
datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "datetime_version" }
hilt-android = { module = "com.google.dagger:hilt-android", version.ref = "hiltAndroidVersion" }
hilt-navigation = { module = "androidx.hilt:hilt-navigation-compose", version.ref = "hiltNavigationComposeVersion" }
hilt-compiler = { module = "com.google.dagger:hilt-android-compiler", version.ref = "hiltAndroidVersion" }
jbcrypt = { module = "org.mindrot:jbcrypt", version.ref = "jbcryptVersion" }
material = { module = "com.google.android.material:material", version.ref = "material_version" }
compose-material = { module = "androidx.compose.material:material" }
compose-material3 = { module = "androidx.compose.material3:material3" }
compose-material-icons-extended = { module = "androidx.compose.material:material-icons-extended", version.ref = "materialIconsExtendedVersion" }
navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "navigation_version" }
navigation-runtime = { module = "androidx.navigation:navigation-runtime-ktx", version.ref = "navigation_version" }
room-compiler = { module = "androidx.room:room-compiler", version.ref = "room_version" }
room-ktx = { module = "androidx.room:room-ktx", version.ref = "room_version" }
room-runtime = { module = "androidx.room:room-runtime", version.ref = "room_version" }
serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "json_serialisation_version" }
work-manager = { module = "androidx.work:work-runtime", version.ref = "workRuntimeVersion" }
[bundles]
compose = ["compose-activity", "compose-ui", "compose-ui-graphics", "compose-ui-tooling-preview"]
hilt = ["hilt-android", "hilt-navigation"]
lifecycle = ["lifecycle-ktx", "androidx-livedata", "livedata-ktx"]
material-design = ["material", "compose-material", "compose-material3", "compose-material-icons-extended"]
navigation = ["navigation-compose", "navigation-runtime"]
room = ["room-runtime", "room-ktx"]
[plugins]
android-application = { id = "com.android.application", version.ref = "android_version" }
android-library = { id = "com.android.library", version.ref = "android_version" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin_android_version" }
hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt_version" }
serialisation = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "serialisation_plugin_version" }
compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "compose_version" }

View File

@ -1,59 +0,0 @@
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
id 'kotlin-kapt'
id 'com.google.dagger.hilt.android'
id 'org.jetbrains.kotlin.plugin.serialization'
id 'org.jetbrains.kotlin.plugin.compose'
}
android {
namespace 'org.british_information_technologies.gym_library'
compileSdk 35
defaultConfig {
minSdk 33
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = '11'
}
}
dependencies {
implementation 'androidx.core:core-ktx:1.16.0'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'com.google.android.material:material:1.12.0'
// room database deps
implementation "androidx.room:room-runtime:$room_version"
implementation "androidx.room:room-ktx:$room_version"
kapt "androidx.room:room-compiler:$room_version"
// hilt deps
implementation "com.google.dagger:hilt-android:$hilt_version"
kapt "com.google.dagger:hilt-android-compiler:$hilt_version"
implementation 'androidx.hilt:hilt-navigation-compose:1.2.0'
// serialisation
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.2'
implementation "org.jetbrains.kotlinx:kotlinx-datetime:0.3.2"
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
}

View File

@ -0,0 +1,72 @@
plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
id("kotlin-kapt")
id("com.google.dagger.hilt.android")
id("org.jetbrains.kotlin.plugin.serialization")
id("org.jetbrains.kotlin.plugin.compose")
}
android {
namespace = "org.british_information_technologies.gym_library"
compileSdk = 35
defaultConfig {
minSdk = 33
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}
buildTypes {
release {
isMinifyEnabled = false
setProguardFiles(
listOf(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = "11"
}
}
dependencies {
val compose_version = "1.7.8"
val room_version = "2.7.0"
val nav_version = "2.8.9"
val gson_version = "2.9.0"
val work_version = "2.10.0"
val security_version = "1.0.0"
val hilt_version = "2.56.1"
implementation("androidx.core:core-ktx:1.16.0")
implementation("androidx.appcompat:appcompat:1.7.0")
implementation("com.google.android.material:material:1.12.0")
// room database deps
implementation("androidx.room:room-runtime:$room_version")
implementation("androidx.room:room-ktx:$room_version")
kapt("androidx.room:room-compiler:$room_version")
// hilt deps
implementation("com.google.dagger:hilt-android:$hilt_version")
kapt("com.google.dagger:hilt-android-compiler:$hilt_version")
implementation("androidx.hilt:hilt-navigation-compose:1.2.0")
// serialisation
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.8.1")
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.6.2")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.2.1")
androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")
}

View File

@ -1,6 +1,6 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
# proguardFiles setting in build.gradle.kts.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

View File

@ -1,128 +0,0 @@
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'kotlin-kapt'
id 'com.google.dagger.hilt.android'
id 'org.jetbrains.kotlin.plugin.serialization'
id 'org.jetbrains.kotlin.plugin.compose'
}
kapt {
correctErrorTypes true
}
android {
namespace 'org.british_information_technologies.gym_log_book'
compileSdk 35
defaultConfig {
applicationId "org.british_information_technologies.gym_log_book"
minSdk 33
targetSdk 35
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary true
}
kapt {
arguments {
arg("room.schemaLocation", "$projectDir/schemas")
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '17'
}
buildFeatures {
viewBinding true
compose true
}
composeOptions {
kotlinCompilerExtensionVersion '1.5.10'
}
packagingOptions {
resources {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
}
}
}
dependencies {
implementation(project(":gym_library"))
// reflection
implementation "org.jetbrains.kotlin:kotlin-reflect:1.9.22"
// android deps
implementation 'androidx.core:core-ktx:1.13.1'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
implementation "androidx.navigation:navigation-ui-ktx:$nav_version"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.2'
implementation "androidx.lifecycle:lifecycle-livedata-ktx"
// material ui deps
implementation 'com.google.android.material:material:1.12.0'
// compose deps
implementation platform('androidx.compose:compose-bom:2024.06.00')
implementation "androidx.compose.ui:ui"
implementation "androidx.compose.ui:ui-tooling-preview"
implementation 'androidx.compose.material3:material3'
implementation "androidx.compose.runtime:runtime-livedata"
implementation 'androidx.activity:activity-compose'
implementation 'androidx.compose.material:material'
implementation 'androidx.compose.ui:ui-graphics'
implementation "androidx.compose.material:material-icons-extended:$compose_version"
// compose navigation
implementation "androidx.navigation:navigation-compose:$nav_version"
implementation "androidx.navigation:navigation-runtime-ktx:$nav_version"
// room database deps
implementation "androidx.room:room-runtime:$room_version"
implementation "androidx.room:room-ktx:$room_version"
kapt "androidx.room:room-compiler:$room_version"
// work manager deps
implementation "androidx.work:work-runtime:$work_version"
// hilt deps
implementation "com.google.dagger:hilt-android:$hilt_version"
kapt "com.google.dagger:hilt-android-compiler:$hilt_version"
implementation 'androidx.hilt:hilt-navigation-compose:1.2.0'
// security deps
implementation "androidx.security:security-crypto:$security_version"
// serialisation
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.2'
implementation "org.jetbrains.kotlinx:kotlinx-datetime:0.3.2"
// bcrypt deps
implementation 'org.mindrot:jbcrypt:0.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.0'
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
testImplementation "org.mockito:mockito-core:5.10.0"
}

View File

@ -0,0 +1,138 @@
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.hilt)
alias(libs.plugins.serialisation)
alias(libs.plugins.compose)
id("kotlin-kapt")
}
kapt {
correctErrorTypes = true
}
android {
namespace = "org.british_information_technologies.gym_log_book"
compileSdk = 35
defaultConfig {
applicationId = "org.british_information_technologies.gym_log_book"
minSdk = 33
targetSdk = 35
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary = true
}
kapt {
arguments {
arg("room.schemaLocation", "$projectDir/schemas")
}
}
}
buildTypes {
release {
isMinifyEnabled = false
setProguardFiles(
listOf(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
buildFeatures {
viewBinding = true
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.10"
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
}
dependencies {
val compose_version = "1.7.8"
val room_version = "2.7.0"
val nav_version = "2.8.9"
val gson_version = "2.9.0"
val work_version = "2.10.0"
val security_version = "1.0.0"
val hilt_version = "2.56.1"
implementation(project(":gym_library"))
// reflection
implementation(kotlin("reflect", version = "2.1.20"))
// android deps
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.appcompat)
implementation(libs.androidx.constraintlayout)
implementation("androidx.navigation:navigation-fragment-ktx:$nav_version")
implementation("androidx.navigation:navigation-ui-ktx:$nav_version")
// compose deps
implementation(platform(libs.compose.bom))
implementation(libs.bundles.compose)
debugImplementation(libs.compose.ui.tooling.preview)
// material deps
implementation(libs.compose.material)
// lifecycle deps
implementation(libs.bundles.lifecycle)
// material design
implementation(libs.material)
implementation(libs.bundles.material.design)
// compose navigation
implementation(libs.bundles.navigation)
// room database deps
implementation(libs.bundles.room)
kapt(libs.room.compiler)
// work manager deps
implementation(libs.work.manager)
// hilt deps
implementation(libs.bundles.hilt)
kapt(libs.hilt.compiler)
// security deps
implementation(libs.android.crypto)
// serialisation
implementation(libs.serialization.json)
implementation(libs.datetime)
// bcrypt deps
implementation(libs.jbcrypt)
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.2.1")
androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")
androidTestImplementation("androidx.compose.ui:ui-test-junit4:$compose_version")
debugImplementation("androidx.compose.ui:ui-tooling:$compose_version")
debugImplementation("androidx.compose.ui:ui-test-manifest:$compose_version")
testImplementation("org.mockito:mockito-core:5.17.0")
}

View File

@ -1,6 +1,6 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
# proguardFiles setting in build.gradle.kts.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

View File

@ -23,9 +23,11 @@
android:name=".activity.main_activity.MainActivity"
android:exported="true"
android:label="@string/main_activity_title"
android:launchMode="singleInstancePerTask"
android:launchMode="standard"
android:resizeableActivity="true"
android:enableOnBackInvokedCallback="true"
android:theme="@style/Theme.Gym_Log_Book">
android:theme="@style/Theme.Gym_Log_Book"
tools:ignore="LockedOrientationActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
@ -55,6 +57,7 @@
android:label="@string/title_activity_exercise_set_guide"
android:launchMode="singleInstance"
android:resizeableActivity="true"
android:enableOnBackInvokedCallback="true"
android:theme="@style/Theme.Gym_Log_Book"
tools:ignore="LockedOrientationActivity">
<intent-filter>

View File

@ -4,6 +4,10 @@ import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.viewModels
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.ui.Modifier
import androidx.navigation.NavController
import androidx.navigation.NavGraph.Companion.findStartDestination
import dagger.hilt.android.AndroidEntryPoint
@ -30,7 +34,12 @@ class ExerciseSetGuideActivity : ComponentActivity() {
setContent {
Gym_Log_BookTheme(colourNavBar = false) {
Main()
Surface(
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colorScheme.background
) {
Main()
}
}
}
}

View File

@ -15,7 +15,6 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.livedata.observeAsState
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.hilt.navigation.compose.hiltViewModel
@ -52,7 +51,7 @@ fun HomeTabView(
Row(horizontalArrangement = Arrangement.spacedBy(16.dp)) {
Card(modifier = Modifier.weight(1f)) {
Column(modifier = Modifier.padding(16.dp)) {
for (exercise in lastSessionsExercises!!) {
for (exercise in lastSessionsExercises ?: listOf()) {
Text(text = exercise)
}
}
@ -63,10 +62,3 @@ fun HomeTabView(
}
}
}
@Preview
@Composable
fun preview() {
HomeTabView(
)
}

View File

@ -19,11 +19,12 @@ class HomeTabViewModel @Inject constructor(
) : ViewModel() {
val lastGymVisit = exerciseRepository.exercises.map {
it.first()
it.firstOrNull()
}.map {
Period.between(it.createdDate, LocalDate.now())
it?.let { Period.between(it.createdDate, LocalDate.now()) }
}.map {
when {
it == null -> "None"
it.years > 0 -> "${it.years} Years ago"
it.months > 0 -> "${it.months} Months ago"
it.days > 7 -> "${it.days / 7} Weeks ago"

View File

@ -3,6 +3,7 @@ package org.british_information_technologies.gym_log_book.activity.onboarding_ac
import androidx.annotation.StringRes
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Star
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.vector.ImageVector
import io.github.michael_bailey.android_chat_kit.utils.page.PageNavigation
import org.british_information_technologies.gym_log_book.R
@ -21,7 +22,7 @@ sealed class OnboardingActivityPage(
label = R.string.onboarding_start_page,
icon = Icons.Outlined.Star
) {
override val pageFunction: (OnboardingActivityViewModel) -> Unit
get() = TODO("Not yet implemented")
override val pageFunction: @Composable (OnboardingActivityViewModel) -> Unit
get() = { TODO("Not yet implemented") }
}
}

View File

@ -1,14 +1,14 @@
<resources>
<!-- Base application theme. -->
<style name="Theme.Gym_Log_Book" parent="Theme.Material3.DynamicColors.DayNight">
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowBackground">?android:colorBackground</item>
<item name="android:backgroundDimEnabled">true</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="Theme.Gym_Log_Book.Dialogue" parent="Theme.Material3.DynamicColors.DayNight">
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowBackground">?android:colorBackground</item>
<item name="android:backgroundDimEnabled">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="windowActionBar">false</item>

View File

@ -1,107 +0,0 @@
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'kotlin-kapt'
id 'com.google.dagger.hilt.android'
id 'org.jetbrains.kotlin.plugin.serialization'
id 'org.jetbrains.kotlin.plugin.compose'
}
kapt {
correctErrorTypes true
}
android {
namespace 'com.example.myapplication'
compileSdk 35
defaultConfig {
applicationId "com.example.myapplication"
minSdk 33
targetSdk 34
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = '11'
}
buildFeatures {
compose true
}
}
dependencies {
implementation(project(":gym_library"))
// android deps
implementation 'androidx.core:core-ktx:1.16.0'
implementation 'androidx.core:core-splashscreen:1.0.1'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.7'
implementation "androidx.lifecycle:lifecycle-livedata-ktx"
// google play deps
implementation 'com.google.android.gms:play-services-wearable:19.0.0'
// compose deps
implementation platform('androidx.compose:compose-bom:2025.04.00')
implementation "androidx.compose.ui:ui"
implementation 'androidx.compose.ui:ui-graphics'
implementation 'androidx.compose.ui:ui-tooling-preview'
implementation 'androidx.wear.compose:compose-material:1.4.1'
implementation 'androidx.wear.compose:compose-foundation:1.4.1'
implementation "androidx.compose.ui:ui-tooling-preview"
implementation 'androidx.compose.material3:material3'
implementation "androidx.compose.runtime:runtime-livedata"
implementation 'androidx.activity:activity-compose:1.10.1'
implementation "androidx.compose.material:material-icons-extended:$compose_version"
// tile deps
implementation 'androidx.wear.tiles:tiles:1.4.1'
implementation 'androidx.wear.tiles:tiles-material:1.4.1'
implementation 'androidx.wear.tiles:tiles-tooling-preview:1.4.1'
// horologist deps
implementation 'com.google.android.horologist:horologist-compose-tools:0.6.17'
implementation 'com.google.android.horologist:horologist-tiles:0.6.17'
implementation 'androidx.wear.watchface:watchface-complications-data-source-ktx:1.2.1'
// compose navigation
implementation "androidx.navigation:navigation-compose:$nav_version"
implementation "androidx.navigation:navigation-runtime-ktx:$nav_version"
// room database deps
implementation "androidx.room:room-runtime:$room_version"
implementation "androidx.room:room-ktx:$room_version"
kapt "androidx.room:room-compiler:$room_version"
// hilt deps
implementation "com.google.dagger:hilt-android:$hilt_version"
kapt "com.google.dagger:hilt-android-compiler:$hilt_version"
implementation 'androidx.hilt:hilt-navigation-compose:1.2.0'
// debug deps
implementation 'androidx.wear:wear-tooling-preview:1.0.0'
debugImplementation 'androidx.compose.ui:ui-tooling'
debugImplementation 'androidx.compose.ui:ui-test-manifest'
debugImplementation 'androidx.wear.tiles:tiles-tooling:1.4.1'
// test deps
androidTestImplementation platform('androidx.compose:compose-bom:2025.04.00')
androidTestImplementation 'androidx.compose.ui:ui-test-junit4'
}

View File

@ -0,0 +1,120 @@
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("kotlin-kapt")
id("com.google.dagger.hilt.android")
id("org.jetbrains.kotlin.plugin.serialization")
id("org.jetbrains.kotlin.plugin.compose")
}
kapt {
correctErrorTypes = true
}
android {
namespace = "com.example.myapplication"
compileSdk = 35
defaultConfig {
applicationId = "com.example.myapplication"
minSdk = 33
targetSdk = 34
versionCode = 1
versionName = "1.0"
}
buildTypes {
release {
isMinifyEnabled = false
setProguardFiles(
listOf(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = "11"
}
buildFeatures {
compose = true
}
}
dependencies {
val compose_version = "1.7.8"
val room_version = "2.7.0"
val nav_version = "2.8.9"
val gson_version = "2.9.0"
val work_version = "2.10.0"
val security_version = "1.0.0"
val hilt_version = "2.56.1"
implementation(project(":gym_library"))
// android deps
implementation("androidx.core:core-ktx:1.16.0")
implementation("androidx.core:core-splashscreen:1.0.1")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.7")
implementation("androidx.lifecycle:lifecycle-livedata-ktx")
// google play deps
implementation("com.google.android.gms:play-services-wearable:19.0.0")
// compose deps
implementation(platform("androidx.compose:compose-bom:2025.04.00"))
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.ui:ui-graphics")
implementation("androidx.compose.ui:ui-tooling-preview")
implementation("androidx.wear.compose:compose-material:1.4.1")
implementation("androidx.wear.compose:compose-foundation:1.4.1")
implementation("androidx.compose.ui:ui-tooling-preview")
implementation("androidx.compose.material3:material3")
implementation("androidx.compose.runtime:runtime-livedata")
implementation("androidx.activity:activity-compose:1.10.1")
implementation("androidx.compose.material:material-icons-extended:$compose_version")
// tile deps
implementation("androidx.wear.tiles:tiles:1.4.1")
implementation("androidx.wear.tiles:tiles-material:1.4.1")
implementation("androidx.wear.tiles:tiles-tooling-preview:1.4.1")
// horologist deps
implementation("com.google.android.horologist:horologist-compose-tools:0.6.23")
implementation("com.google.android.horologist:horologist-tiles:0.6.23")
implementation("androidx.wear.watchface:watchface-complications-data-source-ktx:1.2.1")
// compose navigation
implementation("androidx.navigation:navigation-compose:$nav_version")
implementation("androidx.navigation:navigation-runtime-ktx:$nav_version")
// room database deps
implementation("androidx.room:room-runtime:$room_version")
implementation("androidx.room:room-ktx:$room_version")
kapt("androidx.room:room-compiler:$room_version")
// hilt deps
implementation("com.google.dagger:hilt-android:$hilt_version")
kapt("com.google.dagger:hilt-android-compiler:$hilt_version")
implementation("androidx.hilt:hilt-navigation-compose:1.2.0")
// debug deps
implementation("androidx.wear:wear-tooling-preview:1.0.0")
debugImplementation("androidx.compose.ui:ui-tooling")
debugImplementation("androidx.compose.ui:ui-test-manifest")
debugImplementation("androidx.wear.tiles:tiles-tooling:1.4.1")
// test deps
androidTestImplementation(platform("androidx.compose:compose-bom:2025.04.00"))
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
}

View File

@ -1,6 +1,6 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
# proguardFiles setting in build.gradle.kts.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

View File

@ -15,7 +15,7 @@ import org.british_information_technologies.gym_watch_app.database.entities.Test
],
views = [
],
version = 0,
version = 1,
exportSchema = true,
autoMigrations = []
)