Skip to content

Commit

Permalink
Update Jetpack Compose to 1.6.0 and refactors
Browse files Browse the repository at this point in the history
  • Loading branch information
jeluchu committed Jan 25, 2024
1 parent a9d1fee commit 8b29681
Show file tree
Hide file tree
Showing 30 changed files with 159 additions and 156 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ android {
}

buildFeatures.compose = true
composeOptions.kotlinCompilerExtensionVersion = "1.5.3"
composeOptions.kotlinCompilerExtensionVersion = "1.5.8"
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.jeluchu.composer.core.ui.composables
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
Expand All @@ -13,7 +12,6 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.semantics.Role
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import com.jeluchu.composer.core.ui.theme.milky

@Composable
fun SimpleButton(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@ import com.jeluchu.composer.features.progress.view.IconProgressbarView
import com.jeluchu.composer.features.progress.view.LinearProgressbarView
import com.jeluchu.composer.features.progress.view.ProgressView
import com.jeluchu.composer.features.toolbars.view.ToolbarsView
import com.jeluchu.jchucomponents.ui.composables.progress.IconProgressbarPreview
import com.jeluchu.jchucomponents.ui.composables.progress.LinearProgressbarPreview
import com.jeluchu.jchucomponents.ui.composables.toolbars.CenterToolbarActionsPreview
import com.jeluchu.jchucomponents.ui.composables.toolbars.ToolbarActionsPreview
import com.jeluchu.jchucomponents.ui.foundation.lists.LazyStaticGridPreview

fun NavGraphBuilder.dashboardNav(nav: Destinations) {
composable(Feature.DASHBOARD.nav) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.jeluchu.composer.core.ui.navigation

import androidx.compose.runtime.Composable
import androidx.navigation.compose.NavHost
import com.jeluchu.pay.playstore.SubscriptionsHelper

@Composable
fun Navigation() = ProvideNavHostController { navHost ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import com.jeluchu.composer.core.ui.theme.secondary
import com.jeluchu.jchucomponents.ui.accompanist.systemui.SystemStatusBarColors
import com.jeluchu.jchucomponents.ui.composables.toolbars.CenterToolbarColors
import com.jeluchu.jchucomponents.ui.extensions.modifier.cornerRadius
import com.jeluchu.jchucomponents.ui.foundation.lists.ListRow

@Composable
fun MainView(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import com.jeluchu.composer.core.ui.theme.secondary
import com.jeluchu.composer.core.utils.DestinationsIds
import com.jeluchu.composer.core.utils.Names
import com.jeluchu.jchucomponents.ui.accompanist.systemui.SystemStatusBarColors
import com.jeluchu.jchucomponents.ui.composables.progress.IconProgressbarPreview
import com.jeluchu.jchucomponents.ui.composables.progress.LinearProgressbarPreview
import com.jeluchu.jchucomponents.ui.composables.toolbars.CenterToolbarColors
import com.jeluchu.jchucomponents.ui.foundation.lists.LazyStaticGridPreview

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import com.jeluchu.composer.core.utils.DestinationsIds
import com.jeluchu.composer.core.utils.Names
import com.jeluchu.jchucomponents.ui.accompanist.systemui.SystemStatusBarColors
import com.jeluchu.jchucomponents.ui.composables.progress.IconProgressbarPreview
import com.jeluchu.jchucomponents.ui.composables.progress.LinearProgressbarPreview
import com.jeluchu.jchucomponents.ui.composables.toolbars.CenterToolbarColors

@Composable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package com.jeluchu.composer.features.progress.view

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import com.jeluchu.composer.core.commons.models.MenuOptions
import com.jeluchu.composer.core.ui.composables.ScaffoldStructure
import com.jeluchu.composer.core.ui.composables.SimpleButton
Expand Down
30 changes: 15 additions & 15 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
[versions]
androidx-activity = "1.8.0"
androidx-compose-animation = "1.5.4"
androidx-compose-foundation = "1.5.4"
androidx-compose-material = "1.5.4"
androidx-compose-runtime = "1.5.4"
androidx-compose-ui = "1.5.4"
androidx-lifecycle = "2.6.2"
androidx-navigation = "2.7.4"
androidx-activity = "1.8.2"
androidx-compose-animation = "1.6.0"
androidx-compose-foundation = "1.6.0"
androidx-compose-material = "1.6.0"
androidx-compose-runtime = "1.6.0"
androidx-compose-ui = "1.6.0"
androidx-lifecycle = "2.7.0"
androidx-navigation = "2.7.6"
com-google-accompanist = "0.32.0"
com-squareup-okhttp3 = "4.11.0"
com-squareup-okhttp3 = "4.12.0"
com-squareup-retrofit2 = "2.9.0"
io-coil-kt = "2.4.0"
org-jetbrains-kotlin = "1.9.10"
io-coil-kt = "2.5.0"
org-jetbrains-kotlin = "1.9.22"
org-jetbrains-kotlinx = "1.7.3"
billing-ktx = "6.0.1"

[libraries]
androidx-datastore = "androidx.datastore:datastore-preferences:1.0.0"
androidx-activity-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity" }
androidx-browser = "androidx.browser:browser:1.6.0"
androidx-browser = "androidx.browser:browser:1.7.0"
androidx-compose-animation = { module = "androidx.compose.animation:animation", version.ref = "androidx-compose-animation" }
androidx-compose-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "androidx-compose-foundation" }
androidx-compose-foundation-foundation-layout = { module = "androidx.compose.foundation:foundation-layout", version.ref = "androidx-compose-foundation" }
Expand All @@ -36,11 +36,11 @@ androidx-lifecycle-lifecycle-livedata-core-ktx = { module = "androidx.lifecycle:
androidx-lifecycle-lifecycle-viewmodel-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "androidx-lifecycle" }
androidx-navigation-navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "androidx-navigation" }
androidx-preference = "androidx.preference:preference-ktx:1.2.1"
com-android-tools-build-gradle = "com.android.tools.build:gradle:8.1.2"
com-android-tools-build-gradle = "com.android.tools.build:gradle:8.2.1"
com-google-accompanist-accompanist-systemuicontroller = { module = "com.google.accompanist:accompanist-systemuicontroller", version.ref = "com-google-accompanist" }
com-google-android-gms-play-services-base = "com.google.android.gms:play-services-base:18.2.0"
com-google-android-gms-play-services-base = "com.google.android.gms:play-services-base:18.3.0"
com-google-code-gson = "com.google.code.gson:gson:2.10.1"
com-google-firebase-firebase-analytics-ktx = "com.google.firebase:firebase-analytics-ktx:21.4.0"
com-google-firebase-firebase-analytics-ktx = "com.google.firebase:firebase-analytics-ktx:21.5.0"
com-squareup-okhttp3-logging-interceptor = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "com-squareup-okhttp3" }
com-squareup-okhttp3-okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "com-squareup-okhttp3" }
com-squareup-retrofit2-converter-gson = { module = "com.squareup.retrofit2:converter-gson", version.ref = "com-squareup-retrofit2" }
Expand Down
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 @@
#Fri Aug 11 17:30:14 CEST 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion jchucomponents-ktx/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ android {
}

