├── .gitignore
├── LICENSE.md
├── README.md
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
├── shoeapp
│ ├── .gitignore
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ ├── androidTest
│ │ └── java
│ │ │ └── com
│ │ │ └── vikas
│ │ │ └── shoeapp
│ │ │ └── ExampleInstrumentedTest.kt
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── vikas
│ │ │ │ └── shoeapp
│ │ │ │ ├── MainActivity.kt
│ │ │ │ ├── data
│ │ │ │ ├── CarouselDataModel.kt
│ │ │ │ └── TrendingProduct.kt
│ │ │ │ ├── ui
│ │ │ │ ├── cart
│ │ │ │ │ └── CartActivity.kt
│ │ │ │ ├── home
│ │ │ │ │ ├── BottomNav.kt
│ │ │ │ │ ├── DetailComponent.kt
│ │ │ │ │ ├── HomeComponent.kt
│ │ │ │ │ └── MainViewModel.kt
│ │ │ │ └── theme
│ │ │ │ │ ├── Color.kt
│ │ │ │ │ ├── Shape.kt
│ │ │ │ │ ├── Theme.kt
│ │ │ │ │ └── Type.kt
│ │ │ │ └── util
│ │ │ │ └── Utils.kt
│ │ └── res
│ │ │ ├── drawable-v24
│ │ │ └── ic_launcher_foreground.xml
│ │ │ ├── drawable
│ │ │ ├── adidas_1032.png
│ │ │ ├── adidas_104.png
│ │ │ ├── adidas_s100.png
│ │ │ ├── armour_phantom.png
│ │ │ ├── baseline_circle_24.xml
│ │ │ ├── ic_add.xml
│ │ │ ├── ic_heart.xml
│ │ │ ├── ic_home.xml
│ │ │ ├── ic_launcher_background.xml
│ │ │ ├── ic_launcher_foreground.xml
│ │ │ ├── ic_notification.xml
│ │ │ ├── ic_profile.xml
│ │ │ ├── ic_remove.xml
│ │ │ ├── ic_ribbon.xml
│ │ │ ├── ic_right_arrow.xml
│ │ │ ├── ic_search.xml
│ │ │ ├── ic_settings.xml
│ │ │ ├── ic_shop.xml
│ │ │ ├── nike_100.png
│ │ │ ├── reebok_102.png
│ │ │ ├── roaster_100.png
│ │ │ ├── shoe_101.png
│ │ │ ├── under_103.png
│ │ │ ├── under_1031.png
│ │ │ └── under_armour_105.png
│ │ │ ├── mipmap-anydpi-v26
│ │ │ ├── ic_launcher.xml
│ │ │ └── ic_launcher_round.xml
│ │ │ ├── mipmap-anydpi-v33
│ │ │ └── ic_launcher.xml
│ │ │ ├── mipmap-hdpi
│ │ │ ├── ic_launcher.webp
│ │ │ └── ic_launcher_round.webp
│ │ │ ├── mipmap-mdpi
│ │ │ ├── ic_launcher.webp
│ │ │ └── ic_launcher_round.webp
│ │ │ ├── mipmap-xhdpi
│ │ │ ├── ic_launcher.webp
│ │ │ └── ic_launcher_round.webp
│ │ │ ├── mipmap-xxhdpi
│ │ │ ├── ic_launcher.webp
│ │ │ └── ic_launcher_round.webp
│ │ │ ├── mipmap-xxxhdpi
│ │ │ ├── ic_launcher.webp
│ │ │ └── ic_launcher_round.webp
│ │ │ └── values
│ │ │ ├── colors.xml
│ │ │ ├── strings.xml
│ │ │ └── themes.xml
│ │ └── test
│ │ └── java
│ │ └── com
│ │ └── vikas
│ │ └── shoeapp
│ │ └── ExampleUnitTest.kt
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── vikas
│ │ └── composeapp
│ │ └── ExampleInstrumentedTest.kt
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── vikas
│ │ │ └── composeapp
│ │ │ ├── MainActivity.kt
│ │ │ ├── ui
│ │ │ ├── cart
│ │ │ │ └── CartComponent.kt
│ │ │ ├── dashboard
│ │ │ │ ├── DashboardComponent.kt
│ │ │ │ └── DashboardOptions.kt
│ │ │ ├── favorite
│ │ │ │ └── FavoriteComponent.kt
│ │ │ ├── home
│ │ │ │ ├── HomeComponent.kt
│ │ │ │ └── HomeMenu.kt
│ │ │ ├── notifications
│ │ │ │ └── NotificationsComponent.kt
│ │ │ ├── profile
│ │ │ │ └── ProfileComponent.kt
│ │ │ ├── settings
│ │ │ │ └── SettingsComponent.kt
│ │ │ └── theme
│ │ │ │ ├── Color.kt
│ │ │ │ ├── Theme.kt
│ │ │ │ └── Type.kt
│ │ │ └── util
│ │ │ └── Util.kt
│ └── res
│ │ ├── drawable-nodpi
│ │ ├── pizza_background.jpg
│ │ ├── profile_image.jpg
│ │ ├── shoe_background.jpg
│ │ └── upcoming_background.jpg
│ │ ├── drawable-v24
│ │ └── ic_launcher_foreground.xml
│ │ ├── drawable
│ │ ├── ic_close.xml
│ │ ├── ic_launcher_background.xml
│ │ └── ic_menu.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-anydpi-v33
│ │ └── ic_launcher.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.webp
│ │ └── ic_launcher_round.webp
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.webp
│ │ └── ic_launcher_round.webp
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.webp
│ │ └── ic_launcher_round.webp
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.webp
│ │ └── ic_launcher_round.webp
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.webp
│ │ └── ic_launcher_round.webp
│ │ ├── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── themes.xml
│ │ └── xml
│ │ ├── backup_rules.xml
│ │ └── data_extraction_rules.xml
│ └── test
│ └── java
│ └── com
│ └── vikas
│ └── composeapp
│ └── ExampleUnitTest.kt
├── build.gradle
├── foodorder
├── .gitignore
├── build.gradle
├── consumer-rules.pro
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── vikas
│ │ └── pizzaorder
│ │ └── ExampleInstrumentedTest.kt
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── vikas
│ │ │ └── foodorder
│ │ │ ├── AddToCartComponent.kt
│ │ │ ├── FoodAppMainActivity.kt
│ │ │ ├── PizzaDataModel.kt
│ │ │ ├── ProductCarouselItem.kt
│ │ │ ├── ProductDetailsComponent.kt
│ │ │ ├── ProductState.kt
│ │ │ ├── SampleComponent.kt
│ │ │ ├── Util.kt
│ │ │ └── theme
│ │ │ ├── Color.kt
│ │ │ ├── Shape.kt
│ │ │ ├── Theme.kt
│ │ │ └── Type.kt
│ └── res
│ │ ├── drawable-nodpi
│ │ ├── bowl_fruits.webp
│ │ ├── bowl_veggies_1.webp
│ │ ├── bowl_veggies_2.webp
│ │ ├── bowl_veggies_3.webp
│ │ ├── bowl_veggies_4.webp
│ │ ├── bowl_veggies_5.webp
│ │ ├── ic_verified.xml
│ │ └── veggie_101.jpg
│ │ ├── drawable
│ │ ├── ic_back.xml
│ │ └── ic_cart.xml
│ │ └── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── themes.xml
│ └── test
│ └── java
│ └── com
│ └── vikas
│ └── pizzaorder
│ └── ExampleUnitTest.kt
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── local.properties
├── screenshots
├── screenshot_101.png
├── screenshot_102.png
├── screenshot_103.png
├── screenshot_104.png
├── screenshot_105.png
├── screenshot_106.png
├── screenshot_107.png
├── screenshot_108.png
├── screenshot_109.gif
├── screenshot_110.gif
├── screenshot_111.png
├── screenshot_112.png
└── screenshot_113.gif
├── settings.gradle
└── shoeapp
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
├── androidTest
└── java
│ └── com
│ └── vikas
│ └── shoeapp
│ └── ExampleInstrumentedTest.kt
├── main
├── AndroidManifest.xml
├── java
│ └── com
│ │ └── vikas
│ │ └── shoeapp
│ │ ├── MainActivity.kt
│ │ ├── data
│ │ ├── CarouselDataModel.kt
│ │ └── TrendingProduct.kt
│ │ ├── ui
│ │ ├── cart
│ │ │ └── CartActivity.kt
│ │ ├── home
│ │ │ ├── BottomNav.kt
│ │ │ ├── DetailComponent.kt
│ │ │ ├── HomeComponent.kt
│ │ │ └── MainViewModel.kt
│ │ └── theme
│ │ │ ├── Color.kt
│ │ │ ├── Shape.kt
│ │ │ ├── Theme.kt
│ │ │ └── Type.kt
│ │ └── util
│ │ └── Utils.kt
└── res
│ ├── drawable-v24
│ └── ic_launcher_foreground.xml
│ ├── drawable
│ ├── adidas_1032.png
│ ├── adidas_104.png
│ ├── adidas_s100.png
│ ├── armour_phantom.png
│ ├── baseline_circle_24.xml
│ ├── ic_add.xml
│ ├── ic_heart.xml
│ ├── ic_home.xml
│ ├── ic_launcher_background.xml
│ ├── ic_launcher_foreground.xml
│ ├── ic_logout.xml
│ ├── ic_notification.xml
│ ├── ic_profile.xml
│ ├── ic_remove.xml
│ ├── ic_ribbon.xml
│ ├── ic_right_arrow.xml
│ ├── ic_search.xml
│ ├── ic_settings.xml
│ ├── ic_shop.xml
│ ├── nike_100.png
│ ├── reebok_102.png
│ ├── roaster_100.png
│ ├── shoe_101.png
│ ├── under_103.png
│ ├── under_1031.png
│ └── under_armour_105.png
│ ├── mipmap-anydpi-v26
│ ├── ic_launcher.xml
│ └── ic_launcher_round.xml
│ ├── mipmap-anydpi-v33
│ └── ic_launcher.xml
│ ├── mipmap-hdpi
│ ├── ic_launcher.webp
│ └── ic_launcher_round.webp
│ ├── mipmap-mdpi
│ ├── ic_launcher.webp
│ └── ic_launcher_round.webp
│ ├── mipmap-xhdpi
│ ├── ic_launcher.webp
│ └── ic_launcher_round.webp
│ ├── mipmap-xxhdpi
│ ├── ic_launcher.webp
│ └── ic_launcher_round.webp
│ ├── mipmap-xxxhdpi
│ ├── ic_launcher.webp
│ └── ic_launcher_round.webp
│ └── values
│ ├── colors.xml
│ ├── strings.xml
│ └── themes.xml
└── test
└── java
└── com
└── vikas
└── shoeapp
└── ExampleUnitTest.kt
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 | .cxx
15 | local.properties
16 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 vikas kumar
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Jetpack Compose Animation UI
2 |
3 | Hey All, this project is all about Jetpack Compose Animation and creating visually rich UI.
4 | In one of the first we have created a simple Shoe app with three screens and added different UI interactions using compose animation API's.
5 | Will be adding more in future with difference use cases.
6 |
7 | ## Screenshots:
8 | | Screenshot 1 | Screenshot 2| Animation |
9 | | --- | --- | --- |
10 | |
|
|
|
11 | |
|
|
|
12 | |
|
|
|
13 |
14 | ## Youtube Videos of Animations
15 | [](https://www.youtube.com/watch?v=yAdcbmfoa0c&list=PLLEubLrX7WKQsBBj77OHLZU32lVN0ggf_&ab_channel=vikaskumar "Jetpack Compose Animation")
16 |
17 |
18 | ## Prerequisites
19 |
20 | - Android Studio Electric Eel or higher
21 | - Android SDK 24 or higher
22 | - AndroidX
23 |
24 | ## Getting Started
25 |
26 | These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
27 |
28 | 1. Clone the repository
29 | 2. Open the project in Android Studio
30 | 3. Sync the project with Gradle
31 | 4. Run the app on an emulator or device
32 |
33 | ## Built With
34 |
35 | - [Jetpack Compose](https://developer.android.com/jetpack/compose) - A modern toolkit for building native Android UI
36 | - [Kotlin](https://kotlinlang.org/) - A concise, expressive, and powerful programming language
37 |
38 | ## Contributing
39 |
40 | Please read [CONTRIBUTING.md](https://gist.github.com/PurpleBooth/b24679402957c63ec426) for details on our code of conduct, and the process for submitting pull requests to us.
41 |
42 | ## Authors
43 |
44 | - [Vikas Kumar](https://github.com/worstkiller)
45 |
46 | ## Social
47 |
48 | - [Twitter](https://twitter.com/vikaskum09)
49 | - [LinkedIn](https://www.linkedin.com/in/vikaskumar09)
50 | - [Youtube](https://youtube.com/@vikaskumar)
51 |
52 | ## Support
53 | If this Project has helped you learnt something do consider star this repository and share with others 😊.
54 |
55 | ## License
56 |
57 | This project is licensed under the [ MIT ](https://github.com/worstkiller/jetpack_compose_animation/edit/master/LICENSE.md) License.
58 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.application'
3 | id 'org.jetbrains.kotlin.android'
4 | }
5 |
6 | android {
7 | namespace 'com.vikas.composeapp'
8 | compileSdk 33
9 |
10 | defaultConfig {
11 | applicationId "com.vikas.composeapp"
12 | minSdk 24
13 | targetSdk 33
14 | versionCode 2
15 | versionName "1.0.1"
16 |
17 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
18 | vectorDrawables {
19 | useSupportLibrary true
20 | }
21 | }
22 |
23 | buildTypes {
24 | release {
25 | minifyEnabled false
26 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
27 | }
28 | }
29 | compileOptions {
30 | sourceCompatibility JavaVersion.VERSION_1_8
31 | targetCompatibility JavaVersion.VERSION_1_8
32 | }
33 | kotlinOptions {
34 | jvmTarget = '1.8'
35 | }
36 | buildFeatures {
37 | compose true
38 | }
39 | composeOptions {
40 | kotlinCompilerExtensionVersion '1.2.0'
41 | }
42 | packagingOptions {
43 | resources {
44 | excludes += '/META-INF/{AL2.0,LGPL2.1}'
45 | }
46 | }
47 | }
48 |
49 | dependencies {
50 | implementation project(path: ':shoeapp')
51 | implementation project(path: ':foodorder')
52 | implementation 'androidx.core:core-ktx:1.9.0'
53 | implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1'
54 | implementation 'androidx.activity:activity-compose:1.6.1'
55 | implementation "androidx.compose.ui:ui:$compose_version"
56 | implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
57 | implementation 'androidx.compose.material3:material3:1.1.0-alpha03'
58 | testImplementation 'junit:junit:4.13.2'
59 | androidTestImplementation 'androidx.test.ext:junit:1.1.4'
60 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
61 | androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
62 | debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
63 | debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
64 |
65 | implementation "com.google.accompanist:accompanist-pager:0.28.0"
66 | }
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/app/shoeapp/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/app/shoeapp/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.application'
3 | id 'org.jetbrains.kotlin.android'
4 | }
5 |
6 | android {
7 | namespace 'com.vikas.shoeapp'
8 | compileSdk 33
9 |
10 | defaultConfig {
11 | applicationId "com.vikas.shoeapp"
12 | minSdk 21
13 | targetSdk 33
14 | versionCode 1
15 | versionName "1.0"
16 |
17 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
18 | vectorDrawables {
19 | useSupportLibrary true
20 | }
21 | }
22 |
23 | buildTypes {
24 | release {
25 | minifyEnabled false
26 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
27 | }
28 | }
29 | compileOptions {
30 | sourceCompatibility JavaVersion.VERSION_1_8
31 | targetCompatibility JavaVersion.VERSION_1_8
32 | }
33 | kotlinOptions {
34 | jvmTarget = '1.8'
35 | }
36 | buildFeatures {
37 | compose true
38 | }
39 | composeOptions {
40 | kotlinCompilerExtensionVersion '1.2.0'
41 | }
42 | packagingOptions {
43 | resources {
44 | excludes += '/META-INF/{AL2.0,LGPL2.1}'
45 | }
46 | }
47 | }
48 |
49 | dependencies {
50 |
51 | implementation 'androidx.core:core-ktx:1.9.0'
52 | implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1'
53 | implementation 'androidx.activity:activity-compose:1.6.1'
54 | implementation "androidx.compose.ui:ui:$compose_version"
55 | implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
56 | implementation 'androidx.compose.material:material:1.3.1'
57 | testImplementation 'junit:junit:4.13.2'
58 | implementation 'androidx.compose.material3:material3:1.1.0-alpha03'
59 | androidTestImplementation 'androidx.test.ext:junit:1.1.4'
60 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
61 | androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
62 | debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
63 | debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
64 | implementation "com.google.accompanist:accompanist-pager:0.28.0"
65 | }
--------------------------------------------------------------------------------
/app/shoeapp/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/app/shoeapp/src/androidTest/java/com/vikas/shoeapp/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.shoeapp
2 |
3 | import androidx.test.platform.app.InstrumentationRegistry
4 | import androidx.test.ext.junit.runners.AndroidJUnit4
5 |
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | import org.junit.Assert.*
10 |
11 | /**
12 | * Instrumented test, which will execute on an Android device.
13 | *
14 | * See [testing documentation](http://d.android.com/tools/testing).
15 | */
16 | @RunWith(AndroidJUnit4::class)
17 | class ExampleInstrumentedTest {
18 | @Test
19 | fun useAppContext() {
20 | // Context of the app under test.
21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22 | assertEquals("com.vikas.shoeapp", appContext.packageName)
23 | }
24 | }
--------------------------------------------------------------------------------
/app/shoeapp/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/app/shoeapp/src/main/java/com/vikas/shoeapp/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.shoeapp
2 |
3 | import android.content.Context
4 | import android.content.Intent
5 | import android.os.Bundle
6 | import androidx.activity.ComponentActivity
7 | import androidx.activity.compose.setContent
8 | import androidx.activity.viewModels
9 | import androidx.compose.animation.Crossfade
10 | import androidx.compose.foundation.Image
11 | import androidx.compose.foundation.background
12 | import androidx.compose.foundation.clickable
13 | import androidx.compose.foundation.layout.*
14 | import androidx.compose.foundation.shape.CircleShape
15 | import androidx.compose.material3.MaterialTheme.colorScheme
16 | import androidx.compose.material3.Surface
17 | import androidx.compose.material3.Text
18 | import androidx.compose.runtime.*
19 | import androidx.compose.ui.Alignment
20 | import androidx.compose.ui.Modifier
21 | import androidx.compose.ui.graphics.Color
22 | import androidx.compose.ui.graphics.ColorFilter
23 | import androidx.compose.ui.res.painterResource
24 | import androidx.compose.ui.text.font.FontWeight
25 | import androidx.compose.ui.text.style.TextAlign
26 | import androidx.compose.ui.tooling.preview.Preview
27 | import androidx.compose.ui.unit.dp
28 | import androidx.compose.ui.unit.sp
29 | import com.vikas.shoeapp.R
30 | import com.vikas.shoeapp.ui.home.BottomNav
31 | import com.vikas.shoeapp.ui.home.DetailComponent
32 | import com.vikas.shoeapp.ui.home.HomeComponent
33 | import com.vikas.shoeapp.ui.home.MainViewModel
34 | import com.vikas.shoeapp.ui.theme.JetpackComposeAnimationPlaygroundTheme
35 | import com.vikas.shoeapp.ui.theme.accentColor
36 | import com.vikas.shoeapp.ui.theme.textColor
37 |
38 | class MainActivity : ComponentActivity() {
39 |
40 | private val viewModel: MainViewModel by viewModels()
41 |
42 | override fun onCreate(savedInstanceState: Bundle?) {
43 | super.onCreate(savedInstanceState)
44 | setContent {
45 | JetpackComposeAnimationPlaygroundTheme {
46 | val screenState by remember { viewModel.screenState }
47 | Surface(
48 | modifier = Modifier.fillMaxSize(),
49 | color = colorScheme.background
50 | ) {
51 | Crossfade(targetState = screenState) { state ->
52 | when (state) {
53 | is MainViewModel.UiState.Home -> {
54 | DashboardComponent(viewModel)
55 | }
56 | is MainViewModel.UiState.Details -> {
57 | DetailComponent(
58 | state.carouselDataModel,
59 | viewModel
60 | )
61 | }
62 | }
63 | }
64 | }
65 | }
66 | }
67 | }
68 |
69 | companion object {
70 | fun getIntent(context: Context): Intent {
71 | return Intent(context, MainActivity::class.java)
72 | }
73 | }
74 | }
75 |
76 | @Composable
77 | fun DashboardComponent(viewModel: MainViewModel) {
78 | val screen = remember { mutableStateOf(BottomNav.Home) }
79 | Column(
80 | modifier = Modifier.fillMaxSize()
81 | ) {
82 |
83 | HomeToolbar()
84 |
85 | Column(
86 | modifier = Modifier.weight(1f),
87 | verticalArrangement = Arrangement.Center,
88 | horizontalAlignment = Alignment.CenterHorizontally
89 | ) {
90 | when (screen.value) {
91 | BottomNav.Home -> HomeComponent(viewModel)
92 | else -> {
93 | Text(
94 | text = "Coming Soon",
95 | fontWeight = FontWeight.Bold,
96 | fontSize = 32.sp,
97 | textAlign = TextAlign.Center,
98 | modifier = Modifier.fillMaxWidth(),
99 | color = textColor
100 | )
101 | }
102 | }
103 | }
104 |
105 | BottomToolbar(screen)
106 | }
107 | }
108 |
109 | @Composable
110 | fun BottomToolbar(screen: MutableState) {
111 | Row(
112 | verticalAlignment = Alignment.CenterVertically,
113 | modifier = Modifier
114 | .fillMaxWidth()
115 | .padding(start = 16.dp, end = 16.dp, bottom = 8.dp),
116 | horizontalArrangement = Arrangement.SpaceAround
117 | ) {
118 | BottomNav.values().forEach { nav ->
119 | Image(
120 | painter = painterResource(id = nav.icon),
121 | contentDescription = "search",
122 | modifier = Modifier
123 | .padding(4.dp)
124 | .size(36.dp)
125 | .padding(6.dp)
126 | .clickable {
127 | screen.value = nav
128 | },
129 | colorFilter = if (screen.value == nav) {
130 | ColorFilter.tint(accentColor)
131 | } else {
132 | ColorFilter.tint(Color.LightGray)
133 | }
134 | )
135 | }
136 | }
137 | }
138 |
139 | @Composable
140 | fun HomeToolbar() {
141 | Row(
142 | modifier = Modifier
143 | .fillMaxWidth()
144 | .padding(20.dp),
145 | verticalAlignment = Alignment.CenterVertically
146 | ) {
147 | Text(
148 | text = "Discover",
149 | fontWeight = FontWeight.Bold,
150 | fontSize = 26.sp,
151 | color = textColor
152 | )
153 |
154 | Spacer(modifier = Modifier.weight(1f))
155 |
156 | Image(
157 | painter = painterResource(id = R.drawable.ic_search),
158 | contentDescription = "search",
159 | modifier = Modifier
160 | .padding(6.dp)
161 | .size(32.dp)
162 | .background(color = Color.LightGray.copy(alpha = .2f), shape = CircleShape)
163 | .padding(8.dp)
164 | )
165 |
166 | Image(
167 | painter = painterResource(id = R.drawable.ic_notification),
168 | contentDescription = "search",
169 | modifier = Modifier
170 | .padding(6.dp)
171 | .size(32.dp)
172 | .background(color = Color.LightGray.copy(alpha = .2f), shape = CircleShape)
173 | .padding(8.dp)
174 | )
175 |
176 | }
177 | }
178 |
179 | @Preview(showBackground = true, showSystemUi = true)
180 | @Composable
181 | fun DefaultPreview() {
182 | JetpackComposeAnimationPlaygroundTheme {
183 | DashboardComponent(MainViewModel())
184 | }
185 | }
--------------------------------------------------------------------------------
/app/shoeapp/src/main/java/com/vikas/shoeapp/data/CarouselDataModel.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.shoeapp.data
2 |
3 | import androidx.compose.ui.graphics.Color
4 | import com.vikas.shoeapp.R
5 |
6 | data class CarouselDataModel(
7 | val resId: Int,
8 | val title: String,
9 | val description: String,
10 | val price: String,
11 | val color: Color,
12 | val aboutProduct: String = "Meet the $description TW. Inspired by the treasured franchise that brought $description cushioning to the world and laid the foundation for the aesthetic."
13 | ) {
14 | companion object {
15 |
16 | val listOfShoes = mutableListOf().apply {
17 | add(
18 | CarouselDataModel(
19 | resId = R.drawable.nike_100,
20 | title = "Nike",
21 | description = "Airmax 100",
22 | price = "₹ 15,000",
23 | color = Color(0xFFeb4658)
24 | )
25 | )
26 | add(
27 | CarouselDataModel(
28 | resId = R.drawable.reebok_102,
29 | title = "Reebok",
30 | description = "Epic React 2",
31 | price = "₹ 20,000",
32 | color = Color(0xFF6887cb)
33 | )
34 | )
35 | add(
36 | CarouselDataModel(
37 | resId = R.drawable.under_103,
38 | title = "Under Armour",
39 | description = "Hovr 2022",
40 | price = "₹ 10,000",
41 | color = Color(0xFFfe7153)
42 | )
43 | )
44 | add(
45 | CarouselDataModel(
46 | resId = R.drawable.adidas_104,
47 | title = "Adidas",
48 | description = "Supernova 200",
49 | price = "₹ 6,500",
50 | color = Color(0xFF45bfff)
51 | )
52 | )
53 | add(
54 | CarouselDataModel(
55 | resId = R.drawable.under_armour_105,
56 | title = "Under Armour",
57 | description = "Hovr 1000",
58 | price = "₹ 25,300",
59 | color = Color(0xFFAFCA71)
60 | )
61 | )
62 | add(
63 | CarouselDataModel(
64 | resId = R.drawable.adidas_s100,
65 | title = "Adidas",
66 | description = "Adidas s100",
67 | price = "₹ 12,000",
68 | color = Color(0xFFBBA45C)
69 | )
70 | )
71 | }
72 |
73 | val categories = listOf("New", "Featured", "Trending")
74 | }
75 |
76 | }
77 |
--------------------------------------------------------------------------------
/app/shoeapp/src/main/java/com/vikas/shoeapp/data/TrendingProduct.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.shoeapp.data
2 |
3 | import com.vikas.shoeapp.R
4 |
5 |
6 | data class TrendingProduct(val name: String, val price: String, val image: Int) {
7 | companion object {
8 | val list = listOf(
9 | TrendingProduct("Under Armour Phantom", "₹33000", R.drawable.armour_phantom),
10 | TrendingProduct("Under Armour 109", "₹19000", R.drawable.under_1031),
11 | TrendingProduct("Nike Air Max 270", "₹12000", R.drawable.adidas_1032),
12 | TrendingProduct("Adidas Neo", "₹15000", R.drawable.shoe_101),
13 | TrendingProduct("Roadster", "₹2300", R.drawable.roaster_100),
14 | )
15 | }
16 | }
17 |
18 | data class CartDataModel(
19 | val id: Int,
20 | val name: String,
21 | val price: Int,
22 | val image: Int,
23 | var quantity: Int = 1,
24 |
25 | ) {
26 | companion object {
27 | val list = listOf(
28 | CartDataModel(id = 101, "Nike Air Max 270", 12000, R.drawable.adidas_1032),
29 | CartDataModel(id = 102, "Under Armour 109", 19000, R.drawable.under_1031),
30 | CartDataModel(id = 103, "Under Armour Phantom", 33000, R.drawable.armour_phantom),
31 | CartDataModel(id = 104, "Adidas Neo", 15000, R.drawable.shoe_101),
32 | CartDataModel(id = 105, "Roadster Sneaker", 2300, R.drawable.roaster_100),
33 | )
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/app/shoeapp/src/main/java/com/vikas/shoeapp/ui/home/BottomNav.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.shoeapp.ui.home
2 |
3 | import com.vikas.shoeapp.R
4 |
5 | enum class BottomNav(val route: String, val icon: Int, val title: String) {
6 | Home("home", R.drawable.ic_home, "Home"),
7 | Search("favorite", R.drawable.ic_heart, "Favorite"),
8 | Profile("profile", R.drawable.ic_profile, "Profile"),
9 | Favorites("cart", R.drawable.ic_shop, "Cart"),
10 | Settings("settings", R.drawable.ic_settings, "Settings")
11 | }
--------------------------------------------------------------------------------
/app/shoeapp/src/main/java/com/vikas/shoeapp/ui/home/MainViewModel.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.shoeapp.ui.home
2 |
3 | import androidx.compose.runtime.mutableStateOf
4 | import androidx.lifecycle.ViewModel
5 | import androidx.lifecycle.viewModelScope
6 | import com.vikas.shoeapp.data.CarouselDataModel
7 | import kotlinx.coroutines.delay
8 | import kotlinx.coroutines.flow.MutableSharedFlow
9 | import kotlinx.coroutines.launch
10 |
11 | class MainViewModel : ViewModel() {
12 |
13 | val screenState = mutableStateOf(UiState.Home)
14 |
15 | val buttonState = mutableStateOf(ButtonState.DEFAULT)
16 |
17 | val cartFlow = MutableSharedFlow()
18 |
19 | sealed class UiState {
20 | class Details(val carouselDataModel: CarouselDataModel) : UiState()
21 | object Home : UiState()
22 | }
23 |
24 | fun onBackClick() {
25 | screenState.value = UiState.Home
26 | }
27 |
28 | fun changeButtonState() {
29 | if (buttonState.value == ButtonState.LOADED) {
30 | viewModelScope.launch {
31 | cartFlow.emit(true)
32 | }
33 | return
34 | }
35 | viewModelScope.launch {
36 | buttonState.value = ButtonState.LOADING
37 | delay(1500)
38 | buttonState.value = ButtonState.LOADED
39 | }
40 | }
41 |
42 | }
43 |
44 |
--------------------------------------------------------------------------------
/app/shoeapp/src/main/java/com/vikas/shoeapp/ui/theme/Color.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.shoeapp.ui.theme
2 |
3 | import androidx.compose.ui.graphics.Color
4 |
5 | val Purple200 = Color(0xFFBB86FC)
6 | val Purple500 = Color(0xFF6200EE)
7 | val Purple700 = Color(0xFF3700B3)
8 | val Teal200 = Color(0xFF03DAC5)
9 |
10 | val textColor = Color(0xFF101820)
11 | val accentColor = Color(0xFFeb4658)
--------------------------------------------------------------------------------
/app/shoeapp/src/main/java/com/vikas/shoeapp/ui/theme/Shape.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.shoeapp.ui.theme
2 |
3 | import androidx.compose.foundation.shape.RoundedCornerShape
4 | import androidx.compose.material.Shapes
5 | import androidx.compose.ui.unit.dp
6 |
7 | val Shapes = Shapes(
8 | small = RoundedCornerShape(4.dp),
9 | medium = RoundedCornerShape(4.dp),
10 | large = RoundedCornerShape(0.dp)
11 | )
--------------------------------------------------------------------------------
/app/shoeapp/src/main/java/com/vikas/shoeapp/ui/theme/Theme.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.shoeapp.ui.theme
2 |
3 | import androidx.compose.foundation.isSystemInDarkTheme
4 | import androidx.compose.material.MaterialTheme
5 | import androidx.compose.material.darkColors
6 | import androidx.compose.material.lightColors
7 | import androidx.compose.runtime.Composable
8 |
9 | private val DarkColorPalette = darkColors(
10 | primary = Purple200,
11 | primaryVariant = Purple700,
12 | secondary = Teal200
13 | )
14 |
15 | private val LightColorPalette = lightColors(
16 | primary = Purple500,
17 | primaryVariant = Purple700,
18 | secondary = Teal200
19 |
20 | /* Other default colors to override
21 | background = Color.White,
22 | surface = Color.White,
23 | onPrimary = Color.White,
24 | onSecondary = Color.Black,
25 | onBackground = Color.Black,
26 | onSurface = Color.Black,
27 | */
28 | )
29 |
30 | @Composable
31 | fun JetpackComposeAnimationPlaygroundTheme(
32 | darkTheme: Boolean = isSystemInDarkTheme(),
33 | content: @Composable () -> Unit
34 | ) {
35 | val colors = if (darkTheme) {
36 | DarkColorPalette
37 | } else {
38 | LightColorPalette
39 | }
40 |
41 | MaterialTheme(
42 | colors = colors,
43 | typography = Typography,
44 | shapes = Shapes,
45 | content = content
46 | )
47 | }
--------------------------------------------------------------------------------
/app/shoeapp/src/main/java/com/vikas/shoeapp/ui/theme/Type.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.shoeapp.ui.theme
2 |
3 | import androidx.compose.material.Typography
4 | import androidx.compose.ui.text.TextStyle
5 | import androidx.compose.ui.text.font.FontFamily
6 | import androidx.compose.ui.text.font.FontWeight
7 | import androidx.compose.ui.unit.sp
8 |
9 | // Set of Material typography styles to start with
10 | val Typography = Typography(
11 | body1 = TextStyle(
12 | fontFamily = FontFamily.Default,
13 | fontWeight = FontWeight.Normal,
14 | fontSize = 16.sp
15 | )
16 | /* Other default text styles to override
17 | button = TextStyle(
18 | fontFamily = FontFamily.Default,
19 | fontWeight = FontWeight.W500,
20 | fontSize = 14.sp
21 | ),
22 | caption = TextStyle(
23 | fontFamily = FontFamily.Default,
24 | fontWeight = FontWeight.Normal,
25 | fontSize = 12.sp
26 | )
27 | */
28 | )
--------------------------------------------------------------------------------
/app/shoeapp/src/main/java/com/vikas/shoeapp/util/Utils.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.shoeapp.util
2 |
3 | import androidx.compose.animation.core.CubicBezierEasing
4 | import androidx.compose.animation.core.Easing
5 |
6 | object Utils {
7 | fun lerp(start: Float, stop: Float, fraction: Float): Float =
8 | (1 - fraction) * start + fraction * stop
9 |
10 |
11 | val EaseOutBounce: Easing = Easing { fraction ->
12 | val n1 = 7.5625f
13 | val d1 = 2.75f
14 | var newFraction = fraction
15 |
16 | return@Easing if (newFraction < 1f / d1) {
17 | n1 * newFraction * newFraction
18 | } else if (newFraction < 2f / d1) {
19 | newFraction -= 1.5f / d1
20 | n1 * newFraction * newFraction + 0.75f
21 | } else if (newFraction < 2.5f / d1) {
22 | newFraction -= 2.25f / d1
23 | n1 * newFraction * newFraction + 0.9375f
24 | } else {
25 | newFraction -= 2.625f / d1
26 | n1 * newFraction * newFraction + 0.984375f
27 | }
28 | }
29 | val EaseOutQuart = CubicBezierEasing(0.25f, 1f, 0.5f, 1f)
30 | }
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/drawable/adidas_1032.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/app/shoeapp/src/main/res/drawable/adidas_1032.png
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/drawable/adidas_104.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/app/shoeapp/src/main/res/drawable/adidas_104.png
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/drawable/adidas_s100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/app/shoeapp/src/main/res/drawable/adidas_s100.png
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/drawable/armour_phantom.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/app/shoeapp/src/main/res/drawable/armour_phantom.png
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/drawable/baseline_circle_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/drawable/ic_add.xml:
--------------------------------------------------------------------------------
1 |
6 |
13 |
20 |
21 |
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/drawable/ic_heart.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/drawable/ic_home.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/drawable/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/drawable/ic_notification.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
15 |
16 |
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/drawable/ic_profile.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
15 |
16 |
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/drawable/ic_remove.xml:
--------------------------------------------------------------------------------
1 |
6 |
13 |
14 |
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/drawable/ic_ribbon.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/drawable/ic_right_arrow.xml:
--------------------------------------------------------------------------------
1 |
6 |
13 |
20 |
21 |
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/drawable/ic_search.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/drawable/ic_settings.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/drawable/ic_shop.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/drawable/nike_100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/app/shoeapp/src/main/res/drawable/nike_100.png
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/drawable/reebok_102.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/app/shoeapp/src/main/res/drawable/reebok_102.png
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/drawable/roaster_100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/app/shoeapp/src/main/res/drawable/roaster_100.png
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/drawable/shoe_101.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/app/shoeapp/src/main/res/drawable/shoe_101.png
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/drawable/under_103.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/app/shoeapp/src/main/res/drawable/under_103.png
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/drawable/under_1031.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/app/shoeapp/src/main/res/drawable/under_1031.png
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/drawable/under_armour_105.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/app/shoeapp/src/main/res/drawable/under_armour_105.png
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/mipmap-anydpi-v33/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/mipmap-hdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/app/shoeapp/src/main/res/mipmap-hdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/mipmap-hdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/app/shoeapp/src/main/res/mipmap-hdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/mipmap-mdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/app/shoeapp/src/main/res/mipmap-mdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/mipmap-mdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/app/shoeapp/src/main/res/mipmap-mdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/mipmap-xhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/app/shoeapp/src/main/res/mipmap-xhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/mipmap-xhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/app/shoeapp/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/mipmap-xxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/app/shoeapp/src/main/res/mipmap-xxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/app/shoeapp/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/mipmap-xxxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/app/shoeapp/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/app/shoeapp/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFBB86FC
4 | #FF6200EE
5 | #FF3700B3
6 | #FF03DAC5
7 | #FF018786
8 | #FF000000
9 | #FFFFFFFF
10 |
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | ShoeApp
3 |
--------------------------------------------------------------------------------
/app/shoeapp/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
--------------------------------------------------------------------------------
/app/shoeapp/src/test/java/com/vikas/shoeapp/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.shoeapp
2 |
3 | import org.junit.Test
4 |
5 | import org.junit.Assert.*
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * See [testing documentation](http://d.android.com/tools/testing).
11 | */
12 | class ExampleUnitTest {
13 | @Test
14 | fun addition_isCorrect() {
15 | assertEquals(4, 2 + 2)
16 | }
17 | }
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/vikas/composeapp/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.composeapp
2 |
3 | import androidx.test.platform.app.InstrumentationRegistry
4 | import androidx.test.ext.junit.runners.AndroidJUnit4
5 |
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | import org.junit.Assert.*
10 |
11 | /**
12 | * Instrumented test, which will execute on an Android device.
13 | *
14 | * See [testing documentation](http://d.android.com/tools/testing).
15 | */
16 | @RunWith(AndroidJUnit4::class)
17 | class ExampleInstrumentedTest {
18 | @Test
19 | fun useAppContext() {
20 | // Context of the app under test.
21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22 | assertEquals("com.example.jetpackcomposeanimationplayground", appContext.packageName)
23 | }
24 | }
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
14 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/app/src/main/java/com/vikas/composeapp/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.composeapp
2 |
3 | import android.os.Bundle
4 | import androidx.activity.ComponentActivity
5 | import androidx.activity.compose.setContent
6 | import androidx.compose.foundation.layout.fillMaxSize
7 | import androidx.compose.material3.MaterialTheme.colorScheme
8 | import androidx.compose.material3.Surface
9 | import androidx.compose.runtime.Composable
10 | import androidx.compose.ui.Modifier
11 | import androidx.compose.ui.tooling.preview.Preview
12 | import com.vikas.composeapp.ui.home.HomeComponent
13 | import com.vikas.composeapp.ui.theme.JetpackComposeAnimationPlaygroundTheme
14 |
15 | enum class MenuState {
16 | EXPANDED, COLLAPSED
17 | }
18 |
19 | class MainActivity : ComponentActivity() {
20 |
21 | override fun onCreate(savedInstanceState: Bundle?) {
22 | super.onCreate(savedInstanceState)
23 | setContent {
24 | JetpackComposeAnimationPlaygroundTheme {
25 | Surface(
26 | modifier = Modifier.fillMaxSize(),
27 | color = colorScheme.background
28 | ) {
29 | HomeComponent()
30 | }
31 | }
32 | }
33 | }
34 | }
35 |
36 | @Preview(showBackground = true, showSystemUi = true)
37 | @Composable
38 | fun DefaultPreview() {
39 | JetpackComposeAnimationPlaygroundTheme {
40 | HomeComponent()
41 | }
42 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/vikas/composeapp/ui/cart/CartComponent.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.composeapp.ui.cart
2 |
3 | import androidx.compose.foundation.Image
4 | import androidx.compose.foundation.layout.Arrangement
5 | import androidx.compose.foundation.layout.Column
6 | import androidx.compose.foundation.layout.fillMaxSize
7 | import androidx.compose.runtime.Composable
8 | import androidx.compose.ui.Alignment
9 | import androidx.compose.ui.Modifier
10 | import androidx.compose.ui.res.painterResource
11 | import com.vikas.shoeapp.R
12 |
13 | @Composable
14 | fun CartComponent() {
15 | Column(
16 | modifier = Modifier.fillMaxSize(),
17 | horizontalAlignment = Alignment.CenterHorizontally,
18 | verticalArrangement = Arrangement.Center
19 | ) {
20 | //add some content here
21 | Image(
22 | painter = painterResource(id = R.drawable.ic_shop),
23 | contentDescription = "Cart"
24 | )
25 | }
26 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/vikas/composeapp/ui/dashboard/DashboardComponent.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.composeapp.ui.dashboard
2 |
3 | import android.widget.Toast
4 | import androidx.compose.animation.core.*
5 | import androidx.compose.foundation.Image
6 | import androidx.compose.foundation.background
7 | import androidx.compose.foundation.layout.*
8 | import androidx.compose.foundation.lazy.LazyColumn
9 | import androidx.compose.foundation.lazy.items
10 | import androidx.compose.material.icons.Icons
11 | import androidx.compose.material.icons.filled.ArrowForward
12 | import androidx.compose.material3.*
13 | import androidx.compose.runtime.*
14 | import androidx.compose.ui.Alignment
15 | import androidx.compose.ui.Modifier
16 | import androidx.compose.ui.draw.alpha
17 | import androidx.compose.ui.graphics.Brush
18 | import androidx.compose.ui.graphics.Color
19 | import androidx.compose.ui.layout.ContentScale
20 | import androidx.compose.ui.platform.LocalContext
21 | import androidx.compose.ui.res.painterResource
22 | import androidx.compose.ui.text.font.FontWeight
23 | import androidx.compose.ui.tooling.preview.Preview
24 | import androidx.compose.ui.unit.dp
25 | import androidx.compose.ui.unit.sp
26 | import com.vikas.foodorder.FoodAppMainActivity
27 | import com.vikas.shoeapp.MainActivity
28 |
29 | @Composable
30 | fun DashboardComponent() {
31 | val context = LocalContext.current
32 |
33 | Column(modifier = Modifier) {
34 | LazyColumn(modifier = Modifier.fillMaxSize()) {
35 | items(DashboardOptions.values()) {
36 | ProjectItem(it) {
37 | when (it) {
38 | DashboardOptions.SHOE_APP -> {
39 | context.startActivity(MainActivity.getIntent(context))
40 | }
41 | DashboardOptions.FOOD_ORDER_APP -> {
42 | context.startActivity(FoodAppMainActivity.getIntent(context))
43 | }
44 | else -> {
45 | Toast.makeText(context, "Coming Soon", Toast.LENGTH_SHORT).show()
46 | }
47 | }
48 |
49 | }
50 | }
51 | }
52 | }
53 | }
54 |
55 | @OptIn(ExperimentalMaterial3Api::class)
56 | @Composable
57 | fun ProjectItem(project: DashboardOptions, onClick: (DashboardOptions) -> Unit) {
58 | Card(
59 | onClick = { onClick(project) },
60 | modifier = Modifier.padding(16.dp),
61 | elevation = CardDefaults.cardElevation(defaultElevation = 8.dp),
62 | colors = CardDefaults.cardColors(containerColor = Color.White),
63 | ) {
64 |
65 | Box {
66 | Image(
67 | painter = painterResource(id = project.image),
68 | contentDescription = "project",
69 | modifier = Modifier
70 | .fillMaxWidth()
71 | .height(180.dp),
72 | contentScale = ContentScale.Crop,
73 | )
74 | Row(
75 | modifier = Modifier
76 | .alpha(.9f)
77 | .fillMaxWidth()
78 | .background(
79 | brush = Brush.horizontalGradient(
80 | listOf(
81 | Color(0xFFFF5F6D),
82 | Color(0xFFFFC371)
83 | )
84 | )
85 | )
86 | .padding(16.dp)
87 | .align(Alignment.BottomStart),
88 | horizontalArrangement = Arrangement.SpaceBetween,
89 | verticalAlignment = Alignment.CenterVertically
90 | ) {
91 | Text(
92 | text = project.title,
93 | fontSize = 20.sp,
94 | fontWeight = FontWeight.Medium,
95 | color = Color.White
96 | )
97 | Icon(
98 | imageVector = Icons.Default.ArrowForward,
99 | contentDescription = "Arrow Forward",
100 | tint = Color.White
101 | )
102 | }
103 | }
104 |
105 | }
106 | }
107 |
108 | @Composable
109 | @Preview(showBackground = true, showSystemUi = true)
110 | fun Preview_DashboardComponent() {
111 | DashboardComponent()
112 | }
113 |
--------------------------------------------------------------------------------
/app/src/main/java/com/vikas/composeapp/ui/dashboard/DashboardOptions.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.composeapp.ui.dashboard
2 |
3 | import com.vikas.composeapp.R
4 |
5 | enum class DashboardOptions(val title: String, val image: Int) {
6 | SHOE_APP("Shoe App", R.drawable.shoe_background),
7 | FOOD_ORDER_APP("Food app", R.drawable.pizza_background),
8 | UPCOMING_APP("Upcoming App", R.drawable.upcoming_background),
9 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/vikas/composeapp/ui/favorite/FavoriteComponent.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.composeapp.ui.favorite
2 |
3 | import androidx.compose.foundation.Image
4 | import androidx.compose.foundation.layout.Arrangement
5 | import androidx.compose.foundation.layout.Column
6 | import androidx.compose.foundation.layout.fillMaxSize
7 | import androidx.compose.runtime.Composable
8 | import androidx.compose.ui.Alignment
9 | import androidx.compose.ui.Modifier
10 | import androidx.compose.ui.res.painterResource
11 | import com.vikas.shoeapp.R
12 |
13 | @Composable
14 | fun FavoriteComponent() {
15 | Column(
16 | modifier = Modifier.fillMaxSize(),
17 | horizontalAlignment = Alignment.CenterHorizontally,
18 | verticalArrangement = Arrangement.Center
19 | ) {
20 | //add some content here
21 | Image(
22 | painter = painterResource(id = R.drawable.ic_heart),
23 | contentDescription = "favorite",
24 | )
25 | }
26 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/vikas/composeapp/ui/home/HomeMenu.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.composeapp.ui.home
2 |
3 | enum class HomeMenu(val title: String, val icon: Int) {
4 | HOME("Home", com.vikas.shoeapp.R.drawable.ic_home),
5 | NOTIFICATION("Notification", com.vikas.shoeapp.R.drawable.ic_notification),
6 | FAVORITE("Favorite", com.vikas.shoeapp.R.drawable.ic_heart),
7 | CART("Cart", com.vikas.shoeapp.R.drawable.ic_shop),
8 | PROFILE("Profile", com.vikas.shoeapp.R.drawable.ic_profile),
9 | }
10 |
11 | sealed class HomeMenuAction {
12 | object CLOSE : HomeMenuAction()
13 | object LOGOUT : HomeMenuAction()
14 | object SETTINGS : HomeMenuAction()
15 | data class MenuSelected(val menu: HomeMenu) : HomeMenuAction()
16 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/vikas/composeapp/ui/notifications/NotificationsComponent.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.composeapp.ui.notifications
2 |
3 | import androidx.compose.foundation.Image
4 | import androidx.compose.foundation.background
5 | import androidx.compose.foundation.layout.Arrangement
6 | import androidx.compose.foundation.layout.Column
7 | import androidx.compose.foundation.layout.fillMaxSize
8 | import androidx.compose.runtime.Composable
9 | import androidx.compose.ui.Alignment
10 | import androidx.compose.ui.Modifier
11 | import androidx.compose.ui.graphics.Color
12 | import androidx.compose.ui.res.painterResource
13 | import com.vikas.shoeapp.R
14 |
15 | @Composable
16 | fun NotificationsComponent() {
17 | Column(
18 | modifier = Modifier.fillMaxSize(),
19 | horizontalAlignment = Alignment.CenterHorizontally,
20 | verticalArrangement = Arrangement.Center
21 | ) {
22 | //add some content here
23 | Image(
24 | painter = painterResource(id = R.drawable.ic_notification),
25 | contentDescription = "Notifications",
26 | )
27 | }
28 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/vikas/composeapp/ui/profile/ProfileComponent.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.composeapp.ui.profile
2 |
3 | import androidx.compose.foundation.Image
4 | import androidx.compose.foundation.layout.Arrangement
5 | import androidx.compose.foundation.layout.Column
6 | import androidx.compose.foundation.layout.fillMaxSize
7 | import androidx.compose.runtime.Composable
8 | import androidx.compose.ui.Alignment
9 | import androidx.compose.ui.Modifier
10 | import androidx.compose.ui.res.painterResource
11 | import com.vikas.composeapp.R
12 |
13 | @Composable
14 | fun ProfileComponent() {
15 | Column(
16 | modifier = Modifier.fillMaxSize(),
17 | horizontalAlignment = Alignment.CenterHorizontally,
18 | verticalArrangement = Arrangement.Center
19 | ) {
20 | //add some content here
21 | Image(
22 | painter = painterResource(id = com.vikas.shoeapp.R.drawable.ic_profile),
23 | contentDescription = "profile"
24 | )
25 | }
26 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/vikas/composeapp/ui/settings/SettingsComponent.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.composeapp.ui.settings
2 |
3 | import androidx.compose.foundation.Image
4 | import androidx.compose.foundation.layout.Arrangement
5 | import androidx.compose.foundation.layout.Column
6 | import androidx.compose.foundation.layout.fillMaxSize
7 | import androidx.compose.runtime.Composable
8 | import androidx.compose.ui.Alignment
9 | import androidx.compose.ui.Modifier
10 | import androidx.compose.ui.res.painterResource
11 | import com.vikas.shoeapp.R
12 |
13 | @Composable
14 | fun SettingsComponent() {
15 | Column(
16 | modifier = Modifier.fillMaxSize(),
17 | horizontalAlignment = Alignment.CenterHorizontally,
18 | verticalArrangement = Arrangement.Center
19 | ) {
20 | //add some content here
21 | Image(
22 | painter = painterResource(id = R.drawable.ic_settings),
23 | contentDescription = "settings",
24 | )
25 | }
26 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/vikas/composeapp/ui/theme/Color.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.composeapp.ui.theme
2 |
3 | import androidx.compose.ui.graphics.Color
4 |
5 | val Purple80 = Color(0xFFD0BCFF)
6 | val PurpleGrey80 = Color(0xFFCCC2DC)
7 | val Pink80 = Color(0xFFEFB8C8)
8 |
9 | val Purple40 = Color(0xFF6650a4)
10 | val PurpleGrey40 = Color(0xFF625b71)
11 | val Pink40 = Color(0xFF7D5260)
--------------------------------------------------------------------------------
/app/src/main/java/com/vikas/composeapp/ui/theme/Theme.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.composeapp.ui.theme
2 |
3 | import android.app.Activity
4 | import android.os.Build
5 | import androidx.compose.foundation.isSystemInDarkTheme
6 | import androidx.compose.material3.MaterialTheme
7 | import androidx.compose.material3.darkColorScheme
8 | import androidx.compose.material3.dynamicDarkColorScheme
9 | import androidx.compose.material3.dynamicLightColorScheme
10 | import androidx.compose.material3.lightColorScheme
11 | import androidx.compose.runtime.Composable
12 | import androidx.compose.runtime.SideEffect
13 | import androidx.compose.ui.graphics.toArgb
14 | import androidx.compose.ui.platform.LocalContext
15 | import androidx.compose.ui.platform.LocalView
16 | import androidx.core.view.ViewCompat
17 |
18 | private val DarkColorScheme = darkColorScheme(
19 | primary = Purple80,
20 | secondary = PurpleGrey80,
21 | tertiary = Pink80
22 | )
23 |
24 | private val LightColorScheme = lightColorScheme(
25 | primary = Purple40,
26 | secondary = PurpleGrey40,
27 | tertiary = Pink40
28 |
29 | /* Other default colors to override
30 | background = Color(0xFFFFFBFE),
31 | surface = Color(0xFFFFFBFE),
32 | onPrimary = Color.White,
33 | onSecondary = Color.White,
34 | onTertiary = Color.White,
35 | onBackground = Color(0xFF1C1B1F),
36 | onSurface = Color(0xFF1C1B1F),
37 | */
38 | )
39 |
40 | @Composable
41 | fun JetpackComposeAnimationPlaygroundTheme(
42 | darkTheme: Boolean = isSystemInDarkTheme(),
43 | // Dynamic color is available on Android 12+
44 | dynamicColor: Boolean = true,
45 | content: @Composable () -> Unit
46 | ) {
47 | val colorScheme = when {
48 | dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> {
49 | val context = LocalContext.current
50 | if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
51 | }
52 | darkTheme -> DarkColorScheme
53 | else -> LightColorScheme
54 | }
55 | val view = LocalView.current
56 | if (!view.isInEditMode) {
57 | SideEffect {
58 | (view.context as Activity).window.statusBarColor = colorScheme.primary.toArgb()
59 | ViewCompat.getWindowInsetsController(view)?.isAppearanceLightStatusBars = darkTheme
60 | }
61 | }
62 |
63 | MaterialTheme(
64 | colorScheme = colorScheme,
65 | typography = Typography,
66 | content = content
67 | )
68 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/vikas/composeapp/ui/theme/Type.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.composeapp.ui.theme
2 |
3 | import androidx.compose.material3.Typography
4 | import androidx.compose.ui.text.TextStyle
5 | import androidx.compose.ui.text.font.FontFamily
6 | import androidx.compose.ui.text.font.FontWeight
7 | import androidx.compose.ui.unit.sp
8 |
9 | // Set of Material typography styles to start with
10 | val Typography = Typography(
11 | bodyLarge = TextStyle(
12 | fontFamily = FontFamily.Default,
13 | fontWeight = FontWeight.Normal,
14 | fontSize = 16.sp,
15 | lineHeight = 24.sp,
16 | letterSpacing = 0.5.sp
17 | )
18 | /* Other default text styles to override
19 | titleLarge = TextStyle(
20 | fontFamily = FontFamily.Default,
21 | fontWeight = FontWeight.Normal,
22 | fontSize = 22.sp,
23 | lineHeight = 28.sp,
24 | letterSpacing = 0.sp
25 | ),
26 | labelSmall = TextStyle(
27 | fontFamily = FontFamily.Default,
28 | fontWeight = FontWeight.Medium,
29 | fontSize = 11.sp,
30 | lineHeight = 16.sp,
31 | letterSpacing = 0.5.sp
32 | )
33 | */
34 | )
--------------------------------------------------------------------------------
/app/src/main/java/com/vikas/composeapp/util/Util.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.composeapp.util
2 |
3 | import androidx.compose.ui.graphics.Color
4 |
5 | object Util {
6 |
7 | fun randomColor(): Color {
8 | return listOf(
9 | 0xFFE57373.toInt(),
10 | 0xFFF06292.toInt(),
11 | 0xFFBA68C8.toInt(),
12 | 0xFF9575CD.toInt(),
13 | 0xFF7986CB.toInt(),
14 | 0xFF64B5F6.toInt(),
15 | 0xFF4FC3F7.toInt(),
16 | 0xFF4DD0E1.toInt(),
17 | 0xFF4DB6AC.toInt(),
18 | 0xFF81C784.toInt(),
19 | 0xFFAED581.toInt(),
20 | 0xFFDCE775.toInt(),
21 | 0xFFFFD54F.toInt(),
22 | 0xFFFFB74D.toInt(),
23 | 0xFFA1887F.toInt(),
24 | 0xFF90A4AE.toInt()
25 | ).map {
26 | Color(it)
27 | }.random()
28 | }
29 |
30 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/pizza_background.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/app/src/main/res/drawable-nodpi/pizza_background.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/profile_image.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/app/src/main/res/drawable-nodpi/profile_image.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/shoe_background.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/app/src/main/res/drawable-nodpi/shoe_background.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/upcoming_background.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/app/src/main/res/drawable-nodpi/upcoming_background.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_close.xml:
--------------------------------------------------------------------------------
1 |
6 |
13 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_menu.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v33/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/app/src/main/res/mipmap-hdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/app/src/main/res/mipmap-mdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/app/src/main/res/mipmap-xhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFBB86FC
4 | #FF6200EE
5 | #FF3700B3
6 | #FF03DAC5
7 | #FF018786
8 | #FF000000
9 | #FFFFFFFF
10 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Jetpack Compose Anim
3 |
--------------------------------------------------------------------------------
/app/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/backup_rules.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/data_extraction_rules.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
12 |
13 |
19 |
--------------------------------------------------------------------------------
/app/src/test/java/com/vikas/composeapp/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.composeapp
2 |
3 | import org.junit.Test
4 |
5 | import org.junit.Assert.*
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * See [testing documentation](http://d.android.com/tools/testing).
11 | */
12 | class ExampleUnitTest {
13 | @Test
14 | fun addition_isCorrect() {
15 | assertEquals(4, 2 + 2)
16 | }
17 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext {
3 | compose_version = '1.3.2'
4 | }
5 | }// Top-level build file where you can add configuration options common to all sub-projects/modules.
6 | plugins {
7 | id 'com.android.application' version '7.4.0-rc01' apply false
8 | id 'com.android.library' version '7.4.0-rc01' apply false
9 | id 'org.jetbrains.kotlin.android' version '1.7.0' apply false
10 | }
--------------------------------------------------------------------------------
/foodorder/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/foodorder/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.library'
3 | id 'org.jetbrains.kotlin.android'
4 | }
5 |
6 | android {
7 | namespace 'com.vikas.foodorder'
8 | compileSdk 33
9 |
10 | defaultConfig {
11 | minSdk 24
12 | targetSdk 33
13 |
14 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
15 | consumerProguardFiles "consumer-rules.pro"
16 | }
17 |
18 | buildTypes {
19 | release {
20 | minifyEnabled false
21 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
22 | }
23 | }
24 | compileOptions {
25 | sourceCompatibility JavaVersion.VERSION_1_8
26 | targetCompatibility JavaVersion.VERSION_1_8
27 | }
28 | buildFeatures {
29 | compose true
30 | }
31 | kotlinOptions {
32 | jvmTarget = '1.8'
33 | }
34 | }
35 |
36 | dependencies {
37 |
38 | implementation 'androidx.core:core-ktx:1.8.0'
39 | implementation 'androidx.appcompat:appcompat:1.6.1'
40 | implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1'
41 | implementation 'androidx.activity:activity-compose:1.6.1'
42 | implementation 'com.google.android.material:material:1.8.0'
43 | testImplementation 'junit:junit:4.13.2'
44 | androidTestImplementation 'androidx.test.ext:junit:1.1.5'
45 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
46 | implementation "androidx.compose.ui:ui:$compose_version"
47 | implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
48 | implementation 'androidx.compose.material:material:1.3.1'
49 | implementation 'androidx.compose.material3:material3:1.1.0-alpha03'
50 | debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
51 | debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
52 | implementation "com.google.accompanist:accompanist-pager:0.28.0"
53 | }
--------------------------------------------------------------------------------
/foodorder/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/foodorder/consumer-rules.pro
--------------------------------------------------------------------------------
/foodorder/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/foodorder/src/androidTest/java/com/vikas/pizzaorder/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.pizzaorder
2 |
3 | import androidx.test.platform.app.InstrumentationRegistry
4 | import androidx.test.ext.junit.runners.AndroidJUnit4
5 |
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | import org.junit.Assert.*
10 |
11 | /**
12 | * Instrumented test, which will execute on an Android device.
13 | *
14 | * See [testing documentation](http://d.android.com/tools/testing).
15 | */
16 | @RunWith(AndroidJUnit4::class)
17 | class ExampleInstrumentedTest {
18 | @Test
19 | fun useAppContext() {
20 | // Context of the app under test.
21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22 | assertEquals("com.vikas.feedback.test", appContext.packageName)
23 | }
24 | }
--------------------------------------------------------------------------------
/foodorder/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/foodorder/src/main/java/com/vikas/foodorder/AddToCartComponent.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.foodorder
2 |
3 | import androidx.compose.animation.AnimatedVisibility
4 | import androidx.compose.foundation.Image
5 | import androidx.compose.foundation.background
6 | import androidx.compose.foundation.clickable
7 | import androidx.compose.foundation.layout.Arrangement
8 | import androidx.compose.foundation.layout.Column
9 | import androidx.compose.foundation.layout.Spacer
10 | import androidx.compose.foundation.layout.fillMaxHeight
11 | import androidx.compose.foundation.layout.fillMaxSize
12 | import androidx.compose.foundation.layout.fillMaxWidth
13 | import androidx.compose.foundation.layout.height
14 | import androidx.compose.foundation.layout.offset
15 | import androidx.compose.foundation.layout.padding
16 | import androidx.compose.foundation.layout.size
17 | import androidx.compose.foundation.shape.RoundedCornerShape
18 | import androidx.compose.material.MaterialTheme
19 | import androidx.compose.material3.Text
20 | import androidx.compose.runtime.Composable
21 | import androidx.compose.runtime.LaunchedEffect
22 | import androidx.compose.runtime.getValue
23 | import androidx.compose.runtime.mutableStateOf
24 | import androidx.compose.runtime.remember
25 | import androidx.compose.runtime.setValue
26 | import androidx.compose.ui.Alignment
27 | import androidx.compose.ui.Modifier
28 | import androidx.compose.ui.draw.alpha
29 | import androidx.compose.ui.draw.clip
30 | import androidx.compose.ui.graphics.Color
31 | import androidx.compose.ui.graphics.ColorFilter
32 | import androidx.compose.ui.layout.ContentScale
33 | import androidx.compose.ui.res.painterResource
34 | import androidx.compose.ui.text.font.FontWeight
35 | import androidx.compose.ui.text.style.TextDecoration
36 | import androidx.compose.ui.tooling.preview.Preview
37 | import androidx.compose.ui.unit.dp
38 | import androidx.compose.ui.unit.sp
39 | import com.vikas.foodorder.theme.JetpackComposeAnimationPlaygroundTheme
40 | import kotlinx.coroutines.delay
41 |
42 | @Composable
43 | fun AddToCartComponent(
44 | pizzaModel: PizzaDataModel,
45 | transitionAlpha: Float,
46 | transitionSize: Float,
47 | onClick: () -> Unit
48 | ) {
49 |
50 | var alpha by remember { mutableStateOf(false) }
51 |
52 | LaunchedEffect(key1 = pizzaModel) {
53 | delay(200)
54 | alpha = true
55 | }
56 |
57 | Column(
58 | verticalArrangement = Arrangement.Center,
59 | horizontalAlignment = Alignment.CenterHorizontally,
60 | modifier = Modifier
61 | .fillMaxWidth()
62 | .fillMaxHeight(transitionSize)
63 | .alpha(transitionAlpha)
64 | ) {
65 |
66 | Column(
67 | horizontalAlignment = Alignment.CenterHorizontally,
68 | modifier = Modifier
69 | .fillMaxWidth()
70 | .fillMaxHeight(.70f)
71 | .padding(40.dp)
72 | .background(shape = RoundedCornerShape(20.dp), color = Color.Black)
73 | .clip(RoundedCornerShape(20.dp))
74 | ) {
75 |
76 | Text(
77 | text = "Amount",
78 | style = MaterialTheme.typography.h5,
79 | color = Color.White,
80 | fontWeight = FontWeight.SemiBold,
81 | fontSize = 28.sp,
82 | modifier = Modifier.padding(top = 30.dp)
83 | )
84 |
85 | Text(
86 | text = pizzaModel.pizzaPrice,
87 | fontSize = 20.sp,
88 | color = Color(0xFFE91E63),
89 | modifier = Modifier.padding(top = 16.dp)
90 | )
91 |
92 | Spacer(modifier = Modifier.height(20.dp))
93 |
94 | AnimatedVisibility(visible = alpha) {
95 | Image(
96 | painter = painterResource(id = R.drawable.ic_verified),
97 | contentDescription = "check",
98 | colorFilter = ColorFilter.tint(Color.Green.copy(alpha = .8f)),
99 | modifier = Modifier.size(90.dp)
100 | )
101 | }
102 |
103 | Image(
104 | painter = painterResource(id = pizzaModel.pizzaImage),
105 | contentDescription = "food image",
106 | contentScale = ContentScale.FillHeight,
107 | modifier = Modifier
108 | .fillMaxWidth()
109 | .size(400.dp)
110 | .offset(y = 60.dp),
111 | )
112 |
113 | }
114 | Text(
115 | text = "Back to Details",
116 | color = Color.Gray.copy(alpha = .8f),
117 | fontWeight = FontWeight.SemiBold,
118 | textDecoration = TextDecoration.Underline,
119 | modifier = Modifier
120 | .clickable {
121 | onClick()
122 | },
123 | )
124 | }
125 | }
126 |
127 | @Preview(showSystemUi = true, showBackground = true)
128 | @Composable
129 | fun Preview_AddToCartComponent() {
130 | JetpackComposeAnimationPlaygroundTheme {
131 | AddToCartComponent(PizzaDataModel.list.first(), 1f, 1f) {
132 |
133 | }
134 | }
135 | }
--------------------------------------------------------------------------------
/foodorder/src/main/java/com/vikas/foodorder/FoodAppMainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.foodorder
2 |
3 | import android.content.Context
4 | import android.content.Intent
5 | import android.os.Bundle
6 | import androidx.activity.ComponentActivity
7 | import androidx.activity.compose.setContent
8 | import androidx.compose.foundation.layout.fillMaxSize
9 | import androidx.compose.material3.MaterialTheme
10 | import androidx.compose.material3.Surface
11 | import androidx.compose.runtime.Composable
12 | import androidx.compose.ui.Modifier
13 | import androidx.compose.ui.tooling.preview.Preview
14 | import com.google.accompanist.pager.ExperimentalPagerApi
15 | import com.google.accompanist.pager.rememberPagerState
16 | import com.vikas.foodorder.theme.JetpackComposeAnimationPlaygroundTheme
17 |
18 | class FoodAppMainActivity : ComponentActivity() {
19 |
20 | @OptIn(ExperimentalPagerApi::class)
21 | override fun onCreate(savedInstanceState: Bundle?) {
22 | super.onCreate(savedInstanceState)
23 | setContent {
24 | JetpackComposeAnimationPlaygroundTheme {
25 | Surface(
26 | modifier = Modifier.fillMaxSize(),
27 | color = MaterialTheme.colorScheme.background
28 | ) {
29 | ProductDetailsComponent()
30 | }
31 | }
32 | }
33 | }
34 |
35 | companion object {
36 | fun getIntent(context: Context): Intent {
37 | return Intent(context, FoodAppMainActivity::class.java)
38 | }
39 | }
40 |
41 | }
42 |
43 |
44 | @OptIn(ExperimentalPagerApi::class)
45 | @Composable
46 | @Preview(showBackground = true, showSystemUi = true)
47 | fun DefaultPreview() {
48 | val pagerState = rememberPagerState()
49 | JetpackComposeAnimationPlaygroundTheme {
50 | ProductDetailsComponent()
51 | }
52 | }
--------------------------------------------------------------------------------
/foodorder/src/main/java/com/vikas/foodorder/PizzaDataModel.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.foodorder
2 |
3 | import com.vikas.foodorder.R
4 |
5 |
6 | data class PizzaDataModel(val pizzaName: String, val pizzaImage: Int, val pizzaPrice: String) {
7 | companion object {
8 | val list = listOf(
9 | PizzaDataModel("Veggie Salad Bowl", R.drawable.bowl_veggies_2, "$10.00"),
10 | PizzaDataModel("Delicious Fruit Bowl", R.drawable.bowl_fruits, "$12.00"),
11 | PizzaDataModel("Quick Breakfast Bowl", R.drawable.bowl_veggies_1, "$15.00"),
12 | PizzaDataModel("Avocado toast Bowl", R.drawable.bowl_veggies_3, "$20.00"),
13 | PizzaDataModel("Super Broccoli Bowl", R.drawable.bowl_veggies_4, "$15.00"),
14 | PizzaDataModel("Crunchy & Cheesy Pizza", R.drawable.bowl_veggies_5, "$20.00"),
15 | )
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/foodorder/src/main/java/com/vikas/foodorder/ProductCarouselItem.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.foodorder
2 |
3 | import androidx.compose.animation.core.animateFloatAsState
4 | import androidx.compose.animation.core.tween
5 | import androidx.compose.foundation.Image
6 | import androidx.compose.foundation.layout.Arrangement
7 | import androidx.compose.foundation.layout.Column
8 | import androidx.compose.foundation.layout.Spacer
9 | import androidx.compose.foundation.layout.fillMaxSize
10 | import androidx.compose.foundation.layout.fillMaxWidth
11 | import androidx.compose.foundation.layout.height
12 | import androidx.compose.foundation.layout.offset
13 | import androidx.compose.foundation.layout.padding
14 | import androidx.compose.foundation.layout.size
15 | import androidx.compose.foundation.layout.wrapContentHeight
16 | import androidx.compose.foundation.shape.CircleShape
17 | import androidx.compose.foundation.shape.RoundedCornerShape
18 | import androidx.compose.material3.Button
19 | import androidx.compose.material3.ButtonDefaults
20 | import androidx.compose.material3.MaterialTheme
21 | import androidx.compose.material3.Text
22 | import androidx.compose.runtime.Composable
23 | import androidx.compose.runtime.getValue
24 | import androidx.compose.ui.Alignment
25 | import androidx.compose.ui.Modifier
26 | import androidx.compose.ui.draw.alpha
27 | import androidx.compose.ui.draw.shadow
28 | import androidx.compose.ui.graphics.Color
29 | import androidx.compose.ui.graphics.graphicsLayer
30 | import androidx.compose.ui.layout.ContentScale
31 | import androidx.compose.ui.res.painterResource
32 | import androidx.compose.ui.text.font.FontWeight
33 | import androidx.compose.ui.tooling.preview.Preview
34 | import androidx.compose.ui.unit.dp
35 | import androidx.compose.ui.unit.sp
36 | import com.vikas.foodorder.theme.JetpackComposeAnimationPlaygroundTheme
37 |
38 | @Composable
39 | fun ProductCarouselItem(
40 | pizzaModel: PizzaDataModel, pageOffset: Float,
41 | ) {
42 | val angle = Util.lerp(
43 | start = 180f,
44 | stop = 0f,
45 | fraction = 1f - pageOffset.coerceIn(0f, 1f)
46 | )
47 | val imageAngle: Float by animateFloatAsState(
48 | targetValue = angle,
49 |
50 | animationSpec = tween(durationMillis = 600, easing = Util.EaseOutQuart)
51 | )
52 | val offsetX: Float by animateFloatAsState(
53 | targetValue = Util.lerp(
54 | start = 100f,
55 | stop = 0f,
56 | fraction = 1f - pageOffset.coerceIn(0f, 1f)
57 | ),
58 |
59 | animationSpec = tween(durationMillis = 400, easing = Util.EaseOutQuart)
60 | )
61 | val alphaDetails: Float by animateFloatAsState(
62 | targetValue = Util.lerp(
63 | start = 0f,
64 | stop = 1f,
65 | fraction = 1f - pageOffset.coerceIn(0f, 1f)
66 | ),
67 |
68 | animationSpec = tween(durationMillis = 600, easing = Util.EaseOutQuart)
69 | )
70 |
71 | val offsetY: Float by animateFloatAsState(
72 | targetValue = Util.lerp(
73 | start = 100f,
74 | stop = 0f,
75 | fraction = 1f - pageOffset.coerceIn(0f, 1f)
76 | ),
77 |
78 | animationSpec = tween(durationMillis = 600, easing = Util.EaseOutQuart)
79 | )
80 |
81 | val offsetDetailsX: Float by animateFloatAsState(
82 | targetValue = Util.lerp(
83 | start = 200f,
84 | stop = 0f,
85 | fraction = 1f - pageOffset.coerceIn(0f, 1f)
86 | ),
87 |
88 | animationSpec = tween(durationMillis = 800, easing = Util.EaseOutQuart)
89 | )
90 |
91 | Column(
92 | modifier = Modifier.wrapContentHeight(),
93 | horizontalAlignment = Alignment.CenterHorizontally,
94 | verticalArrangement = Arrangement.Center
95 | ) {
96 | Image(
97 | painter = painterResource(id = pizzaModel.pizzaImage),
98 | contentDescription = "Pizza",
99 | modifier = Modifier
100 | .size(240.dp)
101 | .graphicsLayer {
102 | rotationY = imageAngle
103 | translationX = offsetX
104 | translationY = offsetY
105 | }
106 | .shadow(8.dp, shape = CircleShape, spotColor = Color(0xFFE91E63)),
107 | contentScale = ContentScale.Crop
108 | )
109 | Spacer(modifier = Modifier.height(52.dp))
110 | Column(
111 | horizontalAlignment = Alignment.CenterHorizontally,
112 | modifier = Modifier
113 | .alpha(alphaDetails)
114 | .offset(x = offsetDetailsX.dp)
115 | ) {
116 | Text(
117 | text = pizzaModel.pizzaName,
118 | fontSize = 24.sp,
119 | fontWeight = FontWeight.Bold,
120 | color = Color.DarkGray
121 | )
122 | Spacer(modifier = Modifier.height(8.dp))
123 | Text(
124 | text = pizzaModel.pizzaPrice,
125 | style = MaterialTheme.typography.titleMedium,
126 | fontWeight = FontWeight.SemiBold,
127 | color = Color(0xFFE91E63).copy(alpha = 0.7f),
128 | modifier = Modifier
129 | .padding(horizontal = 16.dp)
130 | )
131 | Spacer(modifier = Modifier.height(30.dp))
132 | }
133 | }
134 | }
135 |
136 | @Preview(showBackground = true, showSystemUi = true)
137 | @Composable
138 | fun Preview_ProductCarouselItem() {
139 | JetpackComposeAnimationPlaygroundTheme {
140 | ProductCarouselItem(PizzaDataModel.list.first(), 1f)
141 | }
142 | }
--------------------------------------------------------------------------------
/foodorder/src/main/java/com/vikas/foodorder/ProductDetailsComponent.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.foodorder
2 |
3 | import android.app.Activity
4 | import androidx.compose.animation.core.LinearOutSlowInEasing
5 | import androidx.compose.animation.core.animateDp
6 | import androidx.compose.animation.core.animateFloat
7 | import androidx.compose.animation.core.animateFloatAsState
8 | import androidx.compose.animation.core.tween
9 | import androidx.compose.animation.core.updateTransition
10 | import androidx.compose.foundation.Image
11 | import androidx.compose.foundation.background
12 | import androidx.compose.foundation.clickable
13 | import androidx.compose.foundation.layout.Arrangement
14 | import androidx.compose.foundation.layout.Box
15 | import androidx.compose.foundation.layout.Column
16 | import androidx.compose.foundation.layout.Row
17 | import androidx.compose.foundation.layout.Spacer
18 | import androidx.compose.foundation.layout.fillMaxSize
19 | import androidx.compose.foundation.layout.fillMaxWidth
20 | import androidx.compose.foundation.layout.height
21 | import androidx.compose.foundation.layout.offset
22 | import androidx.compose.foundation.layout.padding
23 | import androidx.compose.foundation.layout.size
24 | import androidx.compose.foundation.shape.RoundedCornerShape
25 | import androidx.compose.material3.Button
26 | import androidx.compose.material3.ButtonDefaults
27 | import androidx.compose.material3.Icon
28 | import androidx.compose.material3.Text
29 | import androidx.compose.runtime.Composable
30 | import androidx.compose.runtime.LaunchedEffect
31 | import androidx.compose.runtime.getValue
32 | import androidx.compose.runtime.mutableStateOf
33 | import androidx.compose.runtime.remember
34 | import androidx.compose.runtime.setValue
35 | import androidx.compose.runtime.snapshotFlow
36 | import androidx.compose.ui.Alignment
37 | import androidx.compose.ui.Modifier
38 | import androidx.compose.ui.draw.alpha
39 | import androidx.compose.ui.draw.blur
40 | import androidx.compose.ui.graphics.Color
41 | import androidx.compose.ui.graphics.graphicsLayer
42 | import androidx.compose.ui.layout.ContentScale
43 | import androidx.compose.ui.platform.LocalContext
44 | import androidx.compose.ui.res.painterResource
45 | import androidx.compose.ui.text.font.FontWeight
46 | import androidx.compose.ui.tooling.preview.Preview
47 | import androidx.compose.ui.unit.dp
48 | import com.google.accompanist.pager.ExperimentalPagerApi
49 | import com.google.accompanist.pager.HorizontalPager
50 | import com.google.accompanist.pager.calculateCurrentOffsetForPage
51 | import com.google.accompanist.pager.rememberPagerState
52 | import com.vikas.foodorder.theme.JetpackComposeAnimationPlaygroundTheme
53 | import kotlin.math.absoluteValue
54 |
55 | @OptIn(ExperimentalPagerApi::class)
56 | @Composable
57 | fun ProductDetailsComponent(list: List = PizzaDataModel.list) {
58 | val context = LocalContext.current
59 | val pagerState = rememberPagerState()
60 | var currentState by remember { mutableStateOf(ButtonState.Details) }
61 | val transition = updateTransition(currentState, label = "button state")
62 | val transitionAlpha by transition.animateFloat(
63 | transitionSpec = {
64 | tween(durationMillis = 500)
65 | }, label = ""
66 | ) {
67 | if (it == ButtonState.AddToCart) 1f else 0f
68 | }
69 | val transitionAlphaButton by transition.animateFloat(
70 | transitionSpec = {
71 | tween(durationMillis = 500)
72 | }, label = ""
73 | ) {
74 | if (it == ButtonState.Details) 1f else 0f
75 | }
76 |
77 | val transitionSize by transition.animateFloat(
78 | transitionSpec = {
79 | tween(durationMillis = 500)
80 | }, label = ""
81 | ) {
82 | if (it == ButtonState.AddToCart) {
83 | 1f
84 | } else {
85 | 0f
86 | }
87 | }
88 |
89 | val transitionSizeButton by transition.animateDp(
90 | transitionSpec = {
91 | tween(durationMillis = 500)
92 | }, label = ""
93 | ) {
94 | if (it == ButtonState.Details) {
95 | 56.dp
96 | } else {
97 | 0.dp
98 | }
99 | }
100 |
101 | var backgroundImage by remember { mutableStateOf(0) }
102 |
103 | val alphaAnim = animateFloatAsState(
104 | targetValue = Util.lerp(
105 | start = 0f, stop = 1f, fraction = 1f - pagerState.currentPageOffset.coerceIn(0f, 1f)
106 | ), animationSpec = tween(durationMillis = 700, easing = LinearOutSlowInEasing)
107 | )
108 |
109 | val offsetX: Float by animateFloatAsState(
110 | targetValue = Util.lerp(
111 | start = 400f, stop = 0f, fraction = 1f - pagerState.currentPageOffset.coerceIn(0f, 1f)
112 | ),
113 |
114 | animationSpec = tween(durationMillis = 500, easing = Util.EaseOutQuart)
115 | )
116 |
117 | LaunchedEffect(pagerState) {
118 | snapshotFlow { pagerState.currentPage }.collect { page ->
119 | backgroundImage = page
120 | }
121 | }
122 |
123 | Box(modifier = Modifier.fillMaxSize()) {
124 | Image(painter = painterResource(id = list[backgroundImage].pizzaImage),
125 | contentDescription = "Pizza",
126 | modifier = Modifier
127 | .size(400.dp)
128 | .offset(y = (-100).dp)
129 | .graphicsLayer {
130 | translationX = offsetX
131 | }
132 | .alpha(alphaAnim.value)
133 | .blur(4.dp),
134 | contentScale = ContentScale.Crop)
135 |
136 | Image(
137 | painter = painterResource(id = R.drawable.veggie_101),
138 | contentDescription = "food background",
139 | contentScale = ContentScale.Crop,
140 | modifier = Modifier
141 | .fillMaxWidth()
142 | .align(Alignment.BottomCenter)
143 | .offset(y = 150.dp),
144 | )
145 |
146 | Box(
147 | Modifier
148 | .background(color = Color.White.copy(alpha = .7f))
149 | .fillMaxSize()
150 | )
151 |
152 | Row(verticalAlignment = Alignment.CenterVertically) {
153 | Icon(
154 | painter = painterResource(id = R.drawable.ic_back),
155 | contentDescription = "close",
156 | modifier = Modifier
157 | .padding(16.dp)
158 | .size(32.dp)
159 | .clickable {
160 | (context as Activity).finish()
161 | }
162 | )
163 | Spacer(modifier = Modifier.weight(1f))
164 | Icon(
165 | painter = painterResource(id = R.drawable.ic_cart),
166 | contentDescription = "cart",
167 | modifier = Modifier
168 | .padding(16.dp)
169 | .size(32.dp)
170 | )
171 | }
172 |
173 | when (currentState) {
174 | ButtonState.Details -> {
175 | Column(
176 | modifier = Modifier.fillMaxSize(),
177 | verticalArrangement = Arrangement.Center,
178 | horizontalAlignment = Alignment.CenterHorizontally
179 | ) {
180 | HorizontalPager(
181 | count = list.size,
182 | state = pagerState,
183 | modifier = Modifier.alpha(transitionAlphaButton)
184 | ) { page ->
185 | val pageOffset = calculateCurrentOffsetForPage(page).absoluteValue
186 | ProductCarouselItem(list[page], pageOffset)
187 | }
188 |
189 | Button(
190 | onClick = { currentState = ButtonState.AddToCart },
191 | modifier = Modifier
192 | .padding(horizontal = 24.dp)
193 | .fillMaxWidth()
194 | .height(transitionSizeButton)
195 | .padding(horizontal = 16.dp),
196 | shape = RoundedCornerShape(15),
197 | colors = ButtonDefaults.buttonColors(
198 | containerColor = Color.Black, contentColor = Color.White
199 | )
200 | ) {
201 | Text(text = "Add To Cart", modifier = Modifier.padding(8.dp))
202 | }
203 |
204 | Spacer(modifier = Modifier.height(16.dp))
205 |
206 | Text(
207 | text = "Swipe to see more",
208 | color = Color.Gray.copy(alpha = .8f),
209 | fontWeight = FontWeight.SemiBold,
210 | modifier = Modifier.padding(horizontal = 16.dp)
211 | )
212 | }
213 | }
214 |
215 | ButtonState.AddToCart -> {
216 | AddToCartComponent(list[backgroundImage], transitionAlpha, transitionSize) {
217 | currentState = ButtonState.Details
218 | }
219 | }
220 | }
221 | }
222 | }
223 |
224 |
225 | @Preview(showSystemUi = true, showBackground = true)
226 | @Composable
227 | fun Preview_ProductDetailsComponent() {
228 | JetpackComposeAnimationPlaygroundTheme {
229 | ProductDetailsComponent()
230 | }
231 | }
--------------------------------------------------------------------------------
/foodorder/src/main/java/com/vikas/foodorder/ProductState.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.foodorder
2 |
3 | enum class ButtonState {
4 | Details, AddToCart
5 | }
--------------------------------------------------------------------------------
/foodorder/src/main/java/com/vikas/foodorder/SampleComponent.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.foodorder
2 |
3 | import android.os.Build
4 | import androidx.annotation.RequiresApi
5 | import androidx.compose.animation.core.*
6 | import androidx.compose.foundation.Canvas
7 | import androidx.compose.foundation.layout.*
8 | import androidx.compose.material.*
9 | import androidx.compose.runtime.*
10 | import androidx.compose.ui.Modifier
11 | import androidx.compose.ui.geometry.Offset
12 | import androidx.compose.ui.geometry.Size
13 | import androidx.compose.ui.graphics.*
14 | import androidx.compose.ui.graphics.drawscope.Stroke
15 | import androidx.compose.ui.unit.Dp
16 | import androidx.compose.ui.unit.dp
17 | import androidx.compose.ui.unit.sp
18 | import java.time.Duration
19 |
20 | @RequiresApi(Build.VERSION_CODES.O)
21 | @Composable
22 | fun CircleOnCurve() {
23 | var progress by remember { mutableStateOf(0f) }
24 |
25 | // val animationSpec = infiniteRepeatable(
26 | // animation = tween(
27 | // durationMillis = 2000,
28 | // easing = LinearEasing
29 | // )
30 | // )
31 |
32 | // LaunchedEffect(Unit) {
33 | // while (true) {
34 | // withFrameNanos { nanoTime ->
35 | // progress = animationSpec.animateTo(
36 | // targetValue = 1f,
37 | // initialVelocity = 0f,
38 | // frameTimeMillis = Duration.ofNanos(nanoTime).toMillis()
39 | // ).value
40 | // }
41 | // }
42 | // }
43 |
44 | Box(modifier = Modifier.fillMaxSize()) {
45 | Canvas(modifier = Modifier.fillMaxSize()) {
46 | val path = Path().apply {
47 | moveTo(size.width / 4, size.height / 4)
48 | quadraticBezierTo(
49 | 0f,
50 | 400f,
51 | size.width,
52 | 400f,
53 | )
54 | }
55 | drawPath(path, brush = SolidColor(Color.LightGray), style = Stroke(width = 8.dp.toPx()))
56 |
57 | // val circlePosition = pathMeasure(path, false, progress)
58 |
59 | // drawCircle(
60 | // color = Color.Red,
61 | // radius = 20.dp.toPx(),
62 | // center = Offset(circlePosition.x, circlePosition.y)
63 | // )
64 | }
65 | }
66 | }
67 |
68 |
69 | //private fun pathMeasure(path: Path, forceClosed: Boolean, progress: Float): Offset {
70 | // val pathMeasure = PathMeasure(path, forceClosed)
71 | // val pos = FloatArray(2)
72 | // val tan = FloatArray(2)
73 | // pathMeasure.getPosTan(pathMeasure.length * progress, pos, tan)
74 | // return Offset(pos[0], pos[1])
75 | //}
76 |
--------------------------------------------------------------------------------
/foodorder/src/main/java/com/vikas/foodorder/Util.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.foodorder
2 |
3 | import androidx.compose.animation.core.CubicBezierEasing
4 |
5 | object Util {
6 |
7 | fun lerp(start: Float, stop: Float, fraction: Float): Float =
8 | (1 - fraction) * start + fraction * stop
9 |
10 | val EaseOutQuart = CubicBezierEasing(0.25f, 1f, 0.5f, 1f)
11 |
12 | }
--------------------------------------------------------------------------------
/foodorder/src/main/java/com/vikas/foodorder/theme/Color.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.foodorder.theme
2 |
3 | import androidx.compose.ui.graphics.Color
4 |
5 | val Purple200 = Color(0xFFBB86FC)
6 | val Purple500 = Color(0xFF6200EE)
7 | val Purple700 = Color(0xFF3700B3)
8 | val Teal200 = Color(0xFF03DAC5)
9 |
10 | val textColor = Color(0xFF101820)
11 | val accentColor = Color(0xFFeb4658)
--------------------------------------------------------------------------------
/foodorder/src/main/java/com/vikas/foodorder/theme/Shape.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.foodorder.theme
2 |
3 | import androidx.compose.foundation.shape.RoundedCornerShape
4 | import androidx.compose.material.Shapes
5 | import androidx.compose.ui.unit.dp
6 |
7 | val Shapes = Shapes(
8 | small = RoundedCornerShape(4.dp),
9 | medium = RoundedCornerShape(4.dp),
10 | large = RoundedCornerShape(0.dp)
11 | )
--------------------------------------------------------------------------------
/foodorder/src/main/java/com/vikas/foodorder/theme/Theme.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.foodorder.theme
2 |
3 | import androidx.compose.foundation.isSystemInDarkTheme
4 | import androidx.compose.material.MaterialTheme
5 | import androidx.compose.material.darkColors
6 | import androidx.compose.material.lightColors
7 | import androidx.compose.runtime.Composable
8 |
9 | private val DarkColorPalette = darkColors(
10 | primary = Purple200,
11 | primaryVariant = Purple700,
12 | secondary = Teal200
13 | )
14 |
15 | private val LightColorPalette = lightColors(
16 | primary = Purple500,
17 | primaryVariant = Purple700,
18 | secondary = Teal200
19 |
20 | /* Other default colors to override
21 | background = Color.White,
22 | surface = Color.White,
23 | onPrimary = Color.White,
24 | onSecondary = Color.Black,
25 | onBackground = Color.Black,
26 | onSurface = Color.Black,
27 | */
28 | )
29 |
30 | @Composable
31 | fun JetpackComposeAnimationPlaygroundTheme(
32 | darkTheme: Boolean = isSystemInDarkTheme(),
33 | content: @Composable () -> Unit
34 | ) {
35 | val colors = if (darkTheme) {
36 | DarkColorPalette
37 | } else {
38 | LightColorPalette
39 | }
40 |
41 | MaterialTheme(
42 | colors = colors,
43 | typography = Typography,
44 | shapes = Shapes,
45 | content = content
46 | )
47 | }
--------------------------------------------------------------------------------
/foodorder/src/main/java/com/vikas/foodorder/theme/Type.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.foodorder.theme
2 |
3 | import androidx.compose.material.Typography
4 | import androidx.compose.ui.text.TextStyle
5 | import androidx.compose.ui.text.font.FontFamily
6 | import androidx.compose.ui.text.font.FontWeight
7 | import androidx.compose.ui.unit.sp
8 |
9 | // Set of Material typography styles to start with
10 | val Typography = Typography(
11 | body1 = TextStyle(
12 | fontFamily = FontFamily.Default,
13 | fontWeight = FontWeight.Normal,
14 | fontSize = 16.sp
15 | )
16 | /* Other default text styles to override
17 | button = TextStyle(
18 | fontFamily = FontFamily.Default,
19 | fontWeight = FontWeight.W500,
20 | fontSize = 14.sp
21 | ),
22 | caption = TextStyle(
23 | fontFamily = FontFamily.Default,
24 | fontWeight = FontWeight.Normal,
25 | fontSize = 12.sp
26 | )
27 | */
28 | )
--------------------------------------------------------------------------------
/foodorder/src/main/res/drawable-nodpi/bowl_fruits.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/foodorder/src/main/res/drawable-nodpi/bowl_fruits.webp
--------------------------------------------------------------------------------
/foodorder/src/main/res/drawable-nodpi/bowl_veggies_1.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/foodorder/src/main/res/drawable-nodpi/bowl_veggies_1.webp
--------------------------------------------------------------------------------
/foodorder/src/main/res/drawable-nodpi/bowl_veggies_2.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/foodorder/src/main/res/drawable-nodpi/bowl_veggies_2.webp
--------------------------------------------------------------------------------
/foodorder/src/main/res/drawable-nodpi/bowl_veggies_3.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/foodorder/src/main/res/drawable-nodpi/bowl_veggies_3.webp
--------------------------------------------------------------------------------
/foodorder/src/main/res/drawable-nodpi/bowl_veggies_4.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/foodorder/src/main/res/drawable-nodpi/bowl_veggies_4.webp
--------------------------------------------------------------------------------
/foodorder/src/main/res/drawable-nodpi/bowl_veggies_5.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/foodorder/src/main/res/drawable-nodpi/bowl_veggies_5.webp
--------------------------------------------------------------------------------
/foodorder/src/main/res/drawable-nodpi/ic_verified.xml:
--------------------------------------------------------------------------------
1 |
6 |
11 |
14 |
15 |
--------------------------------------------------------------------------------
/foodorder/src/main/res/drawable-nodpi/veggie_101.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/foodorder/src/main/res/drawable-nodpi/veggie_101.jpg
--------------------------------------------------------------------------------
/foodorder/src/main/res/drawable/ic_back.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/foodorder/src/main/res/drawable/ic_cart.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/foodorder/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFBB86FC
4 | #FF6200EE
5 | #FF3700B3
6 | #FF03DAC5
7 | #FF018786
8 | #FF000000
9 | #FFFFFFFF
10 |
--------------------------------------------------------------------------------
/foodorder/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | ShoeApp
3 |
--------------------------------------------------------------------------------
/foodorder/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
--------------------------------------------------------------------------------
/foodorder/src/test/java/com/vikas/pizzaorder/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.pizzaorder
2 |
3 | import org.junit.Test
4 |
5 | import org.junit.Assert.*
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * See [testing documentation](http://d.android.com/tools/testing).
11 | */
12 | class ExampleUnitTest {
13 | @Test
14 | fun addition_isCorrect() {
15 | assertEquals(4, 2 + 2)
16 | }
17 | }
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app's APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Kotlin code style for this project: "official" or "obsolete":
19 | kotlin.code.style=official
20 | # Enables namespacing of each library's R class so that its R class includes only the
21 | # resources declared in the library itself and none from the library's dependencies,
22 | # thereby reducing the size of the R class for that library
23 | android.nonTransitiveRClass=true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Thu Dec 08 23:47:15 IST 2022
2 | distributionBase=GRADLE_USER_HOME
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
4 | distributionPath=wrapper/dists
5 | zipStorePath=wrapper/dists
6 | zipStoreBase=GRADLE_USER_HOME
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | #
4 | # Copyright 2015 the original author or authors.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # https://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | ##############################################################################
20 | ##
21 | ## Gradle start up script for UN*X
22 | ##
23 | ##############################################################################
24 |
25 | # Attempt to set APP_HOME
26 | # Resolve links: $0 may be a link
27 | PRG="$0"
28 | # Need this for relative symlinks.
29 | while [ -h "$PRG" ] ; do
30 | ls=`ls -ld "$PRG"`
31 | link=`expr "$ls" : '.*-> \(.*\)$'`
32 | if expr "$link" : '/.*' > /dev/null; then
33 | PRG="$link"
34 | else
35 | PRG=`dirname "$PRG"`"/$link"
36 | fi
37 | done
38 | SAVED="`pwd`"
39 | cd "`dirname \"$PRG\"`/" >/dev/null
40 | APP_HOME="`pwd -P`"
41 | cd "$SAVED" >/dev/null
42 |
43 | APP_NAME="Gradle"
44 | APP_BASE_NAME=`basename "$0"`
45 |
46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
48 |
49 | # Use the maximum available, or set MAX_FD != -1 to use that value.
50 | MAX_FD="maximum"
51 |
52 | warn () {
53 | echo "$*"
54 | }
55 |
56 | die () {
57 | echo
58 | echo "$*"
59 | echo
60 | exit 1
61 | }
62 |
63 | # OS specific support (must be 'true' or 'false').
64 | cygwin=false
65 | msys=false
66 | darwin=false
67 | nonstop=false
68 | case "`uname`" in
69 | CYGWIN* )
70 | cygwin=true
71 | ;;
72 | Darwin* )
73 | darwin=true
74 | ;;
75 | MINGW* )
76 | msys=true
77 | ;;
78 | NONSTOP* )
79 | nonstop=true
80 | ;;
81 | esac
82 |
83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
84 |
85 |
86 | # Determine the Java command to use to start the JVM.
87 | if [ -n "$JAVA_HOME" ] ; then
88 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
89 | # IBM's JDK on AIX uses strange locations for the executables
90 | JAVACMD="$JAVA_HOME/jre/sh/java"
91 | else
92 | JAVACMD="$JAVA_HOME/bin/java"
93 | fi
94 | if [ ! -x "$JAVACMD" ] ; then
95 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
96 |
97 | Please set the JAVA_HOME variable in your environment to match the
98 | location of your Java installation."
99 | fi
100 | else
101 | JAVACMD="java"
102 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
103 |
104 | Please set the JAVA_HOME variable in your environment to match the
105 | location of your Java installation."
106 | fi
107 |
108 | # Increase the maximum file descriptors if we can.
109 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
110 | MAX_FD_LIMIT=`ulimit -H -n`
111 | if [ $? -eq 0 ] ; then
112 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
113 | MAX_FD="$MAX_FD_LIMIT"
114 | fi
115 | ulimit -n $MAX_FD
116 | if [ $? -ne 0 ] ; then
117 | warn "Could not set maximum file descriptor limit: $MAX_FD"
118 | fi
119 | else
120 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
121 | fi
122 | fi
123 |
124 | # For Darwin, add options to specify how the application appears in the dock
125 | if $darwin; then
126 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
127 | fi
128 |
129 | # For Cygwin or MSYS, switch paths to Windows format before running java
130 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
131 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
132 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
133 |
134 | JAVACMD=`cygpath --unix "$JAVACMD"`
135 |
136 | # We build the pattern for arguments to be converted via cygpath
137 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
138 | SEP=""
139 | for dir in $ROOTDIRSRAW ; do
140 | ROOTDIRS="$ROOTDIRS$SEP$dir"
141 | SEP="|"
142 | done
143 | OURCYGPATTERN="(^($ROOTDIRS))"
144 | # Add a user-defined pattern to the cygpath arguments
145 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
146 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
147 | fi
148 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
149 | i=0
150 | for arg in "$@" ; do
151 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
152 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
153 |
154 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
155 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
156 | else
157 | eval `echo args$i`="\"$arg\""
158 | fi
159 | i=`expr $i + 1`
160 | done
161 | case $i in
162 | 0) set -- ;;
163 | 1) set -- "$args0" ;;
164 | 2) set -- "$args0" "$args1" ;;
165 | 3) set -- "$args0" "$args1" "$args2" ;;
166 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
167 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
168 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
169 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
170 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
171 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
172 | esac
173 | fi
174 |
175 | # Escape application args
176 | save () {
177 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
178 | echo " "
179 | }
180 | APP_ARGS=`save "$@"`
181 |
182 | # Collect all arguments for the java command, following the shell quoting and substitution rules
183 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
184 |
185 | exec "$JAVACMD" "$@"
186 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34 |
35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
37 |
38 | @rem Find java.exe
39 | if defined JAVA_HOME goto findJavaFromJavaHome
40 |
41 | set JAVA_EXE=java.exe
42 | %JAVA_EXE% -version >NUL 2>&1
43 | if "%ERRORLEVEL%" == "0" goto execute
44 |
45 | echo.
46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47 | echo.
48 | echo Please set the JAVA_HOME variable in your environment to match the
49 | echo location of your Java installation.
50 |
51 | goto fail
52 |
53 | :findJavaFromJavaHome
54 | set JAVA_HOME=%JAVA_HOME:"=%
55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56 |
57 | if exist "%JAVA_EXE%" goto execute
58 |
59 | echo.
60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61 | echo.
62 | echo Please set the JAVA_HOME variable in your environment to match the
63 | echo location of your Java installation.
64 |
65 | goto fail
66 |
67 | :execute
68 | @rem Setup the command line
69 |
70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
71 |
72 |
73 | @rem Execute Gradle
74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
75 |
76 | :end
77 | @rem End local scope for the variables with windows NT shell
78 | if "%ERRORLEVEL%"=="0" goto mainEnd
79 |
80 | :fail
81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
82 | rem the _cmd.exe /c_ return code!
83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84 | exit /b 1
85 |
86 | :mainEnd
87 | if "%OS%"=="Windows_NT" endlocal
88 |
89 | :omega
90 |
--------------------------------------------------------------------------------
/local.properties:
--------------------------------------------------------------------------------
1 | ## This file is automatically generated by Android Studio.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file should *NOT* be checked into Version Control Systems,
5 | # as it contains information specific to your local configuration.
6 | #
7 | # Location of the SDK. This is only used by Gradle.
8 | # For customization when using a Version Control System, please read the
9 | # header note.
10 | sdk.dir=/Users/vikaskumar/Library/Android/sdk
--------------------------------------------------------------------------------
/screenshots/screenshot_101.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/screenshots/screenshot_101.png
--------------------------------------------------------------------------------
/screenshots/screenshot_102.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/screenshots/screenshot_102.png
--------------------------------------------------------------------------------
/screenshots/screenshot_103.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/screenshots/screenshot_103.png
--------------------------------------------------------------------------------
/screenshots/screenshot_104.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/screenshots/screenshot_104.png
--------------------------------------------------------------------------------
/screenshots/screenshot_105.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/screenshots/screenshot_105.png
--------------------------------------------------------------------------------
/screenshots/screenshot_106.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/screenshots/screenshot_106.png
--------------------------------------------------------------------------------
/screenshots/screenshot_107.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/screenshots/screenshot_107.png
--------------------------------------------------------------------------------
/screenshots/screenshot_108.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/screenshots/screenshot_108.png
--------------------------------------------------------------------------------
/screenshots/screenshot_109.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/screenshots/screenshot_109.gif
--------------------------------------------------------------------------------
/screenshots/screenshot_110.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/screenshots/screenshot_110.gif
--------------------------------------------------------------------------------
/screenshots/screenshot_111.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/screenshots/screenshot_111.png
--------------------------------------------------------------------------------
/screenshots/screenshot_112.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/screenshots/screenshot_112.png
--------------------------------------------------------------------------------
/screenshots/screenshot_113.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/screenshots/screenshot_113.gif
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | repositories {
3 | google()
4 | mavenCentral()
5 | gradlePluginPortal()
6 | }
7 | }
8 | dependencyResolutionManagement {
9 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
10 | repositories {
11 | google()
12 | mavenCentral()
13 | }
14 | }
15 | rootProject.name = "Jetpack Compose Animation Playground"
16 | include ':app'
17 | include ':shoeapp'
18 | include ':foodorder'
19 |
--------------------------------------------------------------------------------
/shoeapp/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/shoeapp/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.library'
3 | id 'org.jetbrains.kotlin.android'
4 | }
5 |
6 | android {
7 | namespace 'com.vikas.shoeapp'
8 | compileSdk 33
9 |
10 | defaultConfig {
11 | minSdk 21
12 | targetSdk 33
13 | versionCode 1
14 | versionName "1.0"
15 |
16 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
17 | vectorDrawables {
18 | useSupportLibrary true
19 | }
20 | }
21 |
22 | buildTypes {
23 | release {
24 | minifyEnabled false
25 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
26 | }
27 | }
28 | compileOptions {
29 | sourceCompatibility JavaVersion.VERSION_1_8
30 | targetCompatibility JavaVersion.VERSION_1_8
31 | }
32 | kotlinOptions {
33 | jvmTarget = '1.8'
34 | }
35 | buildFeatures {
36 | compose true
37 | }
38 | composeOptions {
39 | kotlinCompilerExtensionVersion '1.2.0'
40 | }
41 | packagingOptions {
42 | resources {
43 | excludes += '/META-INF/{AL2.0,LGPL2.1}'
44 | }
45 | }
46 | }
47 |
48 | dependencies {
49 |
50 | implementation 'androidx.core:core-ktx:1.9.0'
51 | implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1'
52 | implementation 'androidx.activity:activity-compose:1.6.1'
53 | implementation "androidx.compose.ui:ui:$compose_version"
54 | implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
55 | implementation 'androidx.compose.material:material:1.3.1'
56 | testImplementation 'junit:junit:4.13.2'
57 | implementation 'androidx.compose.material3:material3:1.1.0-alpha03'
58 | androidTestImplementation 'androidx.test.ext:junit:1.1.4'
59 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
60 | androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
61 | debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
62 | debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
63 | implementation "com.google.accompanist:accompanist-pager:0.28.0"
64 | }
--------------------------------------------------------------------------------
/shoeapp/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/shoeapp/src/androidTest/java/com/vikas/shoeapp/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.shoeapp
2 |
3 | import androidx.test.platform.app.InstrumentationRegistry
4 | import androidx.test.ext.junit.runners.AndroidJUnit4
5 |
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | import org.junit.Assert.*
10 |
11 | /**
12 | * Instrumented test, which will execute on an Android device.
13 | *
14 | * See [testing documentation](http://d.android.com/tools/testing).
15 | */
16 | @RunWith(AndroidJUnit4::class)
17 | class ExampleInstrumentedTest {
18 | @Test
19 | fun useAppContext() {
20 | // Context of the app under test.
21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22 | assertEquals("com.vikas.shoeapp", appContext.packageName)
23 | }
24 | }
--------------------------------------------------------------------------------
/shoeapp/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/shoeapp/src/main/java/com/vikas/shoeapp/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.shoeapp
2 |
3 | import android.content.Context
4 | import android.content.Intent
5 | import android.os.Bundle
6 | import androidx.activity.ComponentActivity
7 | import androidx.activity.compose.setContent
8 | import androidx.activity.viewModels
9 | import androidx.compose.animation.Crossfade
10 | import androidx.compose.foundation.Image
11 | import androidx.compose.foundation.background
12 | import androidx.compose.foundation.clickable
13 | import androidx.compose.foundation.layout.*
14 | import androidx.compose.foundation.shape.CircleShape
15 | import androidx.compose.material3.MaterialTheme.colorScheme
16 | import androidx.compose.material3.Surface
17 | import androidx.compose.material3.Text
18 | import androidx.compose.runtime.*
19 | import androidx.compose.ui.Alignment
20 | import androidx.compose.ui.Modifier
21 | import androidx.compose.ui.graphics.Color
22 | import androidx.compose.ui.graphics.ColorFilter
23 | import androidx.compose.ui.res.painterResource
24 | import androidx.compose.ui.text.font.FontWeight
25 | import androidx.compose.ui.text.style.TextAlign
26 | import androidx.compose.ui.tooling.preview.Preview
27 | import androidx.compose.ui.unit.dp
28 | import androidx.compose.ui.unit.sp
29 | import com.vikas.shoeapp.R
30 | import com.vikas.shoeapp.ui.home.BottomNav
31 | import com.vikas.shoeapp.ui.home.DetailComponent
32 | import com.vikas.shoeapp.ui.home.HomeComponent
33 | import com.vikas.shoeapp.ui.home.MainViewModel
34 | import com.vikas.shoeapp.ui.theme.JetpackComposeAnimationPlaygroundTheme
35 | import com.vikas.shoeapp.ui.theme.accentColor
36 | import com.vikas.shoeapp.ui.theme.textColor
37 |
38 | class MainActivity : ComponentActivity() {
39 |
40 | private val viewModel: MainViewModel by viewModels()
41 |
42 | override fun onCreate(savedInstanceState: Bundle?) {
43 | super.onCreate(savedInstanceState)
44 | setContent {
45 | JetpackComposeAnimationPlaygroundTheme {
46 | val screenState by remember { viewModel.screenState }
47 | Surface(
48 | modifier = Modifier.fillMaxSize(),
49 | color = colorScheme.background
50 | ) {
51 | Crossfade(targetState = screenState) { state ->
52 | when (state) {
53 | is MainViewModel.UiState.Home -> {
54 | DashboardComponent(viewModel)
55 | }
56 | is MainViewModel.UiState.Details -> {
57 | DetailComponent(
58 | state.carouselDataModel,
59 | viewModel
60 | )
61 | }
62 | }
63 | }
64 | }
65 | }
66 | }
67 | }
68 |
69 | companion object {
70 | fun getIntent(context: Context): Intent {
71 | return Intent(context, MainActivity::class.java)
72 | }
73 | }
74 | }
75 |
76 | @Composable
77 | fun DashboardComponent(viewModel: MainViewModel) {
78 | val screen = remember { mutableStateOf(BottomNav.Home) }
79 | Column(
80 | modifier = Modifier.fillMaxSize()
81 | ) {
82 |
83 | HomeToolbar()
84 |
85 | Column(
86 | modifier = Modifier.weight(1f),
87 | verticalArrangement = Arrangement.Center,
88 | horizontalAlignment = Alignment.CenterHorizontally
89 | ) {
90 | when (screen.value) {
91 | BottomNav.Home -> HomeComponent(viewModel)
92 | else -> {
93 | Text(
94 | text = "Coming Soon",
95 | fontWeight = FontWeight.Bold,
96 | fontSize = 32.sp,
97 | textAlign = TextAlign.Center,
98 | modifier = Modifier.fillMaxWidth(),
99 | color = textColor
100 | )
101 | }
102 | }
103 | }
104 |
105 | BottomToolbar(screen)
106 | }
107 | }
108 |
109 | @Composable
110 | fun BottomToolbar(screen: MutableState) {
111 | Row(
112 | verticalAlignment = Alignment.CenterVertically,
113 | modifier = Modifier
114 | .fillMaxWidth()
115 | .padding(start = 16.dp, end = 16.dp, bottom = 8.dp),
116 | horizontalArrangement = Arrangement.SpaceAround
117 | ) {
118 | BottomNav.values().forEach { nav ->
119 | Image(
120 | painter = painterResource(id = nav.icon),
121 | contentDescription = "search",
122 | modifier = Modifier
123 | .padding(4.dp)
124 | .size(36.dp)
125 | .padding(6.dp)
126 | .clickable {
127 | screen.value = nav
128 | },
129 | colorFilter = if (screen.value == nav) {
130 | ColorFilter.tint(accentColor)
131 | } else {
132 | ColorFilter.tint(Color.LightGray)
133 | }
134 | )
135 | }
136 | }
137 | }
138 |
139 | @Composable
140 | fun HomeToolbar() {
141 | Row(
142 | modifier = Modifier
143 | .fillMaxWidth()
144 | .padding(20.dp),
145 | verticalAlignment = Alignment.CenterVertically
146 | ) {
147 | Text(
148 | text = "Discover",
149 | fontWeight = FontWeight.Bold,
150 | fontSize = 26.sp,
151 | color = textColor
152 | )
153 |
154 | Spacer(modifier = Modifier.weight(1f))
155 |
156 | Image(
157 | painter = painterResource(id = R.drawable.ic_search),
158 | contentDescription = "search",
159 | modifier = Modifier
160 | .padding(6.dp)
161 | .size(32.dp)
162 | .background(color = Color.LightGray.copy(alpha = .2f), shape = CircleShape)
163 | .padding(8.dp)
164 | )
165 |
166 | Image(
167 | painter = painterResource(id = R.drawable.ic_notification),
168 | contentDescription = "search",
169 | modifier = Modifier
170 | .padding(6.dp)
171 | .size(32.dp)
172 | .background(color = Color.LightGray.copy(alpha = .2f), shape = CircleShape)
173 | .padding(8.dp)
174 | )
175 |
176 | }
177 | }
178 |
179 | @Preview(showBackground = true, showSystemUi = true)
180 | @Composable
181 | fun DefaultPreview() {
182 | JetpackComposeAnimationPlaygroundTheme {
183 | DashboardComponent(MainViewModel())
184 | }
185 | }
--------------------------------------------------------------------------------
/shoeapp/src/main/java/com/vikas/shoeapp/data/CarouselDataModel.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.shoeapp.data
2 |
3 | import androidx.compose.ui.graphics.Color
4 | import com.vikas.shoeapp.R
5 |
6 | data class CarouselDataModel(
7 | val resId: Int,
8 | val title: String,
9 | val description: String,
10 | val price: String,
11 | val color: Color,
12 | val aboutProduct: String = "Meet the $description TW. Inspired by the treasured franchise that brought $description cushioning to the world and laid the foundation for the aesthetic."
13 | ) {
14 | companion object {
15 |
16 | val listOfShoes = mutableListOf().apply {
17 | add(
18 | CarouselDataModel(
19 | resId = R.drawable.nike_100,
20 | title = "Nike",
21 | description = "Airmax 100",
22 | price = "₹ 15,000",
23 | color = Color(0xFFeb4658)
24 | )
25 | )
26 | add(
27 | CarouselDataModel(
28 | resId = R.drawable.reebok_102,
29 | title = "Reebok",
30 | description = "Epic React 2",
31 | price = "₹ 20,000",
32 | color = Color(0xFF6887cb)
33 | )
34 | )
35 | add(
36 | CarouselDataModel(
37 | resId = R.drawable.under_103,
38 | title = "Under Armour",
39 | description = "Hovr 2022",
40 | price = "₹ 10,000",
41 | color = Color(0xFFfe7153)
42 | )
43 | )
44 | add(
45 | CarouselDataModel(
46 | resId = R.drawable.adidas_104,
47 | title = "Adidas",
48 | description = "Supernova 200",
49 | price = "₹ 6,500",
50 | color = Color(0xFF45bfff)
51 | )
52 | )
53 | add(
54 | CarouselDataModel(
55 | resId = R.drawable.under_armour_105,
56 | title = "Under Armour",
57 | description = "Hovr 1000",
58 | price = "₹ 25,300",
59 | color = Color(0xFFAFCA71)
60 | )
61 | )
62 | add(
63 | CarouselDataModel(
64 | resId = R.drawable.adidas_s100,
65 | title = "Adidas",
66 | description = "Adidas s100",
67 | price = "₹ 12,000",
68 | color = Color(0xFFBBA45C)
69 | )
70 | )
71 | }
72 |
73 | val categories = listOf("New", "Featured", "Trending")
74 | }
75 |
76 | }
77 |
--------------------------------------------------------------------------------
/shoeapp/src/main/java/com/vikas/shoeapp/data/TrendingProduct.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.shoeapp.data
2 |
3 | import com.vikas.shoeapp.R
4 |
5 |
6 | data class TrendingProduct(val name: String, val price: String, val image: Int) {
7 | companion object {
8 | val list = listOf(
9 | TrendingProduct("Under Armour Phantom", "₹33000", R.drawable.armour_phantom),
10 | TrendingProduct("Under Armour 109", "₹19000", R.drawable.under_1031),
11 | TrendingProduct("Nike Air Max 270", "₹12000", R.drawable.adidas_1032),
12 | TrendingProduct("Adidas Neo", "₹15000", R.drawable.shoe_101),
13 | TrendingProduct("Roadster", "₹2300", R.drawable.roaster_100),
14 | )
15 | }
16 | }
17 |
18 | data class CartDataModel(
19 | val id: Int,
20 | val name: String,
21 | val price: Int,
22 | val image: Int,
23 | var quantity: Int = 1,
24 |
25 | ) {
26 | companion object {
27 | val list = listOf(
28 | CartDataModel(id = 101, "Nike Air Max 270", 12000, R.drawable.adidas_1032),
29 | CartDataModel(id = 102, "Under Armour 109", 19000, R.drawable.under_1031),
30 | CartDataModel(id = 103, "Under Armour Phantom", 33000, R.drawable.armour_phantom),
31 | CartDataModel(id = 104, "Adidas Neo", 15000, R.drawable.shoe_101),
32 | CartDataModel(id = 105, "Roadster Sneaker", 2300, R.drawable.roaster_100),
33 | )
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/shoeapp/src/main/java/com/vikas/shoeapp/ui/home/BottomNav.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.shoeapp.ui.home
2 |
3 | import com.vikas.shoeapp.R
4 |
5 | enum class BottomNav(val route: String, val icon: Int, val title: String) {
6 | Home("home", R.drawable.ic_home, "Home"),
7 | Search("favorite", R.drawable.ic_heart, "Favorite"),
8 | Profile("profile", R.drawable.ic_profile, "Profile"),
9 | Favorites("cart", R.drawable.ic_shop, "Cart"),
10 | Settings("settings", R.drawable.ic_settings, "Settings")
11 | }
--------------------------------------------------------------------------------
/shoeapp/src/main/java/com/vikas/shoeapp/ui/home/MainViewModel.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.shoeapp.ui.home
2 |
3 | import androidx.compose.runtime.mutableStateOf
4 | import androidx.lifecycle.ViewModel
5 | import androidx.lifecycle.viewModelScope
6 | import com.vikas.shoeapp.data.CarouselDataModel
7 | import kotlinx.coroutines.delay
8 | import kotlinx.coroutines.flow.MutableSharedFlow
9 | import kotlinx.coroutines.launch
10 |
11 | class MainViewModel : ViewModel() {
12 |
13 | val screenState = mutableStateOf(UiState.Home)
14 |
15 | val buttonState = mutableStateOf(ButtonState.DEFAULT)
16 |
17 | val cartFlow = MutableSharedFlow()
18 |
19 | sealed class UiState {
20 | class Details(val carouselDataModel: CarouselDataModel) : UiState()
21 | object Home : UiState()
22 | }
23 |
24 | fun onBackClick() {
25 | screenState.value = UiState.Home
26 | }
27 |
28 | fun changeButtonState() {
29 | if (buttonState.value == ButtonState.LOADED) {
30 | viewModelScope.launch {
31 | cartFlow.emit(true)
32 | }
33 | return
34 | }
35 | viewModelScope.launch {
36 | buttonState.value = ButtonState.LOADING
37 | delay(1500)
38 | buttonState.value = ButtonState.LOADED
39 | }
40 | }
41 |
42 | }
43 |
44 |
--------------------------------------------------------------------------------
/shoeapp/src/main/java/com/vikas/shoeapp/ui/theme/Color.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.shoeapp.ui.theme
2 |
3 | import androidx.compose.ui.graphics.Color
4 |
5 | val Purple200 = Color(0xFFBB86FC)
6 | val Purple500 = Color(0xFF6200EE)
7 | val Purple700 = Color(0xFF3700B3)
8 | val Teal200 = Color(0xFF03DAC5)
9 |
10 | val textColor = Color(0xFF101820)
11 | val accentColor = Color(0xFFeb4658)
--------------------------------------------------------------------------------
/shoeapp/src/main/java/com/vikas/shoeapp/ui/theme/Shape.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.shoeapp.ui.theme
2 |
3 | import androidx.compose.foundation.shape.RoundedCornerShape
4 | import androidx.compose.material.Shapes
5 | import androidx.compose.ui.unit.dp
6 |
7 | val Shapes = Shapes(
8 | small = RoundedCornerShape(4.dp),
9 | medium = RoundedCornerShape(4.dp),
10 | large = RoundedCornerShape(0.dp)
11 | )
--------------------------------------------------------------------------------
/shoeapp/src/main/java/com/vikas/shoeapp/ui/theme/Theme.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.shoeapp.ui.theme
2 |
3 | import androidx.compose.foundation.isSystemInDarkTheme
4 | import androidx.compose.material.MaterialTheme
5 | import androidx.compose.material.darkColors
6 | import androidx.compose.material.lightColors
7 | import androidx.compose.runtime.Composable
8 |
9 | private val DarkColorPalette = darkColors(
10 | primary = Purple200,
11 | primaryVariant = Purple700,
12 | secondary = Teal200
13 | )
14 |
15 | private val LightColorPalette = lightColors(
16 | primary = Purple500,
17 | primaryVariant = Purple700,
18 | secondary = Teal200
19 |
20 | /* Other default colors to override
21 | background = Color.White,
22 | surface = Color.White,
23 | onPrimary = Color.White,
24 | onSecondary = Color.Black,
25 | onBackground = Color.Black,
26 | onSurface = Color.Black,
27 | */
28 | )
29 |
30 | @Composable
31 | fun JetpackComposeAnimationPlaygroundTheme(
32 | darkTheme: Boolean = isSystemInDarkTheme(),
33 | content: @Composable () -> Unit
34 | ) {
35 | val colors = if (darkTheme) {
36 | DarkColorPalette
37 | } else {
38 | LightColorPalette
39 | }
40 |
41 | MaterialTheme(
42 | colors = colors,
43 | typography = Typography,
44 | shapes = Shapes,
45 | content = content
46 | )
47 | }
--------------------------------------------------------------------------------
/shoeapp/src/main/java/com/vikas/shoeapp/ui/theme/Type.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.shoeapp.ui.theme
2 |
3 | import androidx.compose.material.Typography
4 | import androidx.compose.ui.text.TextStyle
5 | import androidx.compose.ui.text.font.FontFamily
6 | import androidx.compose.ui.text.font.FontWeight
7 | import androidx.compose.ui.unit.sp
8 |
9 | // Set of Material typography styles to start with
10 | val Typography = Typography(
11 | body1 = TextStyle(
12 | fontFamily = FontFamily.Default,
13 | fontWeight = FontWeight.Normal,
14 | fontSize = 16.sp
15 | )
16 | /* Other default text styles to override
17 | button = TextStyle(
18 | fontFamily = FontFamily.Default,
19 | fontWeight = FontWeight.W500,
20 | fontSize = 14.sp
21 | ),
22 | caption = TextStyle(
23 | fontFamily = FontFamily.Default,
24 | fontWeight = FontWeight.Normal,
25 | fontSize = 12.sp
26 | )
27 | */
28 | )
--------------------------------------------------------------------------------
/shoeapp/src/main/java/com/vikas/shoeapp/util/Utils.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.shoeapp.util
2 |
3 | import androidx.compose.animation.core.CubicBezierEasing
4 | import androidx.compose.animation.core.Easing
5 |
6 | object Utils {
7 | fun lerp(start: Float, stop: Float, fraction: Float): Float =
8 | (1 - fraction) * start + fraction * stop
9 |
10 |
11 | val EaseOutBounce: Easing = Easing { fraction ->
12 | val n1 = 7.5625f
13 | val d1 = 2.75f
14 | var newFraction = fraction
15 |
16 | return@Easing if (newFraction < 1f / d1) {
17 | n1 * newFraction * newFraction
18 | } else if (newFraction < 2f / d1) {
19 | newFraction -= 1.5f / d1
20 | n1 * newFraction * newFraction + 0.75f
21 | } else if (newFraction < 2.5f / d1) {
22 | newFraction -= 2.25f / d1
23 | n1 * newFraction * newFraction + 0.9375f
24 | } else {
25 | newFraction -= 2.625f / d1
26 | n1 * newFraction * newFraction + 0.984375f
27 | }
28 | }
29 | val EaseOutQuart = CubicBezierEasing(0.25f, 1f, 0.5f, 1f)
30 | }
--------------------------------------------------------------------------------
/shoeapp/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/shoeapp/src/main/res/drawable/adidas_1032.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/shoeapp/src/main/res/drawable/adidas_1032.png
--------------------------------------------------------------------------------
/shoeapp/src/main/res/drawable/adidas_104.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/shoeapp/src/main/res/drawable/adidas_104.png
--------------------------------------------------------------------------------
/shoeapp/src/main/res/drawable/adidas_s100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/shoeapp/src/main/res/drawable/adidas_s100.png
--------------------------------------------------------------------------------
/shoeapp/src/main/res/drawable/armour_phantom.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/shoeapp/src/main/res/drawable/armour_phantom.png
--------------------------------------------------------------------------------
/shoeapp/src/main/res/drawable/baseline_circle_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/shoeapp/src/main/res/drawable/ic_add.xml:
--------------------------------------------------------------------------------
1 |
6 |
13 |
20 |
21 |
--------------------------------------------------------------------------------
/shoeapp/src/main/res/drawable/ic_heart.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/shoeapp/src/main/res/drawable/ic_home.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/shoeapp/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/shoeapp/src/main/res/drawable/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/shoeapp/src/main/res/drawable/ic_logout.xml:
--------------------------------------------------------------------------------
1 |
6 |
13 |
20 |
27 |
28 |
--------------------------------------------------------------------------------
/shoeapp/src/main/res/drawable/ic_notification.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
15 |
16 |
--------------------------------------------------------------------------------
/shoeapp/src/main/res/drawable/ic_profile.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
15 |
16 |
--------------------------------------------------------------------------------
/shoeapp/src/main/res/drawable/ic_remove.xml:
--------------------------------------------------------------------------------
1 |
6 |
13 |
14 |
--------------------------------------------------------------------------------
/shoeapp/src/main/res/drawable/ic_ribbon.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/shoeapp/src/main/res/drawable/ic_right_arrow.xml:
--------------------------------------------------------------------------------
1 |
6 |
13 |
20 |
21 |
--------------------------------------------------------------------------------
/shoeapp/src/main/res/drawable/ic_search.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/shoeapp/src/main/res/drawable/ic_settings.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/shoeapp/src/main/res/drawable/ic_shop.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/shoeapp/src/main/res/drawable/nike_100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/shoeapp/src/main/res/drawable/nike_100.png
--------------------------------------------------------------------------------
/shoeapp/src/main/res/drawable/reebok_102.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/shoeapp/src/main/res/drawable/reebok_102.png
--------------------------------------------------------------------------------
/shoeapp/src/main/res/drawable/roaster_100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/shoeapp/src/main/res/drawable/roaster_100.png
--------------------------------------------------------------------------------
/shoeapp/src/main/res/drawable/shoe_101.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/shoeapp/src/main/res/drawable/shoe_101.png
--------------------------------------------------------------------------------
/shoeapp/src/main/res/drawable/under_103.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/shoeapp/src/main/res/drawable/under_103.png
--------------------------------------------------------------------------------
/shoeapp/src/main/res/drawable/under_1031.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/shoeapp/src/main/res/drawable/under_1031.png
--------------------------------------------------------------------------------
/shoeapp/src/main/res/drawable/under_armour_105.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/shoeapp/src/main/res/drawable/under_armour_105.png
--------------------------------------------------------------------------------
/shoeapp/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/shoeapp/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/shoeapp/src/main/res/mipmap-anydpi-v33/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/shoeapp/src/main/res/mipmap-hdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/shoeapp/src/main/res/mipmap-hdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/shoeapp/src/main/res/mipmap-hdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/shoeapp/src/main/res/mipmap-hdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/shoeapp/src/main/res/mipmap-mdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/shoeapp/src/main/res/mipmap-mdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/shoeapp/src/main/res/mipmap-mdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/shoeapp/src/main/res/mipmap-mdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/shoeapp/src/main/res/mipmap-xhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/shoeapp/src/main/res/mipmap-xhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/shoeapp/src/main/res/mipmap-xhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/shoeapp/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/shoeapp/src/main/res/mipmap-xxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/shoeapp/src/main/res/mipmap-xxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/shoeapp/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/shoeapp/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/shoeapp/src/main/res/mipmap-xxxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/shoeapp/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/shoeapp/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/worstkiller/jetpack_compose_animation/0b7882227d6ca7a3dbdb4ad69f84d613417b46cf/shoeapp/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/shoeapp/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFBB86FC
4 | #FF6200EE
5 | #FF3700B3
6 | #FF03DAC5
7 | #FF018786
8 | #FF000000
9 | #FFFFFFFF
10 |
--------------------------------------------------------------------------------
/shoeapp/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | ShoeApp
3 |
--------------------------------------------------------------------------------
/shoeapp/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
--------------------------------------------------------------------------------
/shoeapp/src/test/java/com/vikas/shoeapp/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package com.vikas.shoeapp
2 |
3 | import org.junit.Test
4 |
5 | import org.junit.Assert.*
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * See [testing documentation](http://d.android.com/tools/testing).
11 | */
12 | class ExampleUnitTest {
13 | @Test
14 | fun addition_isCorrect() {
15 | assertEquals(4, 2 + 2)
16 | }
17 | }
--------------------------------------------------------------------------------