├── simple ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── values │ │ │ │ ├── dimens.xml │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ │ ├── values-w820dp │ │ │ │ └── dimens.xml │ │ │ └── layout │ │ │ │ ├── activity_list_view.xml │ │ │ │ ├── activity_custom_list_view.xml │ │ │ │ ├── activity_grid_view.xml │ │ │ │ ├── activity_single_view.xml │ │ │ │ ├── custom_list_item.xml │ │ │ │ └── activity_main.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── arthur │ │ │ │ └── simple │ │ │ │ ├── custom │ │ │ │ ├── CustomImageInfo.java │ │ │ │ ├── CustomListViewActivity.java │ │ │ │ └── CustomListAdapter.java │ │ │ │ ├── MainActivity.java │ │ │ │ ├── GridViewActivity.java │ │ │ │ ├── ListViewActivity.java │ │ │ │ └── SingleViewActivity.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── arthur │ │ │ └── simple │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── arthur │ │ └── simple │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── library ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── styles.xml │ │ │ │ ├── dimens.xml │ │ │ │ └── colors.xml │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── values-w820dp │ │ │ │ └── dimens.xml │ │ │ ├── anim │ │ │ │ ├── activity_in.xml │ │ │ │ └── activity_out.xml │ │ │ └── layout │ │ │ │ ├── rollout_grid_view.xml │ │ │ │ ├── activity_rollout_preview.xml │ │ │ │ └── rollout_list_view.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── arthur │ │ │ │ └── rollout │ │ │ │ ├── model │ │ │ │ ├── RolloutBDInfo.java │ │ │ │ └── RolloutInfo.java │ │ │ │ ├── tools │ │ │ │ ├── RGlideUtil.java │ │ │ │ └── RCommonUtil.java │ │ │ │ ├── view │ │ │ │ ├── RSquareLayout.java │ │ │ │ └── RolloutViewPager.java │ │ │ │ ├── adapter │ │ │ │ ├── RListViewAdapter.java │ │ │ │ └── RGridViewAdapter.java │ │ │ │ └── activity │ │ │ │ ├── RolloutPreviewActivity.java │ │ │ │ └── RolloutBaseActivity.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── arthur │ │ │ └── rollout │ │ │ └── rolloutanimview │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── arthur │ │ └── rollout │ │ └── rolloutanimview │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── gif ├── rollout_1.gif ├── rollout_7.gif └── rollout_10.gif ├── .idea ├── copyright │ └── profiles_settings.xml ├── vcs.xml ├── modules.xml ├── runConfigurations.xml ├── compiler.xml ├── gradle.xml └── misc.xml ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── gradle.properties ├── README.md ├── gradlew.bat └── gradlew /simple/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /library/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | library.iml 3 | 4 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':library', ':simple' 2 | -------------------------------------------------------------------------------- /gif/rollout_1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Arthurshen98/RolloutAnimView/HEAD/gif/rollout_1.gif -------------------------------------------------------------------------------- /gif/rollout_7.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Arthurshen98/RolloutAnimView/HEAD/gif/rollout_7.gif -------------------------------------------------------------------------------- /gif/rollout_10.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Arthurshen98/RolloutAnimView/HEAD/gif/rollout_10.gif -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Arthurshen98/RolloutAnimView/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /library/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | RolloutAnimView 3 | 4 | -------------------------------------------------------------------------------- /simple/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Arthurshen98/RolloutAnimView/HEAD/simple/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /simple/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Arthurshen98/RolloutAnimView/HEAD/simple/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /library/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Arthurshen98/RolloutAnimView/HEAD/library/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /library/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Arthurshen98/RolloutAnimView/HEAD/library/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /library/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Arthurshen98/RolloutAnimView/HEAD/library/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /simple/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Arthurshen98/RolloutAnimView/HEAD/simple/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /simple/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Arthurshen98/RolloutAnimView/HEAD/simple/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /library/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Arthurshen98/RolloutAnimView/HEAD/library/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /library/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Arthurshen98/RolloutAnimView/HEAD/library/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /simple/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Arthurshen98/RolloutAnimView/HEAD/simple/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /library/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /simple/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /simple/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 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/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Simple 3 | 单张图片 4 | ListView 5 | GridView 6 | 自定义listView的形式 7 | 8 | -------------------------------------------------------------------------------- /library/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | 44dp 7 | 18dp 8 | 9 | -------------------------------------------------------------------------------- /library/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | #191919 7 | #00000000 8 | 9 | -------------------------------------------------------------------------------- /library/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /simple/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /library/src/main/java/com/arthur/rollout/model/RolloutBDInfo.java: -------------------------------------------------------------------------------- 1 | package com.arthur.rollout.model; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * Created by arthur on 2017/3/13. 7 | * 可以继承它 8 | */ 9 | 10 | public class RolloutBDInfo implements Serializable { 11 | //坐标 12 | public float x; 13 | public float y; 14 | //在容器中显示的image的宽 高 15 | public float width; 16 | public float height; 17 | } 18 | -------------------------------------------------------------------------------- /simple/src/main/java/com/arthur/simple/custom/CustomImageInfo.java: -------------------------------------------------------------------------------- 1 | package com.arthur.simple.custom; 2 | 3 | import com.arthur.rollout.model.RolloutInfo; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * Created by arthur on 2017/3/14. 9 | * 重写info保留RolloutInfo里面的属性 10 | */ 11 | 12 | public class CustomImageInfo extends RolloutInfo implements Serializable { 13 | 14 | public int id; 15 | public String text; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /simple/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /library/src/main/java/com/arthur/rollout/model/RolloutInfo.java: -------------------------------------------------------------------------------- 1 | package com.arthur.rollout.model; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * Created by arthur on 2017/3/13. 7 | * 可以继承它改变属性 8 | */ 9 | 10 | public class RolloutInfo implements Serializable { 11 | /** 12 | * 图片路径 13 | */ 14 | public String url; 15 | /** 16 | * 图片本身的宽 和 高,(清晰显示前的宽高),可以自己设定可以根据屏幕设定,可以根据图片大小设定 17 | */ 18 | public float width; 19 | public float height; 20 | } 21 | -------------------------------------------------------------------------------- /simple/src/test/java/com/arthur/simple/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.arthur.simple; 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 | } -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /library/src/test/java/com/arthur/rollout/rolloutanimview/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.arthur.rollout.rolloutanimview; 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/main/res/anim/activity_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 14 | 17 | -------------------------------------------------------------------------------- /library/src/main/res/anim/activity_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 14 | 18 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /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 E:\android studio\sdk\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /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 E:\android studio\sdk\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /simple/src/main/res/layout/activity_list_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 17 | 18 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /library/src/main/res/layout/rollout_grid_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 9 | 10 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /library/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | 11 | 12 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /simple/src/main/res/layout/activity_custom_list_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 17 | 18 | -------------------------------------------------------------------------------- /library/src/main/res/layout/activity_rollout_preview.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /library/src/main/res/layout/rollout_list_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /simple/src/main/res/layout/activity_grid_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /library/src/main/java/com/arthur/rollout/tools/RGlideUtil.java: -------------------------------------------------------------------------------- 1 | package com.arthur.rollout.tools; 2 | 3 | import android.content.Context; 4 | import android.widget.ImageView; 5 | 6 | import com.bumptech.glide.Glide; 7 | 8 | /** 9 | * Created by arthur on 2017/3/13. 10 | * glide 工具 11 | */ 12 | 13 | public class RGlideUtil { 14 | /** 15 | * 加载图片 16 | * 17 | * @param context 上下文 18 | * @param url 路径 19 | * @param imageView view 20 | */ 21 | public static void setImage(Context context, String url, ImageView imageView) { 22 | Glide.with(context).load(url).centerCrop().into(imageView); 23 | } 24 | 25 | /** 26 | * 清楚内存缓存,必须在UI线程调用 27 | */ 28 | public static void clearMemory(Context context) { 29 | Glide.get(context).clearMemory(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 20 | -------------------------------------------------------------------------------- /simple/src/androidTest/java/com/arthur/simple/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.arthur.simple; 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.arthur.simple", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /library/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 25 5 | buildToolsVersion "25.0.2" 6 | defaultConfig { 7 | minSdkVersion 14 8 | targetSdkVersion 25 9 | versionCode 1 10 | versionName "1.0" 11 | multiDexEnabled true 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | } 20 | 21 | dependencies { 22 | compile fileTree(dir: 'libs', include: ['*.jar']) 23 | testCompile 'junit:junit:4.12' 24 | compile 'com.android.support:appcompat-v7:25.1.1' 25 | compile 'com.github.chrisbanes.photoview:library:1.2.3' 26 | compile 'com.facebook.rebound:rebound:0.3.8' 27 | compile 'com.github.bumptech.glide:glide:3.7.0' 28 | compile 'com.nineoldandroids:library:2.4.0' 29 | } 30 | -------------------------------------------------------------------------------- /library/src/androidTest/java/com/arthur/rollout/rolloutanimview/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.arthur.rollout.rolloutanimview; 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.arthur.rollout.rolloutanimview", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /simple/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /simple/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 25 5 | buildToolsVersion "25.0.2" 6 | 7 | defaultConfig { 8 | applicationId "com.arthur.simple" 9 | minSdkVersion 14 10 | targetSdkVersion 25 11 | versionCode 1 12 | versionName "1.0" 13 | 14 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 15 | 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 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 28 | exclude group: 'com.android.support', module: 'support-annotations' 29 | }) 30 | compile 'com.android.support:appcompat-v7:25.1.1' 31 | testCompile 'junit:junit:4.12' 32 | compile project(':library') 33 | } 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Android RolloutAnimview 2 | == 3 | Introduction 4 | -- 5 | 这是一个图片浏览工具,点击图片开始位置开始平移动画到center展示动画,可回弹效果,可左滑右滑,双击放大。 6 | 7 | Demonstration 8 | -- 9 | 单张图片的效果 10 | 11 | ![](https://github.com/Arthurshen98/RolloutAnimView/blob/master/gif/rollout_1.gif) 12 | 13 | ListView显示图片的效果 14 | 15 | ![](https://github.com/Arthurshen98/RolloutAnimView/blob/master/gif/rollout_7.gif) 16 | 17 | GridView显示图片的效果 18 | 19 | ![](https://github.com/Arthurshen98/RolloutAnimView/blob/master/gif/rollout_10.gif) 20 | 21 | Usage 22 | -- 23 | simple里面有实现的方式,传递数据到指定的Activity即可。可分为单张显示,Listview显示,GridView显示等。数据处理大同小异。 24 | 25 | 没有gradle引用方式,你可以把library下载下来自己去更改代码,更改自己喜欢的风格。 26 | 27 | library里面已经引用了这几个库,无需再次添加。 28 | 29 | * compile 'com.github.chrisbanes.photoview:library:1.2.3' 图片放大缩小 30 | 31 | * compile 'com.facebook.rebound:rebound:0.3.8' //facebook的弹性动画 32 | 33 | * compile 'com.github.bumptech.glide:glide:3.7.0' //图片加载工具 34 | 35 | 可以自己定义listview的adapter进行图片数据的计算。在custom文件夹下就是自己定义item去显示。 36 | 37 | 如果觉得我加入的图片可以的欢迎star ^ .^ 38 | 39 | 项目仅仅用于练手,可以看看内部源码设计,不太完善,没有更新了 40 | -------------------------------------------------------------------------------- /simple/src/main/res/layout/activity_single_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 17 | 18 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /simple/src/main/res/layout/custom_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 10 | 18 | 28 | 29 | -------------------------------------------------------------------------------- /library/src/main/java/com/arthur/rollout/tools/RCommonUtil.java: -------------------------------------------------------------------------------- 1 | package com.arthur.rollout.tools; 2 | 3 | import android.content.Context; 4 | import android.util.DisplayMetrics; 5 | 6 | /** 7 | * Created by arthur on 2017/3/13. 8 | * arthurShen 9 | */ 10 | 11 | public class RCommonUtil { 12 | 13 | public static int dip2px(Context context, float dpValue) { 14 | final float scale = context.getResources().getDisplayMetrics().density; 15 | return (int) (dpValue * scale + 0.5f); 16 | } 17 | 18 | /** 19 | * 根据手机的分辨率从 px(像素) 的单位 转成为 dp 20 | */ 21 | public static int px2dip(Context context, float pxValue) { 22 | final float scale = context.getResources().getDisplayMetrics().density; 23 | return (int) (pxValue / scale + 0.5f); 24 | } 25 | 26 | /** 27 | * 获取屏幕高度 28 | * 29 | * @param context 环境 30 | * @return 高度 31 | */ 32 | public static float getScreenHeight(Context context) { 33 | DisplayMetrics dm = context.getResources().getDisplayMetrics(); 34 | if (dm.heightPixels > 0) { 35 | return dm.heightPixels; 36 | }else { 37 | return px2dip(context, 1920); 38 | } 39 | } 40 | 41 | public static float getScreenWidth(Context context) { 42 | DisplayMetrics dm = context.getResources().getDisplayMetrics(); 43 | if (dm.widthPixels > 0) { 44 | return dm.widthPixels; 45 | }else { 46 | return px2dip(context, 1080); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /library/src/main/java/com/arthur/rollout/view/RSquareLayout.java: -------------------------------------------------------------------------------- 1 | package com.arthur.rollout.view; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.widget.RelativeLayout; 6 | 7 | /** 8 | * Created by DavidWang on 15/9/6. 9 | */ 10 | public class RSquareLayout extends RelativeLayout { 11 | 12 | public RSquareLayout(Context context, AttributeSet attrs, int defStyle) { 13 | super(context, attrs, defStyle); 14 | } 15 | 16 | public RSquareLayout(Context context, AttributeSet attrs) { 17 | super(context, attrs); 18 | } 19 | 20 | public RSquareLayout(Context context) { 21 | super(context); 22 | } 23 | 24 | @SuppressWarnings("unused") 25 | @Override 26 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { 27 | // For simple implementation, or internal size is always 0. 28 | // We depend on the container to specify the layout size of 29 | // our view. We can't really know what it is since we will be 30 | // adding and removing different arbitrary views and do not 31 | // want the layout to change as this happens. 32 | setMeasuredDimension(getDefaultSize(0, widthMeasureSpec), getDefaultSize(0, heightMeasureSpec)); 33 | 34 | // Children are just made to fill our space. 35 | int childWidthSize = getMeasuredWidth(); 36 | int childHeightSize = getMeasuredHeight(); 37 | //高度和宽度一样 38 | heightMeasureSpec = widthMeasureSpec = MeasureSpec.makeMeasureSpec(childWidthSize, MeasureSpec.EXACTLY); 39 | super.onMeasure(widthMeasureSpec, heightMeasureSpec); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /simple/src/main/java/com/arthur/simple/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.arthur.simple; 2 | 3 | import android.content.Intent; 4 | import android.support.v7.app.AppCompatActivity; 5 | import android.os.Bundle; 6 | import android.view.View; 7 | 8 | import com.arthur.simple.custom.CustomListViewActivity; 9 | 10 | /** 11 | * 站在牛人的肩膀上 12 | * library里面已经引用的包有: 13 | * compile 'com.android.support:appcompat-v7:25.1.1' //可以换成v4或降低版本,等等 14 | * compile 'com.github.chrisbanes.photoview:library:1.2.3' 图片放大缩小 15 | * compile 'com.facebook.rebound:rebound:0.3.8' //facebook的弹性动画 16 | * compile 'com.github.bumptech.glide:glide:3.7.0' //图片加载工具 17 | * compile 'com.nineoldandroids:library:2.4.0' //大神JakeWharton的动画库 18 | */ 19 | public class MainActivity extends AppCompatActivity implements View.OnClickListener { 20 | 21 | @Override 22 | protected void onCreate(Bundle savedInstanceState) { 23 | super.onCreate(savedInstanceState); 24 | setContentView(R.layout.activity_main); 25 | 26 | findViewById(R.id.single_view).setOnClickListener(this); 27 | findViewById(R.id.list_view).setOnClickListener(this); 28 | findViewById(R.id.grid_view).setOnClickListener(this); 29 | findViewById(R.id.custom_listview).setOnClickListener(this); 30 | } 31 | 32 | @Override 33 | public void onClick(View v) { 34 | switch (v.getId()) { 35 | case R.id.single_view: 36 | startActivity(new Intent(this,SingleViewActivity.class)); 37 | break; 38 | case R.id.list_view: 39 | startActivity(new Intent(this,ListViewActivity.class)); 40 | break; 41 | case R.id.grid_view: 42 | startActivity(new Intent(this,GridViewActivity.class)); 43 | break; 44 | case R.id.custom_listview: 45 | startActivity(new Intent(this, CustomListViewActivity.class)); 46 | break; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /simple/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 |