├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── 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 │ │ │ │ ├── arrays.xml │ │ │ │ ├── styles.xml │ │ │ │ ├── strings.xml │ │ │ │ ├── dimens.xml │ │ │ │ └── colors.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── menu │ │ │ │ └── menu_customize.xml │ │ │ ├── drawable │ │ │ │ ├── selector_black_10_transparent.xml │ │ │ │ ├── shape_circle_red.xml │ │ │ │ └── ic_launcher_background.xml │ │ │ ├── layout │ │ │ │ ├── item_spinner_selected.xml │ │ │ │ ├── item_spinner_drop_down.xml │ │ │ │ ├── frag_test.xml │ │ │ │ ├── act_page_indicator.xml │ │ │ │ ├── activity_main.xml │ │ │ │ ├── act_tab_layout.xml │ │ │ │ ├── act_tab_view.xml │ │ │ │ └── act_customize.xml │ │ │ └── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── multiindicator │ │ │ │ ├── frag │ │ │ │ └── TestFragment.java │ │ │ │ ├── act │ │ │ │ ├── MainActivity.java │ │ │ │ ├── TabViewAct.java │ │ │ │ ├── TabLayoutAct.java │ │ │ │ ├── PageIndicatorAct.java │ │ │ │ └── CustomizeActivity.java │ │ │ │ ├── adapter │ │ │ │ └── HomeAdapter.java │ │ │ │ └── data │ │ │ │ ├── CustomizationConverter.java │ │ │ │ └── Customization.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── multiindicator │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── example │ │ └── multiindicator │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── indicatorlib ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ └── values │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ ├── dimens.xml │ │ │ │ └── attrs.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── indicatorlib │ │ │ ├── views │ │ │ ├── draw │ │ │ │ ├── data │ │ │ │ │ ├── RtlMode.java │ │ │ │ │ ├── Orientation.java │ │ │ │ │ └── PositionSavedState.java │ │ │ │ ├── drawer │ │ │ │ │ ├── type │ │ │ │ │ │ ├── BaseDrawer.java │ │ │ │ │ │ ├── DropDrawer.java │ │ │ │ │ │ ├── SlideDrawer.java │ │ │ │ │ │ ├── ScaleDownDrawer.java │ │ │ │ │ │ ├── ColorDrawer.java │ │ │ │ │ │ ├── ThinWormDrawer.java │ │ │ │ │ │ ├── WormDrawer.java │ │ │ │ │ │ ├── ScaleDrawer.java │ │ │ │ │ │ ├── BasicDrawer.java │ │ │ │ │ │ ├── SwapDrawer.java │ │ │ │ │ │ └── FillDrawer.java │ │ │ │ │ └── Drawer.java │ │ │ │ ├── DrawManager.java │ │ │ │ └── controller │ │ │ │ │ ├── MeasureController.java │ │ │ │ │ └── DrawController.java │ │ │ ├── animation │ │ │ │ ├── data │ │ │ │ │ ├── Value.java │ │ │ │ │ ├── type │ │ │ │ │ │ ├── SlideAnimationValue.java │ │ │ │ │ │ ├── ThinWormAnimationValue.java │ │ │ │ │ │ ├── ColorAnimationValue.java │ │ │ │ │ │ ├── WormAnimationValue.java │ │ │ │ │ │ ├── ScaleAnimationValue.java │ │ │ │ │ │ ├── SwapAnimationValue.java │ │ │ │ │ │ ├── DropAnimationValue.java │ │ │ │ │ │ └── FillAnimationValue.java │ │ │ │ │ └── AnimationValue.java │ │ │ │ ├── type │ │ │ │ │ ├── AnimationType.java │ │ │ │ │ ├── ScaleDownAnimation.java │ │ │ │ │ ├── BaseAnimation.java │ │ │ │ │ ├── SlideAnimation.java │ │ │ │ │ ├── SwapAnimation.java │ │ │ │ │ ├── ColorAnimation.java │ │ │ │ │ ├── ThinWormAnimation.java │ │ │ │ │ ├── ScaleAnimation.java │ │ │ │ │ ├── FillAnimation.java │ │ │ │ │ ├── DropAnimation.java │ │ │ │ │ └── WormAnimation.java │ │ │ │ ├── AnimationManager.java │ │ │ │ └── controller │ │ │ │ │ └── ValueController.java │ │ │ ├── utils │ │ │ │ ├── DensityUtils.java │ │ │ │ ├── IdUtils.java │ │ │ │ └── CoordinatesUtils.java │ │ │ ├── IndicatorManager.java │ │ │ └── TabView.java │ │ │ ├── base │ │ │ └── BaseFragmentAdapter.java │ │ │ └── utils │ │ │ └── Utils.java │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── indicatorlib │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── example │ │ └── indicatorlib │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .idea ├── vcs.xml ├── misc.xml ├── runConfigurations.xml ├── gradle.xml └── codeStyles │ └── Project.xml ├── .gitignore ├── gradle.properties ├── gradlew.bat └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /indicatorlib/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':indicatorlib' 2 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengMaster/MultiIndicator/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /indicatorlib/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | IndicatorLib 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengMaster/MultiIndicator/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengMaster/MultiIndicator/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengMaster/MultiIndicator/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengMaster/MultiIndicator/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengMaster/MultiIndicator/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengMaster/MultiIndicator/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengMaster/MultiIndicator/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengMaster/MultiIndicator/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /indicatorlib/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengMaster/MultiIndicator/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pengMaster/MultiIndicator/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /indicatorlib/src/main/java/com/example/indicatorlib/views/draw/data/RtlMode.java: -------------------------------------------------------------------------------- 1 | package com.example.indicatorlib.views.draw.data; 2 | 3 | public enum RtlMode {On, Off, Auto} -------------------------------------------------------------------------------- /indicatorlib/src/main/java/com/example/indicatorlib/views/animation/data/Value.java: -------------------------------------------------------------------------------- 1 | package com.example.indicatorlib.views.animation.data; 2 | 3 | public interface Value {/*empty*/} 4 | -------------------------------------------------------------------------------- /indicatorlib/src/main/java/com/example/indicatorlib/views/draw/data/Orientation.java: -------------------------------------------------------------------------------- 1 | package com.example.indicatorlib.views.draw.data; 2 | 3 | public enum Orientation {HORIZONTAL, VERTICAL} 4 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /indicatorlib/src/main/java/com/example/indicatorlib/views/animation/type/AnimationType.java: -------------------------------------------------------------------------------- 1 | package com.example.indicatorlib.views.animation.type; 2 | 3 | public enum AnimationType {NONE, COLOR, SCALE, WORM, SLIDE, FILL, THIN_WORM, DROP, SWAP, SCALE_DOWN} 4 | -------------------------------------------------------------------------------- /app/src/main/res/values/arrays.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Tab1 6 | Tab2 7 | Tab3 8 | 9 | 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue May 28 15:33:39 CST 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-4.10.1-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_customize.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/selector_black_10_transparent.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_spinner_selected.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_spinner_drop_down.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/test/java/com/example/multiindicator/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.example.multiindicator; 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() { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /indicatorlib/src/test/java/com/example/indicatorlib/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.example.indicatorlib; 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() { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /indicatorlib/src/main/java/com/example/indicatorlib/views/animation/data/type/SlideAnimationValue.java: -------------------------------------------------------------------------------- 1 | package com.example.indicatorlib.views.animation.data.type; 2 | 3 | import com.example.indicatorlib.views.animation.data.Value; 4 | 5 | public class SlideAnimationValue implements Value { 6 | 7 | private int coordinate; 8 | 9 | public int getCoordinate() { 10 | return coordinate; 11 | } 12 | 13 | public void setCoordinate(int coordinate) { 14 | this.coordinate = coordinate; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /indicatorlib/src/main/java/com/example/indicatorlib/views/animation/data/type/ThinWormAnimationValue.java: -------------------------------------------------------------------------------- 1 | package com.example.indicatorlib.views.animation.data.type; 2 | 3 | import com.example.indicatorlib.views.animation.data.Value; 4 | 5 | public class ThinWormAnimationValue extends WormAnimationValue implements Value { 6 | 7 | private int height; 8 | 9 | public int getHeight() { 10 | return height; 11 | } 12 | 13 | public void setHeight(int height) { 14 | this.height = height; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /indicatorlib/src/main/java/com/example/indicatorlib/views/draw/drawer/type/BaseDrawer.java: -------------------------------------------------------------------------------- 1 | package com.example.indicatorlib.views.draw.drawer.type; 2 | 3 | import android.graphics.Paint; 4 | 5 | import com.example.indicatorlib.views.draw.data.Indicator; 6 | 7 | import android.support.annotation.NonNull; 8 | 9 | class BaseDrawer { 10 | 11 | Paint paint; 12 | Indicator indicator; 13 | 14 | BaseDrawer(@NonNull Paint paint, @NonNull Indicator indicator) { 15 | this.paint = paint; 16 | this.indicator = indicator; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_circle_red.xml: -------------------------------------------------------------------------------- 1 | 5 | 8 | 11 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/layout/frag_test.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 14 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 15 | 16 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /indicatorlib/src/main/java/com/example/indicatorlib/views/utils/DensityUtils.java: -------------------------------------------------------------------------------- 1 | package com.example.indicatorlib.views.utils; 2 | 3 | import android.content.res.Resources; 4 | import android.util.TypedValue; 5 | 6 | public class DensityUtils { 7 | 8 | public static int dpToPx(int dp) { 9 | return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, Resources.getSystem().getDisplayMetrics()); 10 | } 11 | 12 | public static int pxToDp(float px) { 13 | return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_PX, px, Resources.getSystem().getDisplayMetrics()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | -------------------------------------------------------------------------------- /indicatorlib/src/main/java/com/example/indicatorlib/views/animation/data/type/ColorAnimationValue.java: -------------------------------------------------------------------------------- 1 | package com.example.indicatorlib.views.animation.data.type; 2 | 3 | import com.example.indicatorlib.views.animation.data.Value; 4 | 5 | public class ColorAnimationValue implements Value { 6 | 7 | private int color; 8 | private int colorReverse; 9 | 10 | public int getColor() { 11 | return color; 12 | } 13 | 14 | public void setColor(int color) { 15 | this.color = color; 16 | } 17 | 18 | public int getColorReverse() { 19 | return colorReverse; 20 | } 21 | 22 | public void setColorReverse(int colorReverse) { 23 | this.colorReverse = colorReverse; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /indicatorlib/src/main/java/com/example/indicatorlib/views/animation/data/type/WormAnimationValue.java: -------------------------------------------------------------------------------- 1 | package com.example.indicatorlib.views.animation.data.type; 2 | 3 | import com.example.indicatorlib.views.animation.data.Value; 4 | 5 | public class WormAnimationValue implements Value { 6 | 7 | private int rectStart; 8 | private int rectEnd; 9 | 10 | public int getRectStart() { 11 | return rectStart; 12 | } 13 | 14 | public void setRectStart(int rectStartEdge) { 15 | this.rectStart = rectStartEdge; 16 | } 17 | 18 | public int getRectEnd() { 19 | return rectEnd; 20 | } 21 | 22 | public void setRectEnd(int rectEnd) { 23 | this.rectEnd = rectEnd; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /indicatorlib/src/main/java/com/example/indicatorlib/views/animation/data/type/ScaleAnimationValue.java: -------------------------------------------------------------------------------- 1 | package com.example.indicatorlib.views.animation.data.type; 2 | 3 | import com.example.indicatorlib.views.animation.data.Value; 4 | 5 | public class ScaleAnimationValue extends ColorAnimationValue implements Value { 6 | 7 | private int radius; 8 | private int radiusReverse; 9 | 10 | public int getRadius() { 11 | return radius; 12 | } 13 | 14 | public void setRadius(int radius) { 15 | this.radius = radius; 16 | } 17 | 18 | public int getRadiusReverse() { 19 | return radiusReverse; 20 | } 21 | 22 | public void setRadiusReverse(int radiusReverse) { 23 | this.radiusReverse = radiusReverse; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | 15 | 16 | -------------------------------------------------------------------------------- /indicatorlib/src/main/java/com/example/indicatorlib/views/animation/data/type/SwapAnimationValue.java: -------------------------------------------------------------------------------- 1 | package com.example.indicatorlib.views.animation.data.type; 2 | 3 | import com.example.indicatorlib.views.animation.data.Value; 4 | 5 | public class SwapAnimationValue implements Value { 6 | 7 | private int coordinate; 8 | private int coordinateReverse; 9 | 10 | public int getCoordinate() { 11 | return coordinate; 12 | } 13 | 14 | public void setCoordinate(int coordinate) { 15 | this.coordinate = coordinate; 16 | } 17 | 18 | public int getCoordinateReverse() { 19 | return coordinateReverse; 20 | } 21 | 22 | public void setCoordinateReverse(int coordinateReverse) { 23 | this.coordinateReverse = coordinateReverse; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /indicatorlib/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 28 5 | defaultConfig { 6 | applicationId "com.example.multiindicator" 7 | minSdkVersion 17 8 | targetSdkVersion 28 9 | versionCode 1 10 | versionName "1.0" 11 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | productFlavors { 20 | } 21 | } 22 | 23 | dependencies { 24 | implementation fileTree(include: ['*.jar'], dir: 'libs') 25 | implementation 'com.android.support:appcompat-v7:28.0.0' 26 | implementation project(':indicatorlib') 27 | } 28 | -------------------------------------------------------------------------------- /indicatorlib/src/main/java/com/example/indicatorlib/views/animation/data/type/DropAnimationValue.java: -------------------------------------------------------------------------------- 1 | package com.example.indicatorlib.views.animation.data.type; 2 | 3 | import com.example.indicatorlib.views.animation.data.Value; 4 | 5 | public class DropAnimationValue implements Value { 6 | 7 | private int width; 8 | private int height; 9 | private int radius; 10 | 11 | public int getWidth() { 12 | return width; 13 | } 14 | 15 | public void setWidth(int width) { 16 | this.width = width; 17 | } 18 | 19 | public int getHeight() { 20 | return height; 21 | } 22 | 23 | public void setHeight(int height) { 24 | this.height = height; 25 | } 26 | 27 | public int getRadius() { 28 | return radius; 29 | } 30 | 31 | public void setRadius(int radius) { 32 | this.radius = radius; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/example/multiindicator/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.example.multiindicator; 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 | * Instrumented 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() { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.example.multiindicator", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /indicatorlib/src/androidTest/java/com/example/indicatorlib/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.example.indicatorlib; 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 | * Instrumented 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() { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.example.indicatorlib.test", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/multiindicator/frag/TestFragment.java: -------------------------------------------------------------------------------- 1 | package com.example.multiindicator.frag; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.NonNull; 5 | import android.support.annotation.Nullable; 6 | import android.support.v4.app.Fragment; 7 | import android.view.LayoutInflater; 8 | import android.view.View; 9 | import android.view.ViewGroup; 10 | 11 | import com.example.multiindicator.R; 12 | 13 | /** 14 | *
15 |  *     author : Wp
16 |  *     e-mail : 1101313414@qq.com
17 |  *     time   : 2019/5/28 4:22 PM
18 |  *     desc   :
19 |  *     version: 1.0
20 |  * 
21 | */ 22 | public class TestFragment extends Fragment { 23 | 24 | @Nullable 25 | @Override 26 | public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 27 | return inflater.inflate(R.layout.frag_test,null); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /indicatorlib/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 28 5 | 6 | 7 | 8 | defaultConfig { 9 | minSdkVersion 15 10 | targetSdkVersion 28 11 | versionCode 1 12 | versionName "1.0" 13 | 14 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 15 | 16 | } 17 | 18 | buildTypes { 19 | release { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 22 | } 23 | } 24 | 25 | } 26 | 27 | dependencies { 28 | implementation fileTree(dir: 'libs', include: ['*.jar']) 29 | 30 | implementation 'com.android.support:appcompat-v7:28.0.0' 31 | testImplementation 'junit:junit:4.12' 32 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 33 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/multiindicator/act/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.multiindicator.act; 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.example.multiindicator.R; 9 | 10 | public class MainActivity extends AppCompatActivity { 11 | 12 | @Override 13 | protected void onCreate(Bundle savedInstanceState) { 14 | super.onCreate(savedInstanceState); 15 | setContentView(R.layout.activity_main); 16 | } 17 | 18 | public void onTabViewClick(View view) { 19 | startActivity(new Intent(getApplicationContext(),TabViewAct.class)); 20 | } 21 | 22 | public void onTabLayoutClick(View view) { 23 | startActivity(new Intent(getApplicationContext(),TabLayoutAct.class)); 24 | } 25 | 26 | public void onPageLayoutClick(View view) { 27 | startActivity(new Intent(getApplicationContext(),PageIndicatorAct.class)); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 16 | 17 | 21 | 22 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /indicatorlib/src/main/java/com/example/indicatorlib/views/animation/data/type/FillAnimationValue.java: -------------------------------------------------------------------------------- 1 | package com.example.indicatorlib.views.animation.data.type; 2 | 3 | import com.example.indicatorlib.views.animation.data.Value; 4 | 5 | public class FillAnimationValue extends ColorAnimationValue implements Value { 6 | 7 | private int radius; 8 | private int radiusReverse; 9 | 10 | private int stroke; 11 | private int strokeReverse; 12 | 13 | public int getRadius() { 14 | return radius; 15 | } 16 | 17 | public void setRadius(int radius) { 18 | this.radius = radius; 19 | } 20 | 21 | public int getRadiusReverse() { 22 | return radiusReverse; 23 | } 24 | 25 | public void setRadiusReverse(int radiusReverse) { 26 | this.radiusReverse = radiusReverse; 27 | } 28 | 29 | public int getStroke() { 30 | return stroke; 31 | } 32 | 33 | public void setStroke(int stroke) { 34 | this.stroke = stroke; 35 | } 36 | 37 | public int getStrokeReverse() { 38 | return strokeReverse; 39 | } 40 | 41 | public void setStrokeReverse(int strokeReverse) { 42 | this.strokeReverse = strokeReverse; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /indicatorlib/src/main/java/com/example/indicatorlib/views/animation/AnimationManager.java: -------------------------------------------------------------------------------- 1 | package com.example.indicatorlib.views.animation; 2 | 3 | import com.example.indicatorlib.views.animation.controller.AnimationController; 4 | import com.example.indicatorlib.views.animation.controller.ValueController; 5 | import com.example.indicatorlib.views.draw.data.Indicator; 6 | 7 | import android.support.annotation.NonNull; 8 | 9 | public class AnimationManager { 10 | 11 | private AnimationController animationController; 12 | 13 | public AnimationManager(@NonNull Indicator indicator, @NonNull ValueController.UpdateListener listener) { 14 | this.animationController = new AnimationController(indicator, listener); 15 | } 16 | 17 | public void basic() { 18 | if (animationController != null) { 19 | animationController.end(); 20 | animationController.basic(); 21 | } 22 | } 23 | 24 | public void interactive(float progress) { 25 | if (animationController != null) { 26 | animationController.interactive(progress); 27 | } 28 | } 29 | 30 | public void end() { 31 | if (animationController != null) { 32 | animationController.end(); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | MultiIndicator 3 | 4 | 5 | None 6 | Color 7 | Scale 8 | Worm 9 | Slide 10 | Fill 11 | Thin Worm 12 | Drop 13 | Swap 14 | Scale Down 15 | 16 | 17 | 18 | Horizontal 19 | Vertical 20 | 21 | 22 | 23 | On 24 | Off 25 | Auto 26 | 27 | 28 | Interactive animation 29 | Auto visibility 30 | Animation type 31 | Orientation 32 | Customize 33 | Home 34 | Right to left mode 35 | Fade on idle 36 | 37 | -------------------------------------------------------------------------------- /indicatorlib/src/main/java/com/example/indicatorlib/views/animation/type/ScaleDownAnimation.java: -------------------------------------------------------------------------------- 1 | package com.example.indicatorlib.views.animation.type; 2 | 3 | import android.animation.IntEvaluator; 4 | import android.animation.PropertyValuesHolder; 5 | 6 | import com.example.indicatorlib.views.animation.controller.ValueController; 7 | 8 | import android.support.annotation.NonNull; 9 | 10 | public class ScaleDownAnimation extends ScaleAnimation { 11 | 12 | public ScaleDownAnimation(@NonNull ValueController.UpdateListener listener) { 13 | super(listener); 14 | } 15 | 16 | @NonNull 17 | @Override 18 | protected PropertyValuesHolder createScalePropertyHolder(boolean isReverse) { 19 | String propertyName; 20 | int startRadiusValue; 21 | int endRadiusValue; 22 | 23 | if (isReverse) { 24 | propertyName = ANIMATION_SCALE_REVERSE; 25 | startRadiusValue = (int) (radius * scaleFactor); 26 | endRadiusValue = radius; 27 | } else { 28 | propertyName = ANIMATION_SCALE; 29 | startRadiusValue = radius; 30 | endRadiusValue = (int) (radius * scaleFactor); 31 | } 32 | 33 | PropertyValuesHolder holder = PropertyValuesHolder.ofInt(propertyName, startRadiusValue, endRadiusValue); 34 | holder.setEvaluator(new IntEvaluator()); 35 | 36 | return holder; 37 | } 38 | } 39 | 40 | -------------------------------------------------------------------------------- /indicatorlib/src/main/java/com/example/indicatorlib/views/utils/IdUtils.java: -------------------------------------------------------------------------------- 1 | package com.example.indicatorlib.views.utils; 2 | 3 | import android.os.Build; 4 | import android.view.View; 5 | 6 | import java.util.concurrent.atomic.AtomicInteger; 7 | 8 | public class IdUtils { 9 | 10 | private static final AtomicInteger nextGeneratedId = new AtomicInteger(1); 11 | 12 | public static int generateViewId(){ 13 | if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) { 14 | return generateId(); 15 | } else { 16 | return View.generateViewId(); 17 | } 18 | } 19 | 20 | /** 21 | * Generate a value suitable for use in #setId(int). 22 | * This value will not collide with ID values generated at build time by aapt for R.id. 23 | * 24 | * @return a generated ID value 25 | */ 26 | private static int generateId() { 27 | for (; ; ) { 28 | final int result = nextGeneratedId.get(); 29 | // aapt-generated IDs have the high byte nonzero; clamp to the range under that. 30 | int newValue = result + 1; 31 | if (newValue > 0x00FFFFFF) newValue = 1; // Roll over to 1, not 0. 32 | if (nextGeneratedId.compareAndSet(result, newValue)) { 33 | return result; 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/res/layout/act_page_indicator.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 16 | 17 | 27 | 28 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 |