diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 9410cce5..b66e519b 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -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 diff --git a/app/src/main/kotlin/com/jeluchu/composer/core/ui/composables/SimpleButton.kt b/app/src/main/kotlin/com/jeluchu/composer/core/ui/composables/SimpleButton.kt index fe0fb1d5..de3a6da3 100644 --- a/app/src/main/kotlin/com/jeluchu/composer/core/ui/composables/SimpleButton.kt +++ b/app/src/main/kotlin/com/jeluchu/composer/core/ui/composables/SimpleButton.kt @@ -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 @@ -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( diff --git a/app/src/main/kotlin/com/jeluchu/composer/core/ui/navigation/NavGraphBuilderExtensions.kt b/app/src/main/kotlin/com/jeluchu/composer/core/ui/navigation/NavGraphBuilderExtensions.kt index e6b6b480..9c9f627a 100644 --- a/app/src/main/kotlin/com/jeluchu/composer/core/ui/navigation/NavGraphBuilderExtensions.kt +++ b/app/src/main/kotlin/com/jeluchu/composer/core/ui/navigation/NavGraphBuilderExtensions.kt @@ -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) { diff --git a/app/src/main/kotlin/com/jeluchu/composer/core/ui/navigation/Navigation.kt b/app/src/main/kotlin/com/jeluchu/composer/core/ui/navigation/Navigation.kt index e31c57e8..32124f7b 100644 --- a/app/src/main/kotlin/com/jeluchu/composer/core/ui/navigation/Navigation.kt +++ b/app/src/main/kotlin/com/jeluchu/composer/core/ui/navigation/Navigation.kt @@ -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 -> diff --git a/app/src/main/kotlin/com/jeluchu/composer/features/dashboard/view/MainActivityView.kt b/app/src/main/kotlin/com/jeluchu/composer/features/dashboard/view/MainActivityView.kt index 86f71123..e5bd879d 100644 --- a/app/src/main/kotlin/com/jeluchu/composer/features/dashboard/view/MainActivityView.kt +++ b/app/src/main/kotlin/com/jeluchu/composer/features/dashboard/view/MainActivityView.kt @@ -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( diff --git a/app/src/main/kotlin/com/jeluchu/composer/features/lists/view/LazyStaticGridView.kt b/app/src/main/kotlin/com/jeluchu/composer/features/lists/view/LazyStaticGridView.kt index 2b9b426f..630b0046 100644 --- a/app/src/main/kotlin/com/jeluchu/composer/features/lists/view/LazyStaticGridView.kt +++ b/app/src/main/kotlin/com/jeluchu/composer/features/lists/view/LazyStaticGridView.kt @@ -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 diff --git a/app/src/main/kotlin/com/jeluchu/composer/features/progress/view/IconProgressbarView.kt b/app/src/main/kotlin/com/jeluchu/composer/features/progress/view/IconProgressbarView.kt index 319add65..9e90815e 100644 --- a/app/src/main/kotlin/com/jeluchu/composer/features/progress/view/IconProgressbarView.kt +++ b/app/src/main/kotlin/com/jeluchu/composer/features/progress/view/IconProgressbarView.kt @@ -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 diff --git a/app/src/main/kotlin/com/jeluchu/composer/features/progress/view/ProgressView.kt b/app/src/main/kotlin/com/jeluchu/composer/features/progress/view/ProgressView.kt index 226b2453..21b91990 100644 --- a/app/src/main/kotlin/com/jeluchu/composer/features/progress/view/ProgressView.kt +++ b/app/src/main/kotlin/com/jeluchu/composer/features/progress/view/ProgressView.kt @@ -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 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 213a31bb..fa1731d4 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -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" } @@ -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" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ffa86dd1..d453590e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -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 diff --git a/jchucomponents-ktx/build.gradle b/jchucomponents-ktx/build.gradle index c468d7f7..77b080bb 100644 --- a/jchucomponents-ktx/build.gradle +++ b/jchucomponents-ktx/build.gradle @@ -15,7 +15,7 @@ android { } buildFeatures.compose = true - composeOptions.kotlinCompilerExtensionVersion = "1.5.3" + composeOptions.kotlinCompilerExtensionVersion = "1.5.8" buildTypes { release { diff --git a/jchucomponents-prefs/build.gradle b/jchucomponents-prefs/build.gradle index d23fe4c0..811661c4 100644 --- a/jchucomponents-prefs/build.gradle +++ b/jchucomponents-prefs/build.gradle @@ -15,7 +15,7 @@ android { } buildFeatures.compose = true - composeOptions.kotlinCompilerExtensionVersion = "1.5.3" + composeOptions.kotlinCompilerExtensionVersion = "1.5.8" buildTypes { release { diff --git a/jchucomponents-ui/build.gradle b/jchucomponents-ui/build.gradle index 32c90761..7b6b382d 100644 --- a/jchucomponents-ui/build.gradle +++ b/jchucomponents-ui/build.gradle @@ -15,7 +15,7 @@ android { } buildFeatures.compose = true - composeOptions.kotlinCompilerExtensionVersion = "1.5.3" + composeOptions.kotlinCompilerExtensionVersion = "1.5.8" buildTypes { release { diff --git a/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/animations/AnimatedVisibility.kt b/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/animations/AnimatedVisibility.kt new file mode 100644 index 00000000..b8757ea3 --- /dev/null +++ b/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/animations/AnimatedVisibility.kt @@ -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)) + } +} \ No newline at end of file diff --git a/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/composables/button/ProgressIndicatorButton.kt b/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/composables/button/ProgressIndicatorButton.kt index d668d1c0..ad41f4fc 100644 --- a/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/composables/button/ProgressIndicatorButton.kt +++ b/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/composables/button/ProgressIndicatorButton.kt @@ -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( diff --git a/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/composables/cards/DebutCard.kt b/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/composables/cards/DebutCard.kt index aae833b3..87f1065b 100644 --- a/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/composables/cards/DebutCard.kt +++ b/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/composables/cards/DebutCard.kt @@ -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 diff --git a/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/composables/cards/ExpandableCard.kt b/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/composables/cards/ExpandableCard.kt index aab992f1..61d15336 100644 --- a/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/composables/cards/ExpandableCard.kt +++ b/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/composables/cards/ExpandableCard.kt @@ -7,71 +7,66 @@ package com.jeluchu.jchucomponents.ui.composables.cards import android.annotation.SuppressLint -import androidx.annotation.StringRes import androidx.compose.animation.* import androidx.compose.animation.core.* import androidx.compose.foundation.background -import androidx.compose.foundation.clickable -import androidx.compose.foundation.interaction.MutableInteractionSource +import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material.Icon -import androidx.compose.material.IconButton import androidx.compose.material.LocalTextStyle import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.runtime.remember +import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.draw.rotate import androidx.compose.ui.graphics.Color -import androidx.compose.ui.res.painterResource import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp +import com.jeluchu.jchucomponents.ktx.compose.toPainter import com.jeluchu.jchucomponents.ui.R +import com.jeluchu.jchucomponents.ui.extensions.modifier.noRippleClickable +import com.jeluchu.jchucomponents.ui.foundation.icon.IconLink +import com.jeluchu.jchucomponents.ui.runtime.remember.rememberMutableStateOf const val ExpandAnimation = 300 const val CollapseAnimation = 300 const val FadeInAnimation = 300 const val FadeOutAnimation = 300 -@ExperimentalAnimationApi @SuppressLint("UnusedTransitionTargetStateParameter") @Composable fun ExpandableCard( modifier: Modifier = Modifier, title: String, - cardBackgroundColor: Color = Color.DarkGray, - tintIcon: Color = Color.White, - textColor: Color = Color.White, + tint: Color = Color.White, + contentColor: Color = Color.White, + containerColor: Color = Color.DarkGray, style: TextStyle = LocalTextStyle.current, showArrow: Boolean = true, content: @Composable () -> Unit, onCardArrowClick: () -> Unit, expanded: Boolean ) { - val transitionState = remember { MutableTransitionState(expanded).apply { targetState = !expanded } } val transition = updateTransition(targetState = transitionState, label = "transition") - val cardBgColor by transition.animateColor({ + val background by transition.animateColor({ tween(durationMillis = ExpandAnimation) }, label = "bgColorTransition") { - if (expanded) cardBackgroundColor else cardBackgroundColor - } - val cardPaddingHorizontal by transition.animateDp({ - tween(durationMillis = ExpandAnimation) - }, label = "paddingTransition") { - 10.dp + if (expanded) containerColor else containerColor } + val cardRoundedCorners by transition.animateDp({ tween( durationMillis = ExpandAnimation, @@ -89,99 +84,72 @@ fun ExpandableCard( Column( modifier = modifier .fillMaxWidth() - .padding( - horizontal = cardPaddingHorizontal, - vertical = 5.dp - ) .clip(RoundedCornerShape(cardRoundedCorners)) - .background(cardBgColor) + .background(background) ) { Row( - modifier = Modifier.fillMaxWidth() + modifier = Modifier.padding(horizontal = 15.dp), + verticalAlignment = Alignment.CenterVertically ) { Column( modifier = Modifier .weight(if (showArrow) 0.85f else 1f) - .clickable( - indication = null, - interactionSource = remember { MutableInteractionSource() }, - onClick = { if (!showArrow) onCardArrowClick() } - ) + .noRippleClickable { if (!showArrow) onCardArrowClick() } ) { Text( text = title, - color = textColor, + color = contentColor, textAlign = TextAlign.Start, - style = style, - modifier = Modifier - .fillMaxWidth() - .padding(12.dp) + style = style ) } if (showArrow) - Column( - modifier = Modifier.weight(0.15f) - ) { - CardArrow( - degrees = arrowRotationDegree, - onClick = onCardArrowClick, - tintIcon = tintIcon - ) - } + IconLink( + tint = tint, + onClick = onCardArrowClick, + contentDescription = "Expandable Arrow", + painter = R.drawable.ic_up_arrow.toPainter(), + modifier = Modifier.rotate(arrowRotationDegree) + ) } - ExpandableContent(content, expanded) - } - -} -@Composable -fun CardArrow( - degrees: Float, - tintIcon: Color, - @StringRes contentDescription: Int? = null, - onClick: () -> Unit -) = IconButton( - onClick = onClick, - content = { - Icon( - painter = painterResource(id = R.drawable.ic_up_arrow), - contentDescription = "Expandable Arrow", - modifier = Modifier.rotate(degrees), - tint = tintIcon - ) + AnimatedVisibility( + modifier = Modifier.animateContentSize(), + visible = expanded, + ) { content() } } -) +} -@ExperimentalAnimationApi +@Preview @Composable -fun ExpandableContent( - content: @Composable () -> Unit, - expanded: Boolean = true -) { +fun ExpandableCardPreview() { + Column( + verticalArrangement = Arrangement.spacedBy(5.dp) + ) { + val isExpanded = rememberMutableStateOf(value = false) - val enterFadeIn = remember { - fadeIn( - animationSpec = TweenSpec( - durationMillis = FadeInAnimation, - easing = FastOutLinearInEasing - ) + ExpandableCard( + title = "Elemento", + content = { + Text("Expanded!") + }, + expanded = false, + onCardArrowClick = {} ) - } - val enterExpand = remember { expandVertically(animationSpec = tween(ExpandAnimation)) } - val exitFadeOut = remember { - fadeOut( - animationSpec = TweenSpec( - durationMillis = FadeOutAnimation, - easing = LinearOutSlowInEasing - ) + + ExpandableCard( + title = "Elemento", + content = { + Text( + modifier = Modifier + .fillMaxWidth() + .padding(15.dp), + text = "Expanded!", + color = Color.Yellow + ) + }, + expanded = isExpanded.value, + onCardArrowClick = { isExpanded.value = !isExpanded.value } ) } - val exitCollapse = remember { shrinkVertically(animationSpec = tween(CollapseAnimation)) } - - AnimatedVisibility( - visible = expanded, - enter = enterExpand + enterFadeIn, - exit = exitCollapse + exitFadeOut - ) { content() } - } \ No newline at end of file diff --git a/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/composables/cards/Te.kt b/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/composables/cards/Te.kt index aa63082a..edcbaf96 100644 --- a/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/composables/cards/Te.kt +++ b/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/composables/cards/Te.kt @@ -1,11 +1,8 @@ package com.jeluchu.jchucomponents.ui.composables.cards -import androidx.compose.foundation.background -import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Row -import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height @@ -26,8 +23,6 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.Immutable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.clip -import androidx.compose.ui.draw.drawBehind import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextAlign diff --git a/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/composables/images/NetworkImage.kt b/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/composables/images/NetworkImage.kt index 10bc23f3..366f058e 100644 --- a/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/composables/images/NetworkImage.kt +++ b/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/composables/images/NetworkImage.kt @@ -11,13 +11,10 @@ import androidx.annotation.DrawableRes import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.DefaultAlpha -import androidx.compose.ui.graphics.painter.Painter import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.platform.LocalContext import coil.compose.AsyncImage -import coil.compose.rememberAsyncImagePainter import coil.request.ImageRequest -import coil.size.Size import coil.transform.Transformation import com.jeluchu.jchucomponents.ktx.compose.toPainter import com.jeluchu.jchucomponents.ui.R diff --git a/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/composables/preferences/PreferenceItemTitle.kt b/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/composables/preferences/PreferenceItemTitle.kt index d081925b..11f2d724 100644 --- a/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/composables/preferences/PreferenceItemTitle.kt +++ b/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/composables/preferences/PreferenceItemTitle.kt @@ -8,7 +8,6 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.style.TextOverflow -import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.TextUnit import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp diff --git a/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/composables/progress/LinearProgressbar.kt b/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/composables/progress/LinearProgressbar.kt index c09998a5..b37a9ad7 100644 --- a/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/composables/progress/LinearProgressbar.kt +++ b/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/composables/progress/LinearProgressbar.kt @@ -46,13 +46,9 @@ import com.jeluchu.jchucomponents.ui.R import com.jeluchu.jchucomponents.ui.extensions.modifier.cornerRadius import com.jeluchu.jchucomponents.ui.foundation.text.AutoSizeText import com.jeluchu.jchucomponents.ui.runtime.remember.rememberMutableStateOf -import com.jeluchu.jchucomponents.ui.themes.artichoke import com.jeluchu.jchucomponents.ui.themes.cosmicLatte import com.jeluchu.jchucomponents.ui.themes.darkGreen -import com.jeluchu.jchucomponents.ui.themes.darkness import com.jeluchu.jchucomponents.ui.themes.milky -import com.jeluchu.jchucomponents.ui.themes.primary -import com.jeluchu.jchucomponents.ui.themes.secondary /** * diff --git a/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/composables/progress/ReadingIndicator.kt b/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/composables/progress/ReadingIndicator.kt index 30803cc3..16f97cbc 100644 --- a/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/composables/progress/ReadingIndicator.kt +++ b/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/composables/progress/ReadingIndicator.kt @@ -8,7 +8,11 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.material.MaterialTheme -import androidx.compose.runtime.* +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.draw.drawBehind import androidx.compose.ui.geometry.Offset diff --git a/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/composables/toolbars/Toolbar.kt b/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/composables/toolbars/Toolbar.kt index 73902867..71fa39fb 100644 --- a/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/composables/toolbars/Toolbar.kt +++ b/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/composables/toolbars/Toolbar.kt @@ -11,7 +11,6 @@ import androidx.compose.foundation.background import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.RowScope import androidx.compose.foundation.layout.fillMaxWidth diff --git a/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/extensions/modifier/ModifierExtensions.kt b/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/extensions/modifier/ModifierExtensions.kt index f2b5b07e..006a657f 100644 --- a/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/extensions/modifier/ModifierExtensions.kt +++ b/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/extensions/modifier/ModifierExtensions.kt @@ -6,8 +6,6 @@ package com.jeluchu.jchucomponents.ui.extensions.modifier -import androidx.compose.foundation.clickable -import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.width @@ -15,9 +13,6 @@ import androidx.compose.foundation.lazy.LazyListState import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue -import androidx.compose.runtime.mutableFloatStateOf -import androidx.compose.runtime.mutableStateOf -import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.composed @@ -31,7 +26,6 @@ import androidx.compose.ui.graphics.toArgb import androidx.compose.ui.input.nestedscroll.NestedScrollConnection import androidx.compose.ui.input.nestedscroll.NestedScrollSource import androidx.compose.ui.input.nestedscroll.nestedScroll -import androidx.compose.ui.semantics.Role import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp import com.jeluchu.jchucomponents.ui.runtime.remember.rememberMutableFloatStateOf diff --git a/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/extensions/time/Time.kt b/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/extensions/time/Time.kt index 9e9982ec..726420a2 100644 --- a/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/extensions/time/Time.kt +++ b/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/extensions/time/Time.kt @@ -11,10 +11,10 @@ import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue import androidx.compose.runtime.setValue import com.jeluchu.jchucomponents.ui.runtime.remember.rememberMutableStateOf +import kotlinx.coroutines.delay import java.math.RoundingMode import java.text.DecimalFormat -import java.util.* -import kotlinx.coroutines.delay +import java.util.Calendar /** * diff --git a/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/foundation/lists/LazyColumns.kt b/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/foundation/lists/LazyColumns.kt index 2f97344a..352f741d 100644 --- a/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/foundation/lists/LazyColumns.kt +++ b/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/foundation/lists/LazyColumns.kt @@ -6,7 +6,13 @@ import androidx.compose.foundation.gestures.FlingBehavior import androidx.compose.foundation.gestures.ScrollableDefaults import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.PaddingValues -import androidx.compose.foundation.lazy.* +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.lazy.LazyItemScope +import androidx.compose.foundation.lazy.LazyListScope +import androidx.compose.foundation.lazy.LazyListState +import androidx.compose.foundation.lazy.items +import androidx.compose.foundation.lazy.itemsIndexed +import androidx.compose.foundation.lazy.rememberLazyListState import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier diff --git a/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/foundation/lists/LazyGrids.kt b/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/foundation/lists/LazyGrids.kt index a5c75638..d0e69777 100644 --- a/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/foundation/lists/LazyGrids.kt +++ b/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/foundation/lists/LazyGrids.kt @@ -15,7 +15,6 @@ import androidx.compose.foundation.layout.RowScope import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.aspectRatio import androidx.compose.foundation.layout.padding -import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.Immutable diff --git a/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/foundation/lists/LazyRows.kt b/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/foundation/lists/LazyRows.kt index c650cfa3..4681af71 100644 --- a/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/foundation/lists/LazyRows.kt +++ b/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/foundation/lists/LazyRows.kt @@ -6,7 +6,13 @@ import androidx.compose.foundation.gestures.FlingBehavior import androidx.compose.foundation.gestures.ScrollableDefaults import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.PaddingValues -import androidx.compose.foundation.lazy.* +import androidx.compose.foundation.lazy.LazyItemScope +import androidx.compose.foundation.lazy.LazyListScope +import androidx.compose.foundation.lazy.LazyListState +import androidx.compose.foundation.lazy.LazyRow +import androidx.compose.foundation.lazy.items +import androidx.compose.foundation.lazy.itemsIndexed +import androidx.compose.foundation.lazy.rememberLazyListState import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier diff --git a/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/runtime/remember/RememberDerivedStateOf.kt b/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/runtime/remember/RememberDerivedStateOf.kt index 13fd4815..6e9218ae 100644 --- a/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/runtime/remember/RememberDerivedStateOf.kt +++ b/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/runtime/remember/RememberDerivedStateOf.kt @@ -8,7 +8,11 @@ package com.jeluchu.jchucomponents.ui.runtime.remember -import androidx.compose.runtime.* +import androidx.compose.runtime.Composable +import androidx.compose.runtime.SnapshotMutationPolicy +import androidx.compose.runtime.State +import androidx.compose.runtime.derivedStateOf +import androidx.compose.runtime.remember import androidx.compose.runtime.snapshots.Snapshot /** diff --git a/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/wrapper/JchImage.kt b/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/wrapper/JchImage.kt index 4d2c24bd..d7b99dd7 100644 --- a/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/wrapper/JchImage.kt +++ b/jchucomponents-ui/src/main/kotlin/com/jeluchu/jchucomponents/ui/wrapper/JchImage.kt @@ -2,14 +2,9 @@ package com.jeluchu.jchucomponents.ui.wrapper import android.graphics.drawable.Drawable import androidx.annotation.DrawableRes -import androidx.compose.runtime.Composable import androidx.compose.runtime.Immutable -import androidx.compose.ui.graphics.asImageBitmap -import androidx.compose.ui.graphics.painter.BitmapPainter import androidx.compose.ui.graphics.painter.Painter import androidx.compose.ui.graphics.vector.ImageVector -import androidx.core.graphics.drawable.toBitmap -import com.jeluchu.jchucomponents.ktx.compose.toPainter @Immutable sealed interface JchImage {