├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ └── themes.xml │ │ │ ├── drawable │ │ │ │ ├── car1.png │ │ │ │ ├── car2.png │ │ │ │ ├── car3.png │ │ │ │ ├── car4.png │ │ │ │ ├── card1.jpeg │ │ │ │ ├── card2.jpeg │ │ │ │ ├── card3.jpeg │ │ │ │ ├── card4.jpeg │ │ │ │ ├── card5.jpeg │ │ │ │ ├── dm1.jpeg │ │ │ │ ├── dm2.jpeg │ │ │ │ ├── dm3.jpeg │ │ │ │ ├── dm4.jpeg │ │ │ │ ├── dm5.jpeg │ │ │ │ └── ic_launcher_background.xml │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── values-night │ │ │ │ └── themes.xml │ │ │ ├── layout │ │ │ │ ├── activity_main.xml │ │ │ │ ├── activity_anime.xml │ │ │ │ ├── activity_car_motion.xml │ │ │ │ └── activity_card_motion.xml │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ └── xml │ │ │ │ ├── anime_motion_scence.xml │ │ │ │ ├── car_motion_scence.xml │ │ │ │ └── card_motion_scence.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── wj │ │ │ └── motiondemo │ │ │ ├── MainActivity.kt │ │ │ ├── CarMotionActivity.kt │ │ │ ├── CardMotionActivity.kt │ │ │ └── AnimeActivity.kt │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── wj │ │ │ └── motiondemo │ │ │ └── ExampleUnitTest.kt │ └── androidTest │ │ └── java │ │ └── com │ │ └── wj │ │ └── motiondemo │ │ └── ExampleInstrumentedTest.kt ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── .idea ├── .gitignore ├── codeStyles │ ├── codeStyleConfig.xml │ └── Project.xml ├── compiler.xml ├── misc.xml ├── gradle.xml └── jarRepositories.xml ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── gradle.properties ├── gradlew.bat └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | rootProject.name = "MotionDemo" -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | MotionDemo 3 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mCyp/MotionDemo/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable/car1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mCyp/MotionDemo/HEAD/app/src/main/res/drawable/car1.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/car2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mCyp/MotionDemo/HEAD/app/src/main/res/drawable/car2.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/car3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mCyp/MotionDemo/HEAD/app/src/main/res/drawable/car3.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/car4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mCyp/MotionDemo/HEAD/app/src/main/res/drawable/car4.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/card1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mCyp/MotionDemo/HEAD/app/src/main/res/drawable/card1.jpeg -------------------------------------------------------------------------------- /app/src/main/res/drawable/card2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mCyp/MotionDemo/HEAD/app/src/main/res/drawable/card2.jpeg -------------------------------------------------------------------------------- /app/src/main/res/drawable/card3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mCyp/MotionDemo/HEAD/app/src/main/res/drawable/card3.jpeg -------------------------------------------------------------------------------- /app/src/main/res/drawable/card4.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mCyp/MotionDemo/HEAD/app/src/main/res/drawable/card4.jpeg -------------------------------------------------------------------------------- /app/src/main/res/drawable/card5.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mCyp/MotionDemo/HEAD/app/src/main/res/drawable/card5.jpeg -------------------------------------------------------------------------------- /app/src/main/res/drawable/dm1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mCyp/MotionDemo/HEAD/app/src/main/res/drawable/dm1.jpeg -------------------------------------------------------------------------------- /app/src/main/res/drawable/dm2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mCyp/MotionDemo/HEAD/app/src/main/res/drawable/dm2.jpeg -------------------------------------------------------------------------------- /app/src/main/res/drawable/dm3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mCyp/MotionDemo/HEAD/app/src/main/res/drawable/dm3.jpeg -------------------------------------------------------------------------------- /app/src/main/res/drawable/dm4.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mCyp/MotionDemo/HEAD/app/src/main/res/drawable/dm4.jpeg -------------------------------------------------------------------------------- /app/src/main/res/drawable/dm5.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mCyp/MotionDemo/HEAD/app/src/main/res/drawable/dm5.jpeg -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mCyp/MotionDemo/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mCyp/MotionDemo/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mCyp/MotionDemo/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mCyp/MotionDemo/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mCyp/MotionDemo/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mCyp/MotionDemo/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mCyp/MotionDemo/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mCyp/MotionDemo/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mCyp/MotionDemo/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mCyp/MotionDemo/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Nov 02 09:31:48 CST 2021 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip 7 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | -------------------------------------------------------------------------------- /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/test/java/com/wj/motiondemo/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.wj.motiondemo 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/wj/motiondemo/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.wj.motiondemo 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.wj.motiondemo", appContext.packageName) 23 | } 24 | } -------------------------------------------------------------------------------- /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/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/values-night/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /.idea/jarRepositories.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | 24 | 25 | -------------------------------------------------------------------------------- /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 | # Automatically convert third-party libraries to use AndroidX 19 | android.enableJetifier=true 20 | # Kotlin code style for this project: "official" or "obsolete": 21 | kotlin.code.style=official -------------------------------------------------------------------------------- /app/src/main/java/com/wj/motiondemo/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.wj.motiondemo 2 | 3 | import android.content.Intent 4 | import androidx.appcompat.app.AppCompatActivity 5 | import android.os.Bundle 6 | import android.view.Window 7 | import android.widget.TextView 8 | 9 | class MainActivity : AppCompatActivity() { 10 | override fun onCreate(savedInstanceState: Bundle?) { 11 | super.onCreate(savedInstanceState) 12 | setContentView(R.layout.activity_main) 13 | 14 | 15 | findViewById(R.id.tv1).setOnClickListener { 16 | val intent = Intent(this, AnimeActivity::class.java) 17 | startActivity(intent) 18 | } 19 | 20 | findViewById(R.id.tv2).setOnClickListener { 21 | val intent = Intent(this, CarMotionActivity::class.java) 22 | startActivity(intent) 23 | } 24 | 25 | findViewById(R.id.tv3).setOnClickListener { 26 | val intent = Intent(this, CardMotionActivity::class.java) 27 | startActivity(intent) 28 | } 29 | 30 | findViewById(R.id.tv4).setOnClickListener { 31 | val intent = Intent(this, AnimeActivity::class.java) 32 | startActivity(intent) 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /app/src/main/java/com/wj/motiondemo/CarMotionActivity.kt: -------------------------------------------------------------------------------- 1 | package com.wj.motiondemo 2 | 3 | import androidx.appcompat.app.AppCompatActivity 4 | import android.os.Bundle 5 | import android.view.View 6 | import android.view.Window 7 | import android.widget.ImageView 8 | import androidx.constraintlayout.helper.widget.Carousel 9 | 10 | class CarMotionActivity : AppCompatActivity() { 11 | 12 | var images = intArrayOf( 13 | R.drawable.car1, 14 | R.drawable.car3, 15 | R.drawable.car4, 16 | R.drawable.car2 17 | ) 18 | 19 | override fun onCreate(savedInstanceState: Bundle?) { 20 | super.onCreate(savedInstanceState) 21 | getSupportActionBar()?.hide() 22 | setContentView(R.layout.activity_car_motion) 23 | 24 | val carsoul = findViewById(R.id.carousel) 25 | carsoul.setAdapter(object : Carousel.Adapter { 26 | override fun count(): Int { 27 | return 4 28 | } 29 | 30 | override fun populate(view: View?, index: Int) { 31 | if(view is ImageView){ 32 | view.setImageResource(images[index]) 33 | } 34 | } 35 | 36 | override fun onNewItem(index: Int) { 37 | // called when an item is set 38 | } 39 | }) 40 | } 41 | } -------------------------------------------------------------------------------- /app/src/main/java/com/wj/motiondemo/CardMotionActivity.kt: -------------------------------------------------------------------------------- 1 | package com.wj.motiondemo 2 | 3 | import androidx.appcompat.app.AppCompatActivity 4 | import android.os.Bundle 5 | import android.view.View 6 | import android.view.Window 7 | import android.widget.ImageView 8 | import androidx.constraintlayout.helper.widget.Carousel 9 | 10 | class CardMotionActivity : AppCompatActivity() { 11 | var images = intArrayOf( 12 | R.drawable.card1, 13 | R.drawable.card2, 14 | R.drawable.card3, 15 | R.drawable.card4, 16 | R.drawable.card5 17 | ) 18 | 19 | override fun onCreate(savedInstanceState: Bundle?) { 20 | super.onCreate(savedInstanceState) 21 | getSupportActionBar()?.hide() 22 | setContentView(R.layout.activity_card_motion) 23 | 24 | 25 | val carsoul = findViewById(R.id.carousel) 26 | carsoul.setAdapter(object : Carousel.Adapter { 27 | override fun count(): Int { 28 | return 5 29 | } 30 | 31 | override fun populate(view: View?, index: Int) { 32 | if(view is ImageView){ 33 | view.setImageResource(images[index]) 34 | } 35 | } 36 | 37 | override fun onNewItem(index: Int) { 38 | // called when an item is set 39 | } 40 | }) 41 | } 42 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 |