├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── mipmap-hdpi │ │ │ │ ├── img_1.jpg │ │ │ │ ├── img_2.jpg │ │ │ │ ├── img_3.jpg │ │ │ │ ├── img_4.jpg │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── values │ │ │ │ ├── colors.xml │ │ │ │ ├── dimens.xml │ │ │ │ ├── styles.xml │ │ │ │ └── strings.xml │ │ │ ├── drawable │ │ │ │ └── title_bg.xml │ │ │ ├── values-w820dp │ │ │ │ └── dimens.xml │ │ │ ├── menu │ │ │ │ └── menu.xml │ │ │ └── layout │ │ │ │ ├── activity_list.xml │ │ │ │ ├── item_view.xml │ │ │ │ ├── item_view1.xml │ │ │ │ ├── activity_main.xml │ │ │ │ └── activity_both.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── ckenergy │ │ │ └── stackcard │ │ │ └── sample │ │ │ ├── HorizontalActivity.java │ │ │ ├── VerticalActivity.java │ │ │ ├── MainActivity.java │ │ │ ├── BothActivity.java │ │ │ ├── RecyclerViewAdapter.java │ │ │ ├── RecyclerViewAdapter1.java │ │ │ └── BaseActivity.java │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── ckenergy │ │ │ └── stackcard │ │ │ └── sample │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── ckenergy │ │ └── stackcard │ │ └── sample │ │ └── ApplicationTest.java ├── proguard-rules.pro └── build.gradle ├── stackcardlayoutmanager ├── consumer-rules.pro ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ └── values │ │ │ │ └── strings.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── ckenergy │ │ │ └── stackcard │ │ │ └── stackcardlayoutmanager │ │ │ ├── ItemTransformation.java │ │ │ ├── ChildViewOutlineProvider.java │ │ │ ├── StackCardSmoothScroller.java │ │ │ ├── DefaultChildSelectionListener.java │ │ │ ├── StackCardChildSelectionListener.java │ │ │ ├── CenterScrollListener.java │ │ │ ├── ItemTouchHelperCallBack.java │ │ │ ├── StackCardPostLayout.java │ │ │ └── StackCardLayoutManager.java │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── ckenergy │ │ │ └── stackcard │ │ │ └── stackcardlayoutmanager │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── ckenergy │ │ └── stackcard │ │ └── stackcardlayoutmanager │ │ └── ApplicationTest.java ├── proguard-rules.pro └── build.gradle ├── img ├── exp.jpg ├── gif_v.gif ├── gif_h_f.gif ├── gif_h_l.gif ├── gif_swip.gif ├── h_in_n.jpg ├── h_in_p.jpg ├── h_out_n.jpg ├── h_out_p.jpg ├── v_c_exp.jpg ├── v_less.jpg ├── gif_h_in_n.gif └── h_scroll2p.gif ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── settings.gradle ├── .gitignore ├── gradle.properties ├── gradlew.bat ├── README-CN.md ├── README.md └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /stackcardlayoutmanager/consumer-rules.pro: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stackcardlayoutmanager/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /img/exp.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckenergy/StackCardRecyclerView/HEAD/img/exp.jpg -------------------------------------------------------------------------------- /img/gif_v.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckenergy/StackCardRecyclerView/HEAD/img/gif_v.gif -------------------------------------------------------------------------------- /img/gif_h_f.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckenergy/StackCardRecyclerView/HEAD/img/gif_h_f.gif -------------------------------------------------------------------------------- /img/gif_h_l.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckenergy/StackCardRecyclerView/HEAD/img/gif_h_l.gif -------------------------------------------------------------------------------- /img/gif_swip.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckenergy/StackCardRecyclerView/HEAD/img/gif_swip.gif -------------------------------------------------------------------------------- /img/h_in_n.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckenergy/StackCardRecyclerView/HEAD/img/h_in_n.jpg -------------------------------------------------------------------------------- /img/h_in_p.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckenergy/StackCardRecyclerView/HEAD/img/h_in_p.jpg -------------------------------------------------------------------------------- /img/h_out_n.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckenergy/StackCardRecyclerView/HEAD/img/h_out_n.jpg -------------------------------------------------------------------------------- /img/h_out_p.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckenergy/StackCardRecyclerView/HEAD/img/h_out_p.jpg -------------------------------------------------------------------------------- /img/v_c_exp.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckenergy/StackCardRecyclerView/HEAD/img/v_c_exp.jpg -------------------------------------------------------------------------------- /img/v_less.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckenergy/StackCardRecyclerView/HEAD/img/v_less.jpg -------------------------------------------------------------------------------- /img/gif_h_in_n.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckenergy/StackCardRecyclerView/HEAD/img/gif_h_in_n.gif -------------------------------------------------------------------------------- /img/h_scroll2p.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckenergy/StackCardRecyclerView/HEAD/img/h_scroll2p.gif -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckenergy/StackCardRecyclerView/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/img_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckenergy/StackCardRecyclerView/HEAD/app/src/main/res/mipmap-hdpi/img_1.jpg -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/img_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckenergy/StackCardRecyclerView/HEAD/app/src/main/res/mipmap-hdpi/img_2.jpg -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/img_3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckenergy/StackCardRecyclerView/HEAD/app/src/main/res/mipmap-hdpi/img_3.jpg -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/img_4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckenergy/StackCardRecyclerView/HEAD/app/src/main/res/mipmap-hdpi/img_4.jpg -------------------------------------------------------------------------------- /stackcardlayoutmanager/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | StackCardLayoutManager 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckenergy/StackCardRecyclerView/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckenergy/StackCardRecyclerView/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckenergy/StackCardRecyclerView/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckenergy/StackCardRecyclerView/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckenergy/StackCardRecyclerView/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Feb 08 12:05:34 CST 2022 2 | distributionBase=GRADLE_USER_HOME 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/title_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 9 | -------------------------------------------------------------------------------- /stackcardlayoutmanager/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/test/java/com/ckenergy/stackcard/sample/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.ckenergy.stackcard.sample; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * To work on unit tests, switch the Test Artifact in the Build Variants view. 9 | */ 10 | public class ExampleUnitTest { 11 | @Test 12 | public void addition_isCorrect() throws Exception { 13 | assertEquals(4, 2 + 2); 14 | } 15 | } -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | gradlePluginPortal() 4 | google() 5 | mavenCentral() 6 | } 7 | } 8 | dependencyResolutionManagement { 9 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) 10 | repositories { 11 | google() 12 | mavenCentral() 13 | } 14 | } 15 | rootProject.name = "StackCardRecycleView" 16 | 17 | include ':app', ':stackcardlayoutmanager' 18 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/ckenergy/stackcard/sample/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.ckenergy.stackcard.sample; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /stackcardlayoutmanager/src/test/java/com/ckenergy/stackcard/stackcardlayoutmanager/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.ckenergy.stackcard.stackcardlayoutmanager; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * To work on unit tests, switch the Test Artifact in the Build Variants view. 9 | */ 10 | public class ExampleUnitTest { 11 | @Test 12 | public void addition_isCorrect() throws Exception { 13 | assertEquals(4, 2 + 2); 14 | } 15 | } -------------------------------------------------------------------------------- /app/src/main/res/menu/menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | 14 | 15 | -------------------------------------------------------------------------------- /stackcardlayoutmanager/src/androidTest/java/com/ckenergy/stackcard/stackcardlayoutmanager/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.ckenergy.stackcard.stackcardlayoutmanager; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | StackCardRecyclerView 3 | 4 | vertical 5 | horizontal 6 | both 7 | 8 | change_stack_order 9 | change_number_order 10 | 11 | in_stack 12 | out_stack 13 | negative 14 | positive 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in D:\android_sdk\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .DS_Store 3 | 4 | # Built application files 5 | *.apk 6 | *.ap_ 7 | 8 | # Files for the Dalvik VM 9 | *.dex 10 | 11 | # Java class files 12 | *.class 13 | 14 | # Gradle files 15 | .gradle/ 16 | build/ 17 | 18 | # Local configuration file (sdk path, etc) 19 | local.properties 20 | 21 | # Proguard folder generated by Eclipse 22 | proguard/ 23 | 24 | # Log Files 25 | *.log 26 | 27 | # Android Studio Navigation editor temp files 28 | .navigation/ 29 | 30 | # Android Studio captures folder 31 | captures/ 32 | 33 | # Generated files 34 | bin/ 35 | gen/ 36 | out/ 37 | 38 | # Log Files 39 | *.log 40 | 41 | # Intellij 42 | *.iml 43 | .idea/ 44 | 45 | # Keystore files 46 | *.jks 47 | 48 | stackcardlayoutmanager/upload -------------------------------------------------------------------------------- /stackcardlayoutmanager/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in D:\android_sdk\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /stackcardlayoutmanager/src/main/java/com/ckenergy/stackcard/stackcardlayoutmanager/ItemTransformation.java: -------------------------------------------------------------------------------- 1 | package com.ckenergy.stackcard.stackcardlayoutmanager; 2 | 3 | public class ItemTransformation { 4 | 5 | final float mScaleX; 6 | final float mScaleY; 7 | final int mTranslationX; 8 | final int mTranslationY; 9 | final float mAlpha; 10 | final int mClipLength; 11 | 12 | 13 | public ItemTransformation(final float scaleX, final float scaleY, final int translationX, final int translationY,final int clipLength, final float alpha) { 14 | mScaleX = scaleX; 15 | mScaleY = scaleY; 16 | mTranslationX = translationX; 17 | mTranslationY = translationY; 18 | mClipLength = clipLength; 19 | mAlpha = alpha; 20 | } 21 | } -------------------------------------------------------------------------------- /stackcardlayoutmanager/src/main/java/com/ckenergy/stackcard/stackcardlayoutmanager/ChildViewOutlineProvider.java: -------------------------------------------------------------------------------- 1 | package com.ckenergy.stackcard.stackcardlayoutmanager; 2 | 3 | import android.annotation.TargetApi; 4 | import android.graphics.Outline; 5 | import android.os.Build; 6 | import android.util.Log; 7 | import android.view.View; 8 | import android.view.ViewOutlineProvider; 9 | 10 | /** 11 | * Created by chengkai on 2016/12/9. 12 | */ 13 | @TargetApi(Build.VERSION_CODES.LOLLIPOP) 14 | public class ChildViewOutlineProvider extends ViewOutlineProvider { 15 | @Override 16 | public void getOutline(View view, Outline outline) { 17 | Log.d(getClass().getSimpleName(),"width:"+view.getWidth()+",height:"+view.getHeight()); 18 | outline.setRect(view.getLeft(),view.getTop(),view.getLeft()+view.getWidth()/2,view.getTop()+view.getHeight()/2); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 11 | 12 | 19 | 20 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_view1.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 15 | 16 | 21 | 22 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /app/src/main/java/com/ckenergy/stackcard/sample/HorizontalActivity.java: -------------------------------------------------------------------------------- 1 | package com.ckenergy.stackcard.sample; 2 | 3 | import android.os.Bundle; 4 | import android.util.Log; 5 | 6 | import androidx.recyclerview.widget.RecyclerView; 7 | 8 | import com.ckenergy.stackcard.stackcardlayoutmanager.StackCardLayoutManager; 9 | import com.ckenergy.stackcard.stackcardlayoutmanager.StackCardPostLayout; 10 | 11 | public class HorizontalActivity extends BaseActivity { 12 | 13 | @Override 14 | protected void onCreate(Bundle savedInstanceState) { 15 | super.onCreate(savedInstanceState); 16 | setContentView(R.layout.activity_list); 17 | 18 | final RecyclerView recyclerView = (RecyclerView) findViewById(R.id.list); 19 | 20 | StackCardLayoutManager stackCardLayoutManager = new StackCardLayoutManager(StackCardLayoutManager.HORIZONTAL, false, new StackCardPostLayout()); 21 | RecyclerViewAdapter1 adapter = new RecyclerViewAdapter1(20); 22 | 23 | initRecyclerView(recyclerView,stackCardLayoutManager, adapter); 24 | 25 | Log.d(getClass().getSimpleName(),stackCardLayoutManager.getStackOrder()+""); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/ckenergy/stackcard/sample/VerticalActivity.java: -------------------------------------------------------------------------------- 1 | package com.ckenergy.stackcard.sample; 2 | 3 | import android.os.Bundle; 4 | 5 | import androidx.recyclerview.widget.RecyclerView; 6 | 7 | import com.ckenergy.stackcard.stackcardlayoutmanager.StackCardLayoutManager; 8 | import com.ckenergy.stackcard.stackcardlayoutmanager.StackCardPostLayout; 9 | 10 | public class VerticalActivity extends BaseActivity { 11 | 12 | @Override 13 | protected void onCreate(Bundle savedInstanceState) { 14 | super.onCreate(savedInstanceState); 15 | setContentView(R.layout.activity_list); 16 | 17 | RecyclerView recyclerView = (RecyclerView) findViewById(R.id.list); 18 | 19 | StackCardLayoutManager stackCardLayoutManager = new StackCardLayoutManager(StackCardLayoutManager.VERTICAL,false, new StackCardPostLayout()); 20 | stackCardLayoutManager.setStackOrder(StackCardLayoutManager.OUT_STACK_ORDER); 21 | stackCardLayoutManager.setNumberOrder(StackCardLayoutManager.NEGATIVE_ORDER); 22 | RecyclerViewAdapter1 adapter = new RecyclerViewAdapter1(20); 23 | 24 | initRecyclerView(recyclerView, stackCardLayoutManager, adapter); 25 | 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /stackcardlayoutmanager/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.android.library' 3 | id 'org.jetbrains.kotlin.android' 4 | } 5 | 6 | android { 7 | compileSdk 31 8 | 9 | defaultConfig { 10 | minSdk 21 11 | targetSdk 31 12 | 13 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 14 | consumerProguardFiles "consumer-rules.pro" 15 | } 16 | 17 | buildTypes { 18 | release { 19 | minifyEnabled false 20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 21 | } 22 | } 23 | compileOptions { 24 | sourceCompatibility JavaVersion.VERSION_11 25 | targetCompatibility JavaVersion.VERSION_11 26 | } 27 | kotlinOptions { 28 | jvmTarget = '1.8' 29 | } 30 | } 31 | 32 | dependencies { 33 | 34 | implementation 'androidx.core:core-ktx:1.7.0' 35 | implementation 'androidx.appcompat:appcompat:1.4.1' 36 | implementation 'com.google.android.material:material:1.5.0' 37 | testImplementation 'junit:junit:4.13.2' 38 | androidTestImplementation 'androidx.test.ext:junit:1.1.3' 39 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' 40 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 |