Skip to content

Commit

Permalink
Updated Gradle, dependencies and setup of Compose Bom (#52)
Browse files Browse the repository at this point in the history
* Upgraded gradle and libraries
* setup compose bom
* java ver updated in workflow files and some deprecated code removed
* refactoring
  • Loading branch information
TheAlphaApp authored Aug 4, 2023
1 parent 5d52dab commit 8585f67
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 28 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: set up JDK 11
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
cache: gradle

Expand Down
1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 24 additions & 16 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,15 @@ android {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
coreLibraryDesugaringEnabled true
}
kotlinOptions {
jvmTarget = '1.8'
jvmTarget = '17'
}
buildFeatures {
buildConfig = true
compose true
}
composeOptions {
Expand All @@ -75,30 +76,37 @@ aboutLibraries {

dependencies {

def composeBom = platform('androidx.compose:compose-bom:2023.06.01')
implementation composeBom
androidTestImplementation composeBom

// Android core components.
implementation 'androidx.core:core-ktx:1.10.1'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1'
implementation 'androidx.activity:activity-compose:1.7.2'
implementation "com.google.accompanist:accompanist-systemuicontroller:0.27.0"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.6.1"
// Jetpack compose.
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation "androidx.compose.material3:material3:1.1.0"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.animation:animation:$compose_version"
implementation "androidx.compose.ui:ui"
implementation "androidx.compose.ui:ui-tooling-preview"
implementation "androidx.compose.material3:material3"
implementation "androidx.compose.material:material"
implementation "androidx.compose.animation:animation"
implementation "androidx.lifecycle:lifecycle-viewmodel-compose"
implementation "androidx.compose.runtime:runtime-livedata"
implementation 'androidx.activity:activity-compose'

//accompanist
implementation "com.google.accompanist:accompanist-navigation-animation:0.29.0-alpha"
implementation "androidx.lifecycle:lifecycle-viewmodel-compose:2.6.1"
implementation "androidx.compose.runtime:runtime-livedata:$compose_version"
implementation "com.google.accompanist:accompanist-systemuicontroller:0.28.0"

// Material theme for main activity.
implementation 'com.google.android.material:material:1.9.0'
// Android 12+ splash API.
implementation 'androidx.core:core-splashscreen:1.0.1'
// Room database
implementation "androidx.room:room-ktx:2.5.1"
implementation "androidx.room:room-ktx:2.5.2"
implementation 'androidx.appcompat:appcompat:1.6.1'
kapt "androidx.room:room-compiler:2.5.1"
androidTestImplementation "androidx.room:room-testing:2.5.1"
kapt "androidx.room:room-compiler:2.5.2"
androidTestImplementation "androidx.room:room-testing:2.5.2"
// Room database backup library.
implementation 'de.raphaelebner:roomdatabasebackup:1.0.0-beta12'
// Dagger - Hilt.
Expand All @@ -109,7 +117,7 @@ dependencies {
// DataStore Preferences
implementation("androidx.datastore:datastore-preferences:1.0.0")
// Coil Image loading library.
implementation "io.coil-kt:coil-compose:2.2.2"
implementation "io.coil-kt:coil-compose:2.4.0"
// Material 3 calender / Date picker.
implementation 'com.maxkeppeler.sheets-compose-dialogs:core:1.1.0'
implementation 'com.maxkeppeler.sheets-compose-dialogs:calendar:1.1.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,11 @@ fun SearchAppBar(
onSearchClicked(text)
}
),
colors = TextFieldDefaults.textFieldColors(
containerColor = Color.Transparent,
cursorColor = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.8f)
colors = TextFieldDefaults.colors(
focusedContainerColor = Color.Transparent,
unfocusedContainerColor = Color.Transparent,
disabledContainerColor = Color.Transparent,
cursorColor = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.8f),
))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ fun GoalInfoScreen(goalId: String, navController: NavController) {
containerColor = MaterialTheme.colorScheme.surfaceColorAtElevation(4.dp)
)
)
}, content = {
}) {
Column(
modifier = Modifier
.fillMaxSize()
Expand Down Expand Up @@ -212,7 +212,7 @@ fun GoalInfoScreen(goalId: String, navController: NavController) {
}
}
}
})
}
}


Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
buildscript {
ext {
compose_version = '1.4.3'
hilt_version = '2.44.2'
hilt_version = '2.47'
}
repositories {
google()
Expand All @@ -18,7 +18,7 @@ buildscript {

// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.4.0' apply false
id 'com.android.library' version '7.4.0' apply false
id 'com.android.application' version '8.1.0' apply false
id 'com.android.library' version '8.1.0' apply false
id 'org.jetbrains.kotlin.android' version '1.8.21' apply false
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Jan 23 11:16:57 IST 2023
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

0 comments on commit 8585f67

Please sign in to comment.