buildFeatures.compose = true
composeOptions.kotlinCompilerExtensionVersion = "1.5.3"
composeOptions.kotlinCompilerExtensionVersion = "1.5.8"

buildTypes {
release {
Expand Down
2 changes: 1 addition & 1 deletion jchucomponents-prefs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ android {
}

buildFeatures.compose = true
composeOptions.kotlinCompilerExtensionVersion = "1.5.3"
composeOptions.kotlinCompilerExtensionVersion = "1.5.8"

buildTypes {
release {
Expand Down
2 changes: 1 addition & 1 deletion jchucomponents-ui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ android {
}

buildFeatures.compose = true
composeOptions.kotlinCompilerExtensionVersion = "1.5.3"
composeOptions.kotlinCompilerExtensionVersion = "1.5.8"

buildTypes {
release {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package com.jeluchu.jchucomponents.ui.animations

import androidx.compose.animation.EnterTransition
import androidx.compose.animation.ExitTransition
import androidx.compose.animation.core.FastOutLinearInEasing
import androidx.compose.animation.core.LinearOutSlowInEasing
import androidx.compose.animation.core.TweenSpec
import androidx.compose.animation.core.tween
import androidx.compose.animation.expandVertically
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
import androidx.compose.animation.shrinkVertically
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import com.jeluchu.jchucomponents.ui.composables.cards.CollapseAnimation
import com.jeluchu.jchucomponents.ui.composables.cards.ExpandAnimation
import com.jeluchu.jchucomponents.ui.composables.cards.FadeInAnimation
import com.jeluchu.jchucomponents.ui.composables.cards.FadeOutAnimation

val enterFadeIn: @Composable () -> EnterTransition = {
remember {
fadeIn(
animationSpec = TweenSpec(
durationMillis = FadeInAnimation,
easing = FastOutLinearInEasing
)
)
}
}

val enterExpand: @Composable () -> EnterTransition = {
remember {
expandVertically(animationSpec = tween(ExpandAnimation))
}
}

val exitFadeOut: @Composable () -> ExitTransition = {
remember {
fadeOut(
animationSpec = TweenSpec(
durationMillis = FadeOutAnimation,
easing = LinearOutSlowInEasing
)
)
}
}

val exitCollapse: @Composable () -> ExitTransition = {
remember {
shrinkVertically(animationSpec = tween(CollapseAnimation))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ import com.jeluchu.jchucomponents.ui.runtime.remember.rememberMutableStateOf
@Composable
fun ProgressIndicatorButton(
modifier: Modifier = Modifier,
isLoading: Boolean = false,
text: String,
icon: ImageVector,
textSyle: TextStyle = MaterialTheme.typography.bodyLarge,
isLoading: Boolean = false,
fontSize: TextUnit = 16.sp,
textSyle: TextStyle = MaterialTheme.typography.bodyLarge,
colors: ButtonColors = ButtonDefaults.filledTonalButtonColors(),
onClick: () -> Unit,
) = FilledTonalButton(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

package com.jeluchu.jchucomponents.ui.composables.cards

import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
Expand Down
Loading

0 comments on commit 8b29681

Please sign in to comment.