├── simple ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── img.jpg │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── img1.jpg │ │ │ │ ├── img2.jpg │ │ │ │ ├── img3.jpg │ │ │ │ ├── img4.jpg │ │ │ │ ├── img5.jpg │ │ │ │ ├── pic1.jpeg │ │ │ │ ├── pic2.jpg │ │ │ │ ├── pic3.jpg │ │ │ │ ├── pic4.jpeg │ │ │ │ ├── pic5.jpg │ │ │ │ ├── btn_love.png │ │ │ │ ├── btn_loved.png │ │ │ │ ├── btn_praise.png │ │ │ │ ├── btn_share.png │ │ │ │ ├── btn_download.png │ │ │ │ ├── btn_praised.png │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── btn_downloaded.png │ │ │ │ ├── ic_share_white_24dp.png │ │ │ │ ├── ic_file_download_white_24dp.png │ │ │ │ ├── ic_keyboard_tab_white_24dp.png │ │ │ │ └── ic_favorite_border_white_24dp.png │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── values-v19 │ │ │ │ └── dimens.xml │ │ │ ├── drawable │ │ │ │ ├── sel_btn_love.xml │ │ │ │ ├── sel_btn_praise.xml │ │ │ │ └── sel_btn_download.xml │ │ │ ├── values │ │ │ │ ├── colors.xml │ │ │ │ ├── dimens.xml │ │ │ │ ├── styles.xml │ │ │ │ └── strings.xml │ │ │ ├── menu │ │ │ │ ├── menu_drag.xml │ │ │ │ ├── menu_blur.xml │ │ │ │ └── menu_animate.xml │ │ │ ├── values-w820dp │ │ │ │ └── dimens.xml │ │ │ └── layout │ │ │ │ ├── layout_toolbar.xml │ │ │ │ ├── adapter_thumb.xml │ │ │ │ ├── activity_main.xml │ │ │ │ ├── activity_animate.xml │ │ │ │ ├── activity_drag.xml │ │ │ │ ├── activity_drag_outside.xml │ │ │ │ └── activity_drag_blur.xml │ │ ├── gen │ │ │ └── com │ │ │ │ └── dl7 │ │ │ │ └── simple │ │ │ │ └── drag │ │ │ │ ├── R.java │ │ │ │ ├── Manifest.java │ │ │ │ └── BuildConfig.java │ │ ├── java │ │ │ └── com │ │ │ │ └── dl7 │ │ │ │ └── simple │ │ │ │ └── drag │ │ │ │ ├── AnimateHelper.java │ │ │ │ ├── adapter │ │ │ │ ├── ThumbAdapter.java │ │ │ │ ├── PhotoPagerAdapter.java │ │ │ │ ├── BaseRecyclerAdapter.java │ │ │ │ ├── DividerItemDecoration.java │ │ │ │ └── DividerGridItemDecoration.java │ │ │ │ ├── utils │ │ │ │ ├── AnimateHelper.java │ │ │ │ └── RecyclerViewHelper.java │ │ │ │ ├── MainActivity.java │ │ │ │ └── activity │ │ │ │ ├── BaseActivity.java │ │ │ │ ├── DragBlurActivity.java │ │ │ │ ├── DragActivity.java │ │ │ │ ├── DragOutsideActivity.java │ │ │ │ └── AnimateActivity.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── dl7 │ │ │ └── simple │ │ │ └── drag │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── dl7 │ │ └── simple │ │ └── drag │ │ └── ApplicationTest.java ├── proguard-rules.pro └── build.gradle ├── dragsloplayout ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ └── values │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── dl7 │ │ │ └── drag │ │ │ ├── animate │ │ │ ├── CustomViewAnimator.java │ │ │ ├── in │ │ │ │ ├── FadeInAnimator.java │ │ │ │ ├── FlipInXAnimator.java │ │ │ │ ├── FlipInYAnimator.java │ │ │ │ ├── SlideInBottomAnimator.java │ │ │ │ ├── ZoomInAnimator.java │ │ │ │ ├── SlideInLeftAnimator.java │ │ │ │ ├── SlideInRightAnimator.java │ │ │ │ ├── ZoomInLeftAnimator.java │ │ │ │ └── ZoomInRightAnimator.java │ │ │ ├── out │ │ │ │ ├── FadeOutAnimator.java │ │ │ │ ├── FlipOutXAnimator.java │ │ │ │ ├── FlipOutYAnimator.java │ │ │ │ ├── SlideOutLeftAnimator.java │ │ │ │ ├── ZoomOutAnimator.java │ │ │ │ ├── SlideOutRightAnimator.java │ │ │ │ ├── SlideOutBottomAnimator.java │ │ │ │ ├── ZoomOutLeftAnimator.java │ │ │ │ └── ZoomOutRightAnimator.java │ │ │ ├── BaseViewAnimator.java │ │ │ └── AnimatorPresenter.java │ │ │ ├── BitmapUtils.java │ │ │ └── DragSlopLayout.java │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── dl7 │ │ │ └── drag │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── dl7 │ │ └── drag │ │ └── ApplicationTest.java ├── proguard-rules.pro ├── build.gradle └── bintray-publish.gradle ├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── gradle.properties ├── gradlew.bat ├── README.md └── gradlew /simple/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /dragsloplayout/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':dragsloplayout', ':simple' 2 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rukey7/DragSlopLayout/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /dragsloplayout/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | DragSlopLayout 3 | 4 | -------------------------------------------------------------------------------- /simple/src/main/res/mipmap-xhdpi/img.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rukey7/DragSlopLayout/HEAD/simple/src/main/res/mipmap-xhdpi/img.jpg -------------------------------------------------------------------------------- /simple/src/main/res/mipmap-xxhdpi/img1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rukey7/DragSlopLayout/HEAD/simple/src/main/res/mipmap-xxhdpi/img1.jpg -------------------------------------------------------------------------------- /simple/src/main/res/mipmap-xxhdpi/img2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rukey7/DragSlopLayout/HEAD/simple/src/main/res/mipmap-xxhdpi/img2.jpg -------------------------------------------------------------------------------- /simple/src/main/res/mipmap-xxhdpi/img3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rukey7/DragSlopLayout/HEAD/simple/src/main/res/mipmap-xxhdpi/img3.jpg -------------------------------------------------------------------------------- /simple/src/main/res/mipmap-xxhdpi/img4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rukey7/DragSlopLayout/HEAD/simple/src/main/res/mipmap-xxhdpi/img4.jpg -------------------------------------------------------------------------------- /simple/src/main/res/mipmap-xxhdpi/img5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rukey7/DragSlopLayout/HEAD/simple/src/main/res/mipmap-xxhdpi/img5.jpg -------------------------------------------------------------------------------- /simple/src/main/res/mipmap-xxhdpi/pic1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rukey7/DragSlopLayout/HEAD/simple/src/main/res/mipmap-xxhdpi/pic1.jpeg -------------------------------------------------------------------------------- /simple/src/main/res/mipmap-xxhdpi/pic2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rukey7/DragSlopLayout/HEAD/simple/src/main/res/mipmap-xxhdpi/pic2.jpg -------------------------------------------------------------------------------- /simple/src/main/res/mipmap-xxhdpi/pic3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rukey7/DragSlopLayout/HEAD/simple/src/main/res/mipmap-xxhdpi/pic3.jpg -------------------------------------------------------------------------------- /simple/src/main/res/mipmap-xxhdpi/pic4.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rukey7/DragSlopLayout/HEAD/simple/src/main/res/mipmap-xxhdpi/pic4.jpeg -------------------------------------------------------------------------------- /simple/src/main/res/mipmap-xxhdpi/pic5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rukey7/DragSlopLayout/HEAD/simple/src/main/res/mipmap-xxhdpi/pic5.jpg -------------------------------------------------------------------------------- /simple/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rukey7/DragSlopLayout/HEAD/simple/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /simple/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rukey7/DragSlopLayout/HEAD/simple/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /simple/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rukey7/DragSlopLayout/HEAD/simple/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /simple/src/main/res/mipmap-xxhdpi/btn_love.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rukey7/DragSlopLayout/HEAD/simple/src/main/res/mipmap-xxhdpi/btn_love.png -------------------------------------------------------------------------------- /simple/src/main/res/mipmap-xxhdpi/btn_loved.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rukey7/DragSlopLayout/HEAD/simple/src/main/res/mipmap-xxhdpi/btn_loved.png -------------------------------------------------------------------------------- /simple/src/main/res/mipmap-xxhdpi/btn_praise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rukey7/DragSlopLayout/HEAD/simple/src/main/res/mipmap-xxhdpi/btn_praise.png -------------------------------------------------------------------------------- /simple/src/main/res/mipmap-xxhdpi/btn_share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rukey7/DragSlopLayout/HEAD/simple/src/main/res/mipmap-xxhdpi/btn_share.png -------------------------------------------------------------------------------- /simple/src/main/res/mipmap-xxhdpi/btn_download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rukey7/DragSlopLayout/HEAD/simple/src/main/res/mipmap-xxhdpi/btn_download.png -------------------------------------------------------------------------------- /simple/src/main/res/mipmap-xxhdpi/btn_praised.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rukey7/DragSlopLayout/HEAD/simple/src/main/res/mipmap-xxhdpi/btn_praised.png -------------------------------------------------------------------------------- /simple/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rukey7/DragSlopLayout/HEAD/simple/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /simple/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rukey7/DragSlopLayout/HEAD/simple/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /simple/src/main/res/values-v19/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 24dp 5 | 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | /.idea/ 10 | -------------------------------------------------------------------------------- /simple/src/main/res/mipmap-xxhdpi/btn_downloaded.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rukey7/DragSlopLayout/HEAD/simple/src/main/res/mipmap-xxhdpi/btn_downloaded.png -------------------------------------------------------------------------------- /simple/src/main/res/mipmap-xxhdpi/ic_share_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rukey7/DragSlopLayout/HEAD/simple/src/main/res/mipmap-xxhdpi/ic_share_white_24dp.png -------------------------------------------------------------------------------- /simple/src/main/res/mipmap-xxhdpi/ic_file_download_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rukey7/DragSlopLayout/HEAD/simple/src/main/res/mipmap-xxhdpi/ic_file_download_white_24dp.png -------------------------------------------------------------------------------- /simple/src/main/res/mipmap-xxhdpi/ic_keyboard_tab_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rukey7/DragSlopLayout/HEAD/simple/src/main/res/mipmap-xxhdpi/ic_keyboard_tab_white_24dp.png -------------------------------------------------------------------------------- /simple/src/main/res/mipmap-xxhdpi/ic_favorite_border_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rukey7/DragSlopLayout/HEAD/simple/src/main/res/mipmap-xxhdpi/ic_favorite_border_white_24dp.png -------------------------------------------------------------------------------- /simple/src/main/gen/com/dl7/simple/drag/R.java: -------------------------------------------------------------------------------- 1 | /*___Generated_by_IDEA___*/ 2 | 3 | package com.dl7.simple.drag; 4 | 5 | /* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */ 6 | public final class R { 7 | } -------------------------------------------------------------------------------- /simple/src/main/gen/com/dl7/simple/drag/Manifest.java: -------------------------------------------------------------------------------- 1 | /*___Generated_by_IDEA___*/ 2 | 3 | package com.dl7.simple.drag; 4 | 5 | /* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */ 6 | public final class Manifest { 7 | } -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Dec 28 10:00:20 PST 2015 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-2.14.1-all.zip 7 | -------------------------------------------------------------------------------- /simple/src/main/res/drawable/sel_btn_love.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /simple/src/main/res/drawable/sel_btn_praise.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /simple/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | #44000000 7 | 8 | -------------------------------------------------------------------------------- /simple/src/main/res/drawable/sel_btn_download.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /simple/src/main/res/menu/menu_drag.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | -------------------------------------------------------------------------------- /simple/src/main/gen/com/dl7/simple/drag/BuildConfig.java: -------------------------------------------------------------------------------- 1 | /*___Generated_by_IDEA___*/ 2 | 3 | package com.dl7.simple.drag; 4 | 5 | /* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ 6 | public final class BuildConfig { 7 | public final static boolean DEBUG = Boolean.parseBoolean(null); 8 | } -------------------------------------------------------------------------------- /dragsloplayout/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /simple/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | 50dp 7 | 8 | 9 | 0dp 10 | 11 | -------------------------------------------------------------------------------- /simple/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /dragsloplayout/src/test/java/com/dl7/drag/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.dl7.drag; 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 | } -------------------------------------------------------------------------------- /simple/src/test/java/com/dl7/simple/drag/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.dl7.simple.drag; 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 | } -------------------------------------------------------------------------------- /dragsloplayout/src/androidTest/java/com/dl7/drag/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.dl7.drag; 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 | } -------------------------------------------------------------------------------- /simple/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /simple/src/androidTest/java/com/dl7/simple/drag/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.dl7.simple.drag; 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 | } -------------------------------------------------------------------------------- /dragsloplayout/src/main/java/com/dl7/drag/animate/CustomViewAnimator.java: -------------------------------------------------------------------------------- 1 | package com.dl7.drag.animate; 2 | 3 | import android.animation.Animator; 4 | import android.view.View; 5 | 6 | /** 7 | * Created by long on 2016/9/12. 8 | * 自定义动画 9 | */ 10 | public abstract class CustomViewAnimator extends BaseViewAnimator { 11 | 12 | @Override 13 | protected void prepare(View target) { 14 | mAnimatorSet.playTogether(doAnimator()); 15 | } 16 | 17 | protected abstract Animator doAnimator(); 18 | } 19 | -------------------------------------------------------------------------------- /simple/src/main/res/menu/menu_blur.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 11 | 12 | 15 | 16 | -------------------------------------------------------------------------------- /simple/src/main/res/layout/layout_toolbar.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /simple/src/main/res/layout/adapter_thumb.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 13 | -------------------------------------------------------------------------------- /dragsloplayout/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /simple/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 F:\WorkTools\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 | -------------------------------------------------------------------------------- /dragsloplayout/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 F:\WorkTools\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 | -------------------------------------------------------------------------------- /dragsloplayout/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'com.github.dcendents.android-maven' 3 | group='com.github.Rukey7' 4 | 5 | android { 6 | compileSdkVersion 23 7 | buildToolsVersion "24.0.2" 8 | 9 | defaultConfig { 10 | minSdkVersion 14 11 | targetSdkVersion 23 12 | versionCode 5 13 | versionName "1.0.5" 14 | renderscriptTargetApi 23 15 | renderscriptSupportModeEnabled true 16 | } 17 | buildTypes { 18 | release { 19 | minifyEnabled false 20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 21 | } 22 | } 23 | } 24 | 25 | dependencies { 26 | compile fileTree(dir: 'libs', include: ['*.jar']) 27 | testCompile 'junit:junit:4.12' 28 | compile 'com.android.support:appcompat-v7:23.4.0' 29 | } 30 | -------------------------------------------------------------------------------- /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 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /simple/src/main/java/com/dl7/simple/drag/AnimateHelper.java: -------------------------------------------------------------------------------- 1 | package com.dl7.simple.drag; 2 | 3 | import android.animation.AnimatorSet; 4 | import android.animation.ObjectAnimator; 5 | import android.view.View; 6 | 7 | /** 8 | * Created by long on 2016/9/27. 9 | * 动画帮助类 10 | */ 11 | public final class AnimateHelper { 12 | 13 | private AnimateHelper() { 14 | throw new RuntimeException("AnimateHelper cannot be initialized!"); 15 | } 16 | 17 | /** 18 | * 心跳动画 19 | * @param view 视图 20 | * @param duration 时间 21 | */ 22 | public static void doHeartBeat(View view, int duration) { 23 | AnimatorSet set = new AnimatorSet(); 24 | set.playTogether( 25 | ObjectAnimator.ofFloat(view, "scaleX", 1.0f, 1.4f, 0.9f, 1.0f), 26 | ObjectAnimator.ofFloat(view, "scaleY", 1.0f, 1.4f, 0.9f, 1.0f) 27 | ); 28 | set.setDuration(duration); 29 | set.start(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /dragsloplayout/src/main/java/com/dl7/drag/BitmapUtils.java: -------------------------------------------------------------------------------- 1 | package com.dl7.drag; 2 | 3 | import android.graphics.Bitmap; 4 | import android.graphics.Matrix; 5 | 6 | /** 7 | * Bitmap工具类主要包括获取Bitmap和对Bitmap的操作 8 | */ 9 | final public class BitmapUtils { 10 | 11 | /** 12 | * Don't let anyone instantiate this class. 13 | */ 14 | private BitmapUtils() { 15 | throw new Error("Do not need instantiate!"); 16 | } 17 | 18 | /** 19 | * 放大缩小图片 20 | * 21 | * @param bitmap 源Bitmap 22 | * @param w 宽 23 | * @param h 高 24 | * @return 目标Bitmap 25 | */ 26 | public static Bitmap zoom(Bitmap bitmap, int w, int h) { 27 | int width = bitmap.getWidth(); 28 | int height = bitmap.getHeight(); 29 | Matrix matrix = new Matrix(); 30 | float scaleWidht = ((float) w / width); 31 | float scaleHeight = ((float) h / height); 32 | matrix.postScale(scaleWidht, scaleHeight); 33 | Bitmap newbmp = Bitmap.createBitmap(bitmap, 0, 0, width, height, 34 | matrix, true); 35 | return newbmp; 36 | } 37 | 38 | } -------------------------------------------------------------------------------- /simple/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /simple/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'android-apt' 3 | 4 | android { 5 | compileSdkVersion 23 6 | buildToolsVersion "24.0.2" 7 | 8 | defaultConfig { 9 | applicationId "com.dl7.simple.drag" 10 | minSdkVersion 14 11 | targetSdkVersion 23 12 | versionCode 1 13 | versionName "1.0" 14 | renderscriptTargetApi 23 15 | renderscriptSupportModeEnabled true 16 | } 17 | buildTypes { 18 | release { 19 | minifyEnabled false 20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 21 | } 22 | } 23 | } 24 | 25 | dependencies { 26 | compile fileTree(include: ['*.jar'], dir: 'libs') 27 | testCompile 'junit:junit:4.12' 28 | compile 'com.android.support:appcompat-v7:23.4.0' 29 | compile 'com.android.support:design:23.4.0' 30 | compile project(':dragsloplayout') 31 | // compile 'com.github.Rukey7:DragSlopLayout:1.0.2' 32 | // compile 'com.github.Rukey7:DragSlopLayout:1.0.2-blur' 33 | // photoview 34 | compile 'com.github.chrisbanes.photoview:library:1.2.4' 35 | // butterknife 36 | compile 'com.jakewharton:butterknife:8.4.0' 37 | apt 'com.jakewharton:butterknife-compiler:8.4.0' 38 | 39 | } 40 | -------------------------------------------------------------------------------- /simple/src/main/java/com/dl7/simple/drag/adapter/ThumbAdapter.java: -------------------------------------------------------------------------------- 1 | package com.dl7.simple.drag.adapter; 2 | 3 | import android.content.Context; 4 | import android.support.v7.widget.RecyclerView; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | import android.widget.ImageView; 9 | 10 | import com.dl7.simple.drag.R; 11 | 12 | import java.util.List; 13 | 14 | /** 15 | * Created by long on 2017/1/6. 16 | */ 17 | public class ThumbAdapter extends BaseRecyclerAdapter { 18 | 19 | public ThumbAdapter(Context context) { 20 | super(context); 21 | } 22 | 23 | public ThumbAdapter(Context context, List datas) { 24 | super(context, datas); 25 | } 26 | 27 | @Override 28 | public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 29 | View view = LayoutInflater.from(mContext).inflate(R.layout.adapter_thumb, parent, false); 30 | ViewHolder viewHolder = new ViewHolder(view); 31 | return viewHolder; 32 | } 33 | 34 | @Override 35 | public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { 36 | ((ViewHolder)holder).ivPhoto.setImageResource(mDatas.get(position)); 37 | } 38 | 39 | public static class ViewHolder extends RecyclerView.ViewHolder{ 40 | public ImageView ivPhoto; 41 | 42 | public ViewHolder(View rootView) { 43 | super(rootView); 44 | this.ivPhoto = (ImageView) rootView.findViewById(R.id.iv_photo); 45 | } 46 | 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /simple/src/main/res/menu/menu_animate.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 12 | 13 | 17 | 18 | 21 | 22 | 25 | 26 | 29 | 30 | 33 | 34 | 37 | 38 | 41 | 42 | 45 | 46 | 49 | 50 | 53 | 54 | 57 | 58 | -------------------------------------------------------------------------------- /dragsloplayout/src/main/java/com/dl7/drag/animate/in/FadeInAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.dl7.drag.animate.in; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.dl7.drag.animate.BaseViewAnimator; 31 | 32 | 33 | public class FadeInAnimator extends BaseViewAnimator { 34 | @Override 35 | public void prepare(View target) { 36 | getAnimatorAgent().playTogether( 37 | ObjectAnimator.ofFloat(target, "alpha", 0, 1) 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /dragsloplayout/src/main/java/com/dl7/drag/animate/out/FadeOutAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.dl7.drag.animate.out; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.dl7.drag.animate.BaseViewAnimator; 31 | 32 | 33 | public class FadeOutAnimator extends BaseViewAnimator { 34 | @Override 35 | public void prepare(View target) { 36 | getAnimatorAgent().playTogether( 37 | ObjectAnimator.ofFloat(target, "alpha", 1, 0) 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /dragsloplayout/src/main/java/com/dl7/drag/animate/out/FlipOutXAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.dl7.drag.animate.out; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.dl7.drag.animate.BaseViewAnimator; 31 | 32 | 33 | public class FlipOutXAnimator extends BaseViewAnimator { 34 | @Override 35 | public void prepare(View target) { 36 | getAnimatorAgent().playTogether( 37 | ObjectAnimator.ofFloat(target, "rotationX", 0, 90), 38 | ObjectAnimator.ofFloat(target, "alpha", 1, 0) 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /dragsloplayout/src/main/java/com/dl7/drag/animate/out/FlipOutYAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.dl7.drag.animate.out; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.dl7.drag.animate.BaseViewAnimator; 31 | 32 | 33 | public class FlipOutYAnimator extends BaseViewAnimator { 34 | @Override 35 | public void prepare(View target) { 36 | getAnimatorAgent().playTogether( 37 | ObjectAnimator.ofFloat(target, "rotationY", 0, 90), 38 | ObjectAnimator.ofFloat(target, "alpha", 1, 0) 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /dragsloplayout/src/main/java/com/dl7/drag/animate/in/FlipInXAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.dl7.drag.animate.in; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.dl7.drag.animate.BaseViewAnimator; 31 | 32 | 33 | public class FlipInXAnimator extends BaseViewAnimator { 34 | @Override 35 | public void prepare(View target) { 36 | getAnimatorAgent().playTogether( 37 | ObjectAnimator.ofFloat(target, "rotationX", 90, -15, 15, 0), 38 | ObjectAnimator.ofFloat(target, "alpha", 0.25f, 0.5f, 0.75f, 1) 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /dragsloplayout/src/main/java/com/dl7/drag/animate/in/FlipInYAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.dl7.drag.animate.in; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.dl7.drag.animate.BaseViewAnimator; 31 | 32 | 33 | public class FlipInYAnimator extends BaseViewAnimator { 34 | @Override 35 | public void prepare(View target) { 36 | getAnimatorAgent().playTogether( 37 | ObjectAnimator.ofFloat(target, "rotationY", 90, -15, 15, 0), 38 | ObjectAnimator.ofFloat(target, "alpha", 0.25f, 0.5f, 0.75f, 1) 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /dragsloplayout/src/main/java/com/dl7/drag/animate/in/SlideInBottomAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.dl7.drag.animate.in; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.dl7.drag.animate.BaseViewAnimator; 31 | 32 | 33 | public class SlideInBottomAnimator extends BaseViewAnimator { 34 | @Override 35 | public void prepare(View target) { 36 | getAnimatorAgent().playTogether( 37 | ObjectAnimator.ofFloat(target, "alpha", 0, 1), 38 | ObjectAnimator.ofFloat(target, "translationY", target.getHeight(), 0) 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /dragsloplayout/src/main/java/com/dl7/drag/animate/out/SlideOutLeftAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.dl7.drag.animate.out; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.dl7.drag.animate.BaseViewAnimator; 31 | 32 | 33 | public class SlideOutLeftAnimator extends BaseViewAnimator { 34 | @Override 35 | public void prepare(View target) { 36 | getAnimatorAgent().playTogether( 37 | ObjectAnimator.ofFloat(target, "alpha", 1, 0), 38 | ObjectAnimator.ofFloat(target, "translationX", 0, -target.getRight()) 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /dragsloplayout/src/main/java/com/dl7/drag/animate/in/ZoomInAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.dl7.drag.animate.in; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.dl7.drag.animate.BaseViewAnimator; 31 | 32 | 33 | public class ZoomInAnimator extends BaseViewAnimator { 34 | @Override 35 | public void prepare(View target) { 36 | getAnimatorAgent().playTogether( 37 | ObjectAnimator.ofFloat(target, "scaleX", 0.45f, 1), 38 | ObjectAnimator.ofFloat(target, "scaleY", 0.45f, 1), 39 | ObjectAnimator.ofFloat(target, "alpha", 0, 1) 40 | ); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /simple/src/main/java/com/dl7/simple/drag/utils/AnimateHelper.java: -------------------------------------------------------------------------------- 1 | package com.dl7.simple.drag.utils; 2 | 3 | import android.animation.Animator; 4 | import android.animation.ObjectAnimator; 5 | import android.view.View; 6 | 7 | /** 8 | * Created by long on 2017/1/5. 9 | */ 10 | 11 | public final class AnimateHelper { 12 | 13 | private AnimateHelper() { 14 | throw new AssertionError(); 15 | } 16 | 17 | 18 | /** 19 | * 垂直偏移动画 20 | * @param view 21 | * @param startY 22 | * @param endY 23 | * @param duration 24 | * @return 25 | */ 26 | public static Animator doMoveVertical(View view, int startY, int endY, int duration) { 27 | ObjectAnimator animator = ObjectAnimator.ofFloat(view, "translationY", startY, endY).setDuration(duration); 28 | animator.start(); 29 | return animator; 30 | } 31 | 32 | 33 | /** 34 | * 动画是否在运行 35 | * @param animator 36 | */ 37 | public static boolean isRunning(Animator animator) { 38 | return animator != null && animator.isRunning(); 39 | } 40 | 41 | /** 42 | * 启动动画 43 | * @param animator 44 | */ 45 | public static void startAnimator(Animator animator) { 46 | if (animator != null && !animator.isRunning()) { 47 | animator.start(); 48 | } 49 | } 50 | 51 | /** 52 | * 停止动画 53 | * @param animator 54 | */ 55 | public static void stopAnimator(Animator animator) { 56 | if (animator != null && animator.isRunning()) { 57 | animator.cancel(); 58 | } 59 | } 60 | 61 | /** 62 | * 删除动画 63 | * @param animator 64 | */ 65 | public static void deleteAnimator(Animator animator) { 66 | if (animator != null && animator.isRunning()) { 67 | animator.cancel(); 68 | } 69 | animator = null; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /dragsloplayout/src/main/java/com/dl7/drag/animate/out/ZoomOutAnimator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 daimajia 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.dl7.drag.animate.out; 26 | 27 | import android.animation.ObjectAnimator; 28 | import android.view.View; 29 | 30 | import com.dl7.drag.animate.BaseViewAnimator; 31 | 32 | 33 | public class ZoomOutAnimator extends BaseViewAnimator { 34 | @Override 35 | protected void prepare(View target) { 36 | getAnimatorAgent().playTogether( 37 | ObjectAnimator.ofFloat(target, "alpha", 1, 0, 0), 38 | ObjectAnimator.ofFloat(target, "scaleX", 1, 0.3f, 0), 39 | ObjectAnimator.ofFloat(target, "scaleY", 1, 0.3f, 0) 40 | ); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /simple/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 18 | 19 |