├── sample ├── .gitignore ├── src │ ├── main │ │ ├── ic_launcher-web.png │ │ ├── res │ │ │ ├── drawable │ │ │ │ ├── mlsdev.png │ │ │ │ ├── background_primary.xml │ │ │ │ ├── background_primary_accent.xml │ │ │ │ ├── background_primary_dark.xml │ │ │ │ └── background_primary_light.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 │ │ │ ├── values │ │ │ │ ├── colors.xml │ │ │ │ ├── styles.xml │ │ │ │ └── strings.xml │ │ │ └── layout │ │ │ │ ├── layout_list_item.xml │ │ │ │ ├── activity_sample.xml │ │ │ │ ├── fragment_list_from_bottom.xml │ │ │ │ ├── fragment_list_from_bottom_scale.xml │ │ │ │ ├── fragment_grid_from_bottom.xml │ │ │ │ ├── fragment_grid_from_bottom_random.xml │ │ │ │ ├── fragment_grid_from_bottom_random_scale.xml │ │ │ │ ├── fragment_grid_from_bottom_scale.xml │ │ │ │ └── fragment_options.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── mlsdev │ │ │ └── sample │ │ │ ├── SampleActivity.java │ │ │ ├── SimpleAdapter.java │ │ │ └── fragment │ │ │ ├── SampleFragment.java │ │ │ └── OptionsFragment.java │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── mlsdev │ │ │ └── sample │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── mlsdev │ │ └── sample │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── library ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ └── attrs.xml │ │ │ └── anim │ │ │ │ ├── layout_animation_from_bottom.xml │ │ │ │ ├── layout_animation_from_scale.xml │ │ │ │ ├── layout_animation_random_scale.xml │ │ │ │ ├── layout_animation_from_bottom_random.xml │ │ │ │ ├── layout_animation_from_bottom_scale.xml │ │ │ │ ├── item_animation_from_bottom.xml │ │ │ │ ├── item_animation_from_scale.xml │ │ │ │ └── item_animation_from_bottom_scale.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── mlsdev │ │ │ └── animatedrv │ │ │ └── AnimatedRecyclerView.java │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── mlsdev │ │ │ └── animatedrv │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── mlsdev │ │ └── animatedrv │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── art └── demo.gif ├── .gitignore ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── CHANGELOG.md ├── .travis.yml ├── gradle.properties ├── LICENSE ├── gradlew.bat ├── README.md └── gradlew /sample/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /library/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':sample', ':library' 2 | -------------------------------------------------------------------------------- /art/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSDev/AnimatedRecyclerView/HEAD/art/demo.gif -------------------------------------------------------------------------------- /library/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | library 3 | 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/ 5 | .DS_Store 6 | /build 7 | /captures 8 | .externalNativeBuild 9 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSDev/AnimatedRecyclerView/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /sample/src/main/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSDev/AnimatedRecyclerView/HEAD/sample/src/main/ic_launcher-web.png -------------------------------------------------------------------------------- /sample/src/main/res/drawable/mlsdev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSDev/AnimatedRecyclerView/HEAD/sample/src/main/res/drawable/mlsdev.png -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | ## `2.0.0` - 2019-04-19 3 | - Added the `AndroidX` support 4 | 5 | ## `1.0.1` 6 | - Fixed bugs 7 | 8 | ## `1.0.0` 9 | - Release -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSDev/AnimatedRecyclerView/HEAD/sample/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSDev/AnimatedRecyclerView/HEAD/sample/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSDev/AnimatedRecyclerView/HEAD/sample/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSDev/AnimatedRecyclerView/HEAD/sample/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSDev/AnimatedRecyclerView/HEAD/sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSDev/AnimatedRecyclerView/HEAD/sample/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSDev/AnimatedRecyclerView/HEAD/sample/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSDev/AnimatedRecyclerView/HEAD/sample/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSDev/AnimatedRecyclerView/HEAD/sample/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLSDev/AnimatedRecyclerView/HEAD/sample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /sample/src/main/res/drawable/background_primary.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /sample/src/main/res/drawable/background_primary_accent.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /sample/src/main/res/drawable/background_primary_dark.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /sample/src/main/res/drawable/background_primary_light.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Apr 19 14:59:00 EEST 2019 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-5.1.1-all.zip 7 | -------------------------------------------------------------------------------- /library/src/main/res/anim/layout_animation_from_bottom.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /library/src/main/res/anim/layout_animation_from_scale.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /library/src/main/res/anim/layout_animation_random_scale.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /library/src/main/res/anim/layout_animation_from_bottom_random.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /library/src/main/res/anim/layout_animation_from_bottom_scale.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /sample/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #4f65e2 5 | #303F9F 6 | #FF4081 7 | 8 | -------------------------------------------------------------------------------- /library/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /sample/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /sample/src/test/java/com/mlsdev/sample/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.mlsdev.sample; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /library/src/test/java/com/mlsdev/animatedrv/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.mlsdev.animatedrv; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /sample/src/main/res/layout/layout_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /library/src/main/res/anim/item_animation_from_bottom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | 14 | 15 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: android 2 | jdk: oraclejdk8 3 | android: 4 | components: 5 | - tools 6 | - platform-tools 7 | - build-tools-28.0.3 8 | - android-28 9 | - extra-google-m2repository 10 | - extra-android-m2repository 11 | licenses: 12 | - android-sdk-preview-license-.+ 13 | - android-sdk-license-.+ 14 | - google-gdk-license-.+ 15 | script: 16 | - ./gradlew build 17 | before_install: 18 | - chmod +x gradlew -------------------------------------------------------------------------------- /sample/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | AnimatedRecyclerView 3 | list from bottom 4 | list from bottom scale 5 | grid from bottom 6 | grid from bottom scale 7 | grid from bottom random 8 | grid random scale 9 | 10 | -------------------------------------------------------------------------------- /sample/src/main/res/layout/activity_sample.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 17 | 18 | -------------------------------------------------------------------------------- /library/src/main/res/anim/item_animation_from_scale.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | 18 | 19 | -------------------------------------------------------------------------------- /sample/src/main/res/layout/fragment_list_from_bottom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /sample/src/main/res/layout/fragment_list_from_bottom_scale.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /library/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /sample/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /sample/src/main/res/layout/fragment_grid_from_bottom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /sample/src/main/res/layout/fragment_grid_from_bottom_random.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /sample/src/main/res/layout/fragment_grid_from_bottom_random_scale.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /sample/src/main/res/layout/fragment_grid_from_bottom_scale.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | android.useAndroidX=true 19 | android.enableJetifier=true -------------------------------------------------------------------------------- /library/src/main/res/anim/item_animation_from_bottom_scale.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | 18 | 19 | 23 | 24 | -------------------------------------------------------------------------------- /sample/src/androidTest/java/com/mlsdev/sample/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.mlsdev.sample; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.mlsdev.animatedrv", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /library/src/androidTest/java/com/mlsdev/animatedrv/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.mlsdev.animatedrv; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.mlsdev.animatedrv.test", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /library/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 /Users/serhii/Library/Android/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 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /sample/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 /Users/serhii/Library/Android/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 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /sample/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 28 5 | 6 | defaultConfig { 7 | applicationId "com.mlsdev.sample" 8 | minSdkVersion 16 9 | targetSdkVersion 28 10 | versionCode 1 11 | versionName "1.0" 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 13 | } 14 | 15 | buildTypes { 16 | release { 17 | minifyEnabled false 18 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 19 | } 20 | } 21 | 22 | dataBinding { 23 | enabled = true 24 | } 25 | } 26 | 27 | dependencies { 28 | implementation fileTree(include: ['*.jar'], dir: 'libs') 29 | implementation project(':library') 30 | implementation 'androidx.appcompat:appcompat:1.0.2' 31 | implementation 'androidx.recyclerview:recyclerview:1.0.0' 32 | testImplementation 'junit:junit:4.12' 33 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 34 | } 35 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Sergey Glebov 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. -------------------------------------------------------------------------------- /sample/src/main/java/com/mlsdev/sample/SampleActivity.java: -------------------------------------------------------------------------------- 1 | package com.mlsdev.sample; 2 | 3 | import android.os.Bundle; 4 | import android.view.MenuItem; 5 | 6 | import androidx.appcompat.app.AppCompatActivity; 7 | import androidx.databinding.DataBindingUtil; 8 | 9 | import com.mlsdev.sample.databinding.ActivitySampleBinding; 10 | import com.mlsdev.sample.fragment.OptionsFragment; 11 | 12 | public class SampleActivity extends AppCompatActivity { 13 | public static final String TITLE_KEY = "title_key"; 14 | public static final String LAYOUT_KEY = "layout_key"; 15 | 16 | @Override 17 | protected void onCreate(Bundle savedInstanceState) { 18 | super.onCreate(savedInstanceState); 19 | ActivitySampleBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_sample); 20 | 21 | getSupportFragmentManager().beginTransaction() 22 | .replace(binding.content.getId(), new OptionsFragment()) 23 | .commit(); 24 | 25 | } 26 | 27 | @Override 28 | public boolean onOptionsItemSelected(MenuItem item) { 29 | if (item.getItemId() == android.R.id.home) 30 | onBackPressed(); 31 | 32 | getSupportActionBar().setDisplayHomeAsUpEnabled(false); 33 | getSupportActionBar().setTitle(R.string.app_name); 34 | 35 | return super.onOptionsItemSelected(item); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /sample/src/main/java/com/mlsdev/sample/SimpleAdapter.java: -------------------------------------------------------------------------------- 1 | package com.mlsdev.sample; 2 | 3 | import android.view.LayoutInflater; 4 | import android.view.View; 5 | import android.view.ViewGroup; 6 | import android.widget.FrameLayout; 7 | 8 | import androidx.annotation.NonNull; 9 | import androidx.recyclerview.widget.RecyclerView; 10 | 11 | public class SimpleAdapter extends RecyclerView.Adapter { 12 | 13 | private final int itemCount = 50; 14 | private int[] backgrounds = new int[3]; 15 | 16 | public SimpleAdapter() { 17 | backgrounds[0] = R.drawable.background_primary_light; 18 | backgrounds[1] = R.drawable.background_primary_dark; 19 | backgrounds[2] = R.drawable.background_primary_accent; 20 | } 21 | 22 | @NonNull 23 | @Override 24 | public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { 25 | int index = (int) (Math.random() * 3); 26 | return new ViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.layout_list_item, parent, false), index); 27 | } 28 | 29 | @Override 30 | public void onBindViewHolder(@NonNull ViewHolder holder, int position) { 31 | holder.view.setBackgroundResource(backgrounds[holder.backgroundIndex]); 32 | } 33 | 34 | @Override 35 | public int getItemCount() { 36 | return itemCount; 37 | } 38 | 39 | class ViewHolder extends RecyclerView.ViewHolder { 40 | private FrameLayout view; 41 | private int backgroundIndex = 0; 42 | 43 | ViewHolder(View itemView, int backgroundIndex) { 44 | super(itemView); 45 | this.backgroundIndex = backgroundIndex; 46 | view = (FrameLayout) itemView.findViewById(R.id.item); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /sample/src/main/java/com/mlsdev/sample/fragment/SampleFragment.java: -------------------------------------------------------------------------------- 1 | package com.mlsdev.sample.fragment; 2 | 3 | import android.os.Bundle; 4 | import android.view.LayoutInflater; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | 8 | import androidx.annotation.NonNull; 9 | import androidx.annotation.Nullable; 10 | import androidx.fragment.app.Fragment; 11 | import androidx.recyclerview.widget.RecyclerView; 12 | 13 | import com.mlsdev.animatedrv.AnimatedRecyclerView; 14 | import com.mlsdev.sample.R; 15 | import com.mlsdev.sample.SampleActivity; 16 | import com.mlsdev.sample.SimpleAdapter; 17 | 18 | public class SampleFragment extends Fragment { 19 | private SimpleAdapter adapter = new SimpleAdapter(); 20 | 21 | public static Fragment newInstance(@NonNull Bundle args) { 22 | SampleFragment fragment = new SampleFragment(); 23 | fragment.setArguments(args); 24 | return fragment; 25 | } 26 | 27 | @Nullable 28 | @Override 29 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 30 | Bundle args = getArguments(); 31 | String title = "Sample"; 32 | int layout = R.layout.fragment_list_from_bottom; 33 | if (args != null) { 34 | title = args.getString(SampleActivity.TITLE_KEY); 35 | layout = args.getInt(SampleActivity.LAYOUT_KEY); 36 | } 37 | 38 | ((SampleActivity) getActivity()).getSupportActionBar().setTitle(title); 39 | 40 | View view = inflater.inflate(layout, container, false); 41 | RecyclerView recyclerView = (AnimatedRecyclerView) view.findViewById(R.id.recycler_view); 42 | recyclerView.setAdapter(adapter); 43 | adapter.notifyDataSetChanged(); 44 | recyclerView.scheduleLayoutAnimation(); 45 | 46 | return view; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /library/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | dependencies { 6 | //noinspection GradleDependency 7 | classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4' 8 | //noinspection GradleDependency 9 | classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1' 10 | } 11 | } 12 | 13 | apply plugin: 'com.android.library' 14 | apply plugin: 'com.github.dcendents.android-maven' 15 | apply plugin: "com.jfrog.bintray" 16 | 17 | android { 18 | compileSdkVersion 28 19 | 20 | defaultConfig { 21 | minSdkVersion 16 22 | targetSdkVersion 28 23 | versionCode 1 24 | versionName "2.0.0" 25 | 26 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 27 | 28 | } 29 | buildTypes { 30 | release { 31 | minifyEnabled false 32 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 33 | } 34 | } 35 | } 36 | 37 | ext { 38 | bintrayRepo = 'AnimatedRecyclerView' 39 | bintrayName = 'AnimatedRecyclerView' 40 | 41 | publishedGroupId = 'com.mlsdev.animatedrv' 42 | libraryName = 'library' 43 | artifact = 'library' 44 | 45 | libraryDescription = 'A RecyclerView with layout animations' 46 | 47 | siteUrl = 'https://github.com/MLSDev/AnimatedRecyclerView' 48 | gitUrl = 'https://github.com/MLSDev/AnimatedRecyclerView.git' 49 | 50 | libraryVersion = '2.0.0' 51 | 52 | developerId = 'mlsdev' 53 | developerName = 'MLSDev' 54 | developerEmail = 'dev@mlsdev.com' 55 | 56 | licenseName = 'The Apache Software License, Version 2.0' 57 | licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt' 58 | allLicenses = ["Apache-2.0"] 59 | } 60 | 61 | dependencies { 62 | implementation fileTree(dir: 'libs', include: ['*.jar']) 63 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 64 | implementation 'androidx.appcompat:appcompat:1.0.2' 65 | implementation 'androidx.recyclerview:recyclerview:1.0.0' 66 | testImplementation 'junit:junit:4.12' 67 | } 68 | 69 | repositories { 70 | mavenCentral() 71 | } 72 | 73 | if (project.rootProject.file('local.properties').exists()) { 74 | apply from: 'https://raw.githubusercontent.com/wajahatkarim3/JCenter-Gradle-Scripts/master/install.gradle' 75 | apply from: 'https://raw.githubusercontent.com/wajahatkarim3/JCenter-Gradle-Scripts/master/bintray.gradle' 76 | } -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /sample/src/main/java/com/mlsdev/sample/fragment/OptionsFragment.java: -------------------------------------------------------------------------------- 1 | package com.mlsdev.sample.fragment; 2 | 3 | import android.os.Bundle; 4 | import android.view.LayoutInflater; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | 8 | import androidx.annotation.LayoutRes; 9 | import androidx.annotation.Nullable; 10 | import androidx.annotation.StringRes; 11 | import androidx.databinding.DataBindingUtil; 12 | import androidx.fragment.app.Fragment; 13 | 14 | import com.mlsdev.sample.R; 15 | import com.mlsdev.sample.SampleActivity; 16 | import com.mlsdev.sample.databinding.FragmentOptionsBinding; 17 | 18 | public class OptionsFragment extends Fragment { 19 | private FragmentOptionsBinding binding; 20 | 21 | private void replaceFragment(@StringRes int title, @LayoutRes int layout) { 22 | ((SampleActivity) getActivity()).getSupportActionBar().setHomeButtonEnabled(true); 23 | ((SampleActivity) getActivity()).getSupportActionBar().setDisplayHomeAsUpEnabled(true); 24 | 25 | Bundle bundle = new Bundle(); 26 | bundle.putString(SampleActivity.TITLE_KEY, getString(title)); 27 | bundle.putInt(SampleActivity.LAYOUT_KEY, layout); 28 | Fragment fragment = SampleFragment.newInstance(bundle); 29 | getActivity().getSupportFragmentManager().beginTransaction() 30 | .addToBackStack(fragment.getTag()) 31 | .replace(R.id.content, fragment) 32 | .commit(); 33 | } 34 | 35 | @Nullable 36 | @Override 37 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 38 | binding = DataBindingUtil.inflate(inflater, R.layout.fragment_options, container, false); 39 | 40 | binding.btnListFromBottom.setOnClickListener(new View.OnClickListener() { 41 | @Override 42 | public void onClick(View v) { 43 | replaceFragment(R.string.btn_list_from_bottom, R.layout.fragment_list_from_bottom); 44 | } 45 | }); 46 | 47 | binding.btnListFromBottomScale.setOnClickListener(new View.OnClickListener() { 48 | @Override 49 | public void onClick(View v) { 50 | replaceFragment(R.string.btn_list_from_bottom_scale, R.layout.fragment_list_from_bottom_scale); 51 | } 52 | }); 53 | 54 | binding.btnGridFromBottom.setOnClickListener(new View.OnClickListener() { 55 | @Override 56 | public void onClick(View v) { 57 | replaceFragment(R.string.btn_grid_from_bottom, R.layout.fragment_grid_from_bottom); 58 | } 59 | }); 60 | 61 | binding.btnGridFromBottomScale.setOnClickListener(new View.OnClickListener() { 62 | @Override 63 | public void onClick(View v) { 64 | replaceFragment(R.string.btn_grid_from_bottom_scale, R.layout.fragment_grid_from_bottom_scale); 65 | } 66 | }); 67 | 68 | binding.btnGridFromBottomRandom.setOnClickListener(new View.OnClickListener() { 69 | @Override 70 | public void onClick(View v) { 71 | replaceFragment(R.string.btn_grid_from_bottom_random, R.layout.fragment_grid_from_bottom_random); 72 | } 73 | }); 74 | 75 | binding.btnGridRandomScale.setOnClickListener(new View.OnClickListener() { 76 | @Override 77 | public void onClick(View v) { 78 | replaceFragment(R.string.btn_grid_random_scale, R.layout.fragment_grid_from_bottom_random_scale); 79 | } 80 | }); 81 | 82 | return binding.getRoot(); 83 | } 84 | 85 | } 86 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Travis-ci](https://api.travis-ci.org/MLSDev/AnimatedRecyclerView.svg) 2 | [![License](https://img.shields.io/hexpm/l/plug.svg)](https://opensource.org/licenses/Apache-2.0) 3 | [![Download](https://api.bintray.com/packages/spetrosiukmlsdev/AnimatedRecyclerView/AnimatedRecyclerView/images/download.svg)](https://bintray.com/spetrosiukmlsdev/AnimatedRecyclerView/AnimatedRecyclerView/_latestVersion) 4 | 5 | # AnimatedRecyclerView 6 | A RecyclerView with layout animations 7 | 8 | ## Demo 9 | 10 | 11 | ## Setup 12 | To use this library your `minSdkVersion` must be >= 16. 13 | 14 | In your build.gradle : 15 | ```gradle 16 | dependencies { 17 | implementation "com.mlsdev.animatedrv:library:1.0.1" 18 | } 19 | ``` 20 | 21 | #### AndroidX support 22 | ```gradle 23 | dependencies { 24 | implementation "com.mlsdev.animatedrv:library:2.0.0" 25 | } 26 | ``` 27 | 28 | ## Example 29 | ### From the layout 30 | ```xml 31 | 40 | ``` 41 | #### You can create any layout animations 42 | ```xml 43 | 47 | ``` 48 | ```xml 49 | 51 | 52 | 56 | 57 | 61 | 62 | 63 | ``` 64 | 65 | ### From the code 66 | ```java 67 | AnimatedRecyclerView recyclerView = new AnimatedRecyclerView.Builder(this) 68 | .orientation(LinearLayoutManager.VERTICAL) 69 | .layoutManagerType(AnimatedRecyclerView.LayoutManagerType.LINEAR) 70 | .animation(R.anim.layout_animation_from_bottom) 71 | .animationDuration(600) 72 | .reverse(false) 73 | .build(); 74 | ``` 75 | 76 | ### Start animation 77 | - First option 78 | ```java 79 | adapter.notifyDataSetChanged(); 80 | recyclerView.scheduleLayoutAnimation(); 81 | ``` 82 | - Second option 83 | Your `RecyclerView` must be casted to the `AnimatedRecyclerView` and an adapter must be set. 84 | ```java 85 | recyclerView.notifyDataSetChanged(); 86 | ``` 87 | 88 | ## Authors 89 | * [Sergey Petrosyuk](mailto:petrosyuk@mlsdev.com), MLSDev 90 | 91 | ## About MLSDev 92 | 93 | [MLSDev.com][mlsdev] 94 | 95 | AnimatedRecyclerView is maintained by MLSDev, Inc. We specialize in providing all-in-one solution in mobile and web development. Our team follows Lean principles and works according to agile methodologies to deliver the best results reducing the budget for development and its timeline. 96 | 97 | Find out more [here][mlsdev] and don't hesitate to [contact us][contact]! 98 | 99 | [mlsdev]: http://mlsdev.com 100 | [contact]: http://mlsdev.com/contact_us 101 | [github-frederikos]: https://github.com/SerhiyPetrosyuk 102 | -------------------------------------------------------------------------------- /sample/src/main/res/layout/fragment_options.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 13 | 14 | 18 | 19 | 26 | 27 |