Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies, code indent and customise few animations #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .idea/compiler.xml

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

4 changes: 2 additions & 2 deletions .idea/deploymentTargetDropDown.xml

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

3 changes: 1 addition & 2 deletions .idea/gradle.xml

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

5 changes: 5 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

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

6 changes: 6 additions & 0 deletions .idea/kotlinc.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.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
Rotate Two Dots
</td>
</tr>
<table>
</table>



Expand Down
22 changes: 11 additions & 11 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ plugins {
}

android {
compileSdk 31

compileSdk 34
namespace "com.canopas.composeanimations"
defaultConfig {
applicationId "com.canopas.composeanimations"
minSdk 21
targetSdk 31
targetSdk 34
versionCode 1
versionName "1.0"

Expand All @@ -26,11 +26,11 @@ android {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '1.8'
jvmTarget = '17'
}
buildFeatures {
compose true
Expand All @@ -47,15 +47,15 @@ android {

dependencies {

implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.core:core-ktx:1.10.1'
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
implementation 'androidx.activity:activity-compose:1.3.1'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1'
implementation 'androidx.activity:activity-compose:1.7.2'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ fun ProgressAnimation() {
remember { Animatable(0f) },
)

val animationSpec = infiniteRepeatable<Float>(
animation = tween(4000, easing = FastOutLinearInEasing),
repeatMode = RepeatMode.Restart,
)

dots.forEachIndexed { index, animatable ->
LaunchedEffect(animatable) {
delay(index * 100L)
Expand All @@ -64,7 +59,7 @@ fun ProgressAnimation() {

val dys = dots.map { it.value }

val travelDistance = with(LocalDensity.current) { 15.dp.toPx() }
val travelDistance = with(LocalDensity.current) { 30.dp.toPx() }

Row(
modifier = Modifier.fillMaxSize(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package com.canopas.composeanimations.animations

import androidx.compose.animation.core.*
import androidx.compose.animation.core.FastOutSlowInEasing
import androidx.compose.animation.core.animateFloat
import androidx.compose.animation.core.infiniteRepeatable
import androidx.compose.animation.core.rememberInfiniteTransition
import androidx.compose.animation.core.tween
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ fun RotateTwoDotsAnimation() {
)
)
val rotation by infiniteTransition.animateFloat(
initialValue = 360F,
targetValue = 0F,
initialValue = 0F,
targetValue = 360F,
animationSpec = infiniteRepeatable(
animation = tween(1500, easing = FastOutSlowInEasing),
repeatMode = RepeatMode.Reverse
Expand All @@ -78,7 +78,7 @@ fun RotateTwoDotsAnimation() {

})

val x = (center.x + cos(Math.toRadians(rotation.toDouble())) * 140f).toFloat()
val x = (center.x + cos(Math.toRadians(rotation.toDouble())) * 10f).toFloat()
val y = (center.y + sin(Math.toRadians(rotation.toDouble())) * 140f).toFloat()

withTransform({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.canopas.composeanimations.animations

import androidx.compose.animation.core.LinearEasing
import androidx.compose.animation.core.animate
import androidx.compose.animation.core.rememberInfiniteTransition
import androidx.compose.animation.core.tween
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.layout.Box
Expand All @@ -22,7 +21,7 @@ import com.canopas.composeanimations.ui.theme.ThemeColor

@Preview
@Composable
fun previewSquareFillLoaderAnimation() {
fun PreviewSquareFillLoaderAnimation() {
Surface(
modifier = Modifier
.fillMaxSize(),
Expand All @@ -35,8 +34,6 @@ fun previewSquareFillLoaderAnimation() {
@Composable
fun SquareFillLoaderAnimation() {

val infiniteTransition = rememberInfiniteTransition()

var rotation by remember {
mutableStateOf(0f)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ fun ThreeBounceAnimation() {
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.Center
) {
dys.forEachIndexed { index, dy ->
dys.forEachIndexed { _, dy ->

Box(
Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fun TwinCircleAnimation() {

val twinCircleAnimation by infiniteTransition.animateFloat(
initialValue = 1f,
targetValue = 7f,
targetValue = 9f,
animationSpec = infiniteRepeatable(
animation = tween(1500, easing = FastOutSlowInEasing),
repeatMode = RepeatMode.Reverse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import androidx.compose.material.Surface
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Alignment.Companion.Center
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
Expand Down Expand Up @@ -71,7 +70,7 @@ fun WavesAnimation() {
Box(
Modifier
.size(50.dp)
.align(Alignment.Center)
.align(Center)
.graphicsLayer {
scaleX = dy * 4 + 1
scaleY = dy * 4 + 1
Expand All @@ -90,7 +89,7 @@ fun WavesAnimation() {
Box(
Modifier
.size(50.dp)
.align(Alignment.Center)
.align(Center)
.background(color = Color.White, shape = CircleShape)
) {
Icon(
Expand All @@ -99,7 +98,7 @@ fun WavesAnimation() {
tint = Color.Black,
modifier = Modifier
.size(32.dp)
.align(Alignment.Center)
.align(Center)
)
}

Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
buildscript {
ext {
compose_version = '1.0.1'
compose_version = '1.4.3'
}
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.1.1' apply false
id 'com.android.library' version '7.1.1' apply false
id 'org.jetbrains.kotlin.android' version '1.5.21' 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.10' apply false
}

task clean(type: Delete) {
Expand Down
6 changes: 3 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sat Jan 22 20:12:26 IST 2022
#Wed Aug 30 21:05:23 IST 2023
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists