├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── drawable │ │ │ │ ├── demo.gif │ │ │ │ ├── gray_progress.png │ │ │ │ └── simple_bitmap.png │ │ │ ├── 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 │ │ │ ├── drawable-xxhdpi │ │ │ │ └── ic_select_idiom_progress.png │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── styles.xml │ │ │ │ └── colors.xml │ │ │ └── layout │ │ │ │ ├── activity_test_bitmap.xml │ │ │ │ └── activity_main.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── test │ │ │ └── progress │ │ │ ├── TestBitmapActivity.java │ │ │ └── MainActivity.java │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── test │ │ │ └── progress │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── test │ │ └── progress │ │ └── ExampleInstrumentedTest.java ├── libs │ └── SelectColorDialog-debug.aar ├── proguard-rules.pro └── build.gradle ├── MyProgress ├── .gitignore ├── src │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── res │ │ │ └── values │ │ │ │ └── progress_attr.xml │ │ └── java │ │ │ └── com │ │ │ └── github │ │ │ └── progress │ │ │ └── MyProgress.java │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── github │ │ │ └── progress │ │ │ └── ExampleInstrumentedTest.java │ └── test │ │ └── java │ │ └── com │ │ └── github │ │ └── progress │ │ └── ExampleUnitTest.java ├── build.gradle └── proguard-rules.pro ├── settings.gradle ├── aar └── MyProgress-release.aar ├── .gitignore ├── gradlew.bat ├── README.md └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /MyProgress/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':MyProgress' 2 | -------------------------------------------------------------------------------- /aar/MyProgress-release.aar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhongruiAndroid/Progress/HEAD/aar/MyProgress-release.aar -------------------------------------------------------------------------------- /app/src/main/res/drawable/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhongruiAndroid/Progress/HEAD/app/src/main/res/drawable/demo.gif -------------------------------------------------------------------------------- /app/libs/SelectColorDialog-debug.aar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhongruiAndroid/Progress/HEAD/app/libs/SelectColorDialog-debug.aar -------------------------------------------------------------------------------- /app/src/main/res/drawable/gray_progress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhongruiAndroid/Progress/HEAD/app/src/main/res/drawable/gray_progress.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/simple_bitmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhongruiAndroid/Progress/HEAD/app/src/main/res/drawable/simple_bitmap.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhongruiAndroid/Progress/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhongruiAndroid/Progress/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhongruiAndroid/Progress/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhongruiAndroid/Progress/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhongruiAndroid/Progress/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhongruiAndroid/Progress/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/zhongruiAndroid/Progress/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/zhongruiAndroid/Progress/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhongruiAndroid/Progress/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/zhongruiAndroid/Progress/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_select_idiom_progress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhongruiAndroid/Progress/HEAD/app/src/main/res/drawable-xxhdpi/ic_select_idiom_progress.png -------------------------------------------------------------------------------- /MyProgress/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | .DS_Store 5 | build/ 6 | /captures 7 | .externalNativeBuild 8 | !build.gradle 9 | .idea/ 10 | gradle/ 11 | gradle.properties 12 | *.apk 13 | .svn 14 | help.gradle -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Progress 3 | 4 | 5 | Hello blank fragment 6 | 7 | -------------------------------------------------------------------------------- /MyProgress/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 30 5 | 6 | defaultConfig { 7 | minSdkVersion 15 8 | targetSdkVersion 30 9 | versionCode 1 10 | versionName "1.0" 11 | 12 | testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' 13 | 14 | } 15 | 16 | } 17 | dependencies { 18 | implementation 'androidx.appcompat:appcompat:1.0.0' 19 | } 20 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/test/java/com/test/progress/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.test.progress; 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 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_test_bitmap.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 17 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/test/progress/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.test.progress; 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.test.progress", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /MyProgress/src/androidTest/java/com/github/progress/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.github.progress; 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.github.progress.test", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in D:\Android\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /MyProgress/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in D:\Android\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /MyProgress/src/test/java/com/github/progress/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.github.progress; 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 | @Test 18 | public void sdf() throws Exception { 19 | float a=50; 20 | int b=30; 21 | int c=130; 22 | System.out.println(b*a/c); 23 | } 24 | @Test 25 | public void d() throws Exception { 26 | System.out.println(0%360); 27 | System.out.println(1%360); 28 | System.out.println(360%360); 29 | System.out.println(367%360); 30 | } 31 | @Test 32 | public void dd() throws Exception { 33 | float a=0.9f; 34 | int b= (int) a; 35 | int c= (int) 1.2f; 36 | int d= (int) 1.5f; 37 | System.out.println(b); 38 | System.out.println(c); 39 | System.out.println(d); 40 | } 41 | } -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 28 5 | defaultConfig { 6 | applicationId "com.test.progress" 7 | minSdkVersion 19 8 | targetSdkVersion 28 9 | versionCode 1 10 | versionName "1.0" 11 | testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | 20 | repositories { 21 | flatDir { 22 | dirs 'libs' 23 | } 24 | } 25 | packagingOptions { 26 | // exclude 'META-INF/proguard/androidx-annotations.pro' 27 | } 28 | } 29 | 30 | dependencies { 31 | implementation 'androidx.legacy:legacy-support-v4:1.0.0' 32 | 33 | implementation 'androidx.appcompat:appcompat:1.0.0' 34 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3' 35 | testImplementation 'junit:junit:4.12' 36 | implementation project(':MyProgress') 37 | implementation(name: 'SelectColorDialog-debug', ext: 'aar') 38 | api "com.github.skydoves:colorpickerview:2.0.2" 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/com/test/progress/TestBitmapActivity.java: -------------------------------------------------------------------------------- 1 | package com.test.progress; 2 | 3 | import android.graphics.Bitmap; 4 | import android.graphics.BitmapFactory; 5 | import android.graphics.BitmapShader; 6 | import android.graphics.Shader; 7 | import android.os.Bundle; 8 | 9 | import com.github.progress.MyProgress; 10 | 11 | import androidx.appcompat.app.AppCompatActivity; 12 | 13 | public class TestBitmapActivity extends AppCompatActivity { 14 | 15 | @Override 16 | protected void onCreate(Bundle savedInstanceState) { 17 | super.onCreate(savedInstanceState); 18 | setContentView(R.layout.activity_test_bitmap); 19 | 20 | MyProgress myProgress=findViewById(R.id.myProgress); 21 | 22 | 23 | Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.simple_bitmap); 24 | Bitmap newBitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight() - 11); 25 | Shader shader=new BitmapShader(newBitmap,Shader.TileMode.REPEAT,Shader.TileMode.REPEAT); 26 | myProgress.setProgressShader(shader); 27 | 28 | 29 | Bitmap bitmapBG = BitmapFactory.decodeResource(getResources(), R.drawable.gray_progress); 30 | Bitmap newBitmapBG = Bitmap.createBitmap(bitmapBG, 0, 0, bitmapBG.getWidth(), bitmapBG.getHeight() - 9); 31 | Shader shaderBG=new BitmapShader(newBitmapBG,Shader.TileMode.REPEAT,Shader.TileMode.REPEAT); 32 | myProgress.setBgShader(shaderBG); 33 | 34 | myProgress.setMaxProgress(200).setNowProgress(100).setRadius(80).complete(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /MyProgress/src/main/res/values/progress_attr.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 51 | 52 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #18B4ED 4 | #18B4ED 5 | #18B4ED 6 | #87ceeb 7 | 8 | #4ed3fd 9 | 10 | 11 | #3a92e9 12 | #419BF3 13 | #f6f6f6 14 | #000000 15 | #333333 16 | #444444 17 | #666666 18 | #999999 19 | #eaeaea 20 | #d7d7d7 21 | #f2f2f2 22 | #616161 23 | #f2f2f2 24 | #FFF1EFEF 25 | #d4d4d4 26 | #DDDDDD 27 | #2DDB97 28 | #FF20D18C 29 | #34e8a6 30 | #22ddb0 31 | #E6F9F7 32 | #50000000 33 | 34 | 35 | #06C1AE 36 | #419BF3 37 | #FFC820 38 | #eaa304 39 | #4ed3fd 40 | #fc353a 41 | #FFE4E0E0 42 | #E2419BF3 43 | #333333 44 | #2ACBE0 45 | #ff712b 46 | #FFF2EB 47 | #419BF3 48 | #FFC8C8C8 49 | 50 | 51 | #848484 52 | #848484 53 | #56abe4 54 | #70000000 55 | #BF58C2F7 56 | #ffffff 57 | #86FFFFFF 58 | #616161 59 | #000000 60 | #00000000 61 | #70000000 62 | #90000000 63 | #a0000000 64 | #b0000000 65 | #e5e5e5 66 | #B2B2B2 67 | #C0C5CA 68 | #BEC2C7 69 | #B2B2B2 70 | #DFE4EA 71 | #cccccc 72 | #E2E2E2 73 | #E2E2E2 74 | #41A5D6 75 | #18B4ED 76 | 77 | #20000000 78 | #FFCECBCB 79 | 80 | #dfdfdf 81 | #c2c1c1 82 | #f2f2f2 83 | #D1D1D1 84 | 85 | #66000000 86 | 87 | 88 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Progress 2 | ![github](https://github.com/zhongruiAndroid/Progress/blob/master/app/src/main/res/drawable/demo.gif "github") 3 | 4 | 5 | | 属性 | 类型 | 说明 | 6 | |----------------|-----------|-----------------------------------------------------------------------| 7 | | viewWidth | dimension | 进度条宽度(不设置则默认为layout_width) | 8 | | viewHeight | dimension | 进度条高度(不设置则默认为layout_height) | 9 | | bgColor | color | 进度条背景颜色 | 10 | | borderColor | color | 进度条边框颜色 | 11 | | borderWidth | dimension | 进度条边框宽度 | 12 | | progressColor | color | 进度条颜色 | 13 | | nowProgress | float | 进度条当前进度(默认为30) | 14 | | maxProgress | float | 进度条最大值(默认为100) | 15 | | angle | integer | 进度条旋转角度 | 16 | | radius | dimension | 进度条圆角大小(默认为viewHeight的一半,最大值不会超过viewHeight的一半) | 17 | | useAnimation | boolean | 是否使用动画(默认为true) | 18 | | duration | integer | 动画执行时间(默认为1200毫秒) | 19 | | allInterval | dimension | 进度条与边框的距离 | 20 | | leftInterval | dimension | 进度条与左边框的距离 | 21 | | topInterval | dimension | 进度条与顶部边框的距离 | 22 | | rightInterval | dimension | 进度条与右边框的距离 | 23 | | bottomInterval | dimension | 进度条与底部边框的距离 | 24 | 25 | 26 | 27 | 28 | ```xml 29 | 38 | ``` 39 | 40 | #### 设置进度条颜色渐变 41 | ```java 42 | //进度条边框颜色渐变 43 | Shader borderShader; 44 | //进度条背景颜色渐变 45 | Shader bgShader; 46 | //进度条颜色渐变 47 | Shader progressShader; 48 | //进度条动画插入器,建议在setProgress方法之前设置(默认为DecelerateInterpolator) 49 | TimeInterpolator interpolator 50 | 51 | //为进度条设置线性颜色渐变,起始坐标为view左上角,结束坐标为view右下角(注意view圆点坐标在view中心) 52 | LinearGradient linearGradient = new LinearGradient( 53 | -myProgress.getViewWidth() / 2, 54 | -myProgress.getViewHeight() / 2, 55 | myProgress.getViewWidth() / 2, 56 | myProgress.getViewHeight() / 2, 57 | ContextCompat.getColor(MainActivity.this, R.color.green), 58 | ContextCompat.getColor(MainActivity.this, R.color.blue), 59 | Shader.TileMode.MIRROR); 60 | 61 | myProgress.setNowProgress(30).setMaxProgress(100).setProgressShader(linearGradient).complete(); 62 | ``` 63 | ### 注意:代码设置属性之后调用complete()才能生效 64 | #### 进度监听 65 | ```java 66 | MyProgress myProgress = (MyProgress) findViewById(R.id.myProgress); 67 | myProgress.setOnProgressInter(new MyProgress.OnProgressInter() { 68 | @Override 69 | public void progress(float scaleProgress, float progress, float max) { 70 | //scaleProgress:动画执行时的进度 71 | //progress:设置的进度 72 | //max:进度条最大值 73 | } 74 | }); 75 | ``` 76 | 77 |
78 | 79 | ### 如果本库对您有帮助,还希望支付宝扫一扫下面二维码,你我同时免费获取奖励金(非常感谢 Y(^-^)Y) 80 | ![github](https://github.com/zhongruiAndroid/SomeImage/blob/master/image/small_ali.jpg?raw=true "github") 81 |
82 | 83 | | 最新版本号 | [ ![Download](https://api.bintray.com/packages/zhongrui/mylibrary/MyProgress/images/download.svg) ](https://bintray.com/zhongrui/mylibrary/MyProgress/_latestVersion) | 84 | |--------|----| 85 | 86 | 87 | ```gradle 88 | compile 'com.github:MyProgress:版本号看上面' 89 | ``` 90 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn () { 37 | echo "$*" 38 | } 39 | 40 | die () { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save () { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /app/src/main/java/com/test/progress/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.test.progress; 2 | 3 | import android.content.Context; 4 | import android.content.Intent; 5 | import android.graphics.LinearGradient; 6 | import android.graphics.Shader; 7 | import android.os.Bundle; 8 | 9 | import androidx.annotation.NonNull; 10 | import androidx.appcompat.app.AppCompatActivity; 11 | import androidx.appcompat.widget.AppCompatCheckBox; 12 | import androidx.core.content.ContextCompat; 13 | import android.view.View; 14 | import android.view.View.OnClickListener; 15 | import android.widget.Button; 16 | import android.widget.CheckBox; 17 | import android.widget.CompoundButton; 18 | import android.widget.SeekBar; 19 | import android.widget.TextView; 20 | 21 | import com.github.progress.MyProgress; 22 | import com.github.selectcolordialog.SelectColorDialog; 23 | import com.github.selectcolordialog.SelectColorListener; 24 | 25 | public class MainActivity extends AppCompatActivity implements SeekBar.OnSeekBarChangeListener, OnClickListener, CompoundButton.OnCheckedChangeListener { 26 | MyProgress mp; 27 | SeekBar sb_angle; 28 | SeekBar sb_round; 29 | SeekBar sb_left; 30 | SeekBar sb_top; 31 | SeekBar sb_right; 32 | SeekBar sb_bottom; 33 | Context context; 34 | 35 | Button btLookBitmapProgress; 36 | 37 | private SeekBar sbProgress; 38 | private SeekBar sbProgressSecond; 39 | private SeekBar sbBorderWidth; 40 | private TextView tvBgColor; 41 | private TextView tvBorderColor; 42 | private TextView tvProgressColor; 43 | private CheckBox cbShowAnim; 44 | private SelectColorDialog selectColorDialog; 45 | 46 | 47 | private AppCompatCheckBox cbTopLeftNoRadius; 48 | private AppCompatCheckBox cbTopRightNoRadius; 49 | private AppCompatCheckBox cbBottomRightNoRadius; 50 | private AppCompatCheckBox cbBottomLeftNoRadius; 51 | 52 | private AppCompatCheckBox cbTopLeftNoRadius2; 53 | private AppCompatCheckBox cbTopRightNoRadius2; 54 | private AppCompatCheckBox cbBottomRightNoRadius2; 55 | private AppCompatCheckBox cbBottomLeftNoRadius2; 56 | 57 | @Override 58 | protected void onCreate(Bundle savedInstanceState) { 59 | super.onCreate(savedInstanceState); 60 | setContentView(R.layout.activity_main); 61 | context = this; 62 | initView(); 63 | 64 | btLookBitmapProgress = findViewById(R.id.btLookBitmapProgress); 65 | btLookBitmapProgress.setOnClickListener(new OnClickListener() { 66 | @Override 67 | public void onClick(View v) { 68 | startActivity(new Intent(MainActivity.this, TestBitmapActivity.class)); 69 | } 70 | }); 71 | sb_angle = (SeekBar) findViewById(R.id.sb_angle); 72 | sb_round = (SeekBar) findViewById(R.id.sb_round); 73 | sb_left = (SeekBar) findViewById(R.id.sb_left); 74 | sb_top = (SeekBar) findViewById(R.id.sb_top); 75 | sb_right = (SeekBar) findViewById(R.id.sb_right); 76 | sb_bottom = (SeekBar) findViewById(R.id.sb_bottom); 77 | 78 | mp = (MyProgress) findViewById(R.id.mp); 79 | mp.setUseAnimation(cbShowAnim.isClickable()); 80 | LinearGradient linearGradient = new LinearGradient(-mp.getViewWidth() / 2, -mp.getViewHeight() / 2, mp.getViewWidth() / 2, mp.getViewHeight() / 2, 81 | ContextCompat.getColor(MainActivity.this, R.color.green), 82 | ContextCompat.getColor(MainActivity.this, R.color.blue), 83 | Shader.TileMode.MIRROR); 84 | mp.setNowProgress(sbProgress.getProgress()).setNowProgressSecond(sbProgressSecond.getProgress()).setMaxProgress(100).setProgressShader(linearGradient).setRadius(mp.getViewHeight() / 2).complete(); 85 | mp.setBgColor(ContextCompat.getColor(context, R.color.white)); 86 | mp.setOnProgressInter(new MyProgress.OnProgressInter() { 87 | @Override 88 | public void progress(float animProgress, float progress, float max) { 89 | // Log.i("======", animProgress + "==" + progress + "===" + max); 90 | } 91 | }); 92 | mp.setOnProgressInterSecond(new MyProgress.OnProgressInter() { 93 | @Override 94 | public void progress(float animProgress, float progress, float max) { 95 | 96 | } 97 | }); 98 | 99 | sb_round.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { 100 | @Override 101 | public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { 102 | 103 | mp.setRadius(mp.getViewHeight() / 2 * progress / 100).complete(); 104 | } 105 | 106 | @Override 107 | public void onStartTrackingTouch(SeekBar seekBar) { 108 | 109 | } 110 | 111 | @Override 112 | public void onStopTrackingTouch(SeekBar seekBar) { 113 | 114 | } 115 | }); 116 | 117 | 118 | sb_angle.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { 119 | @Override 120 | public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { 121 | mp.setAngle(progress * 360 / 100).complete(); 122 | } 123 | 124 | @Override 125 | public void onStartTrackingTouch(SeekBar seekBar) { 126 | } 127 | 128 | @Override 129 | public void onStopTrackingTouch(SeekBar seekBar) { 130 | } 131 | }); 132 | 133 | sb_left.setOnSeekBarChangeListener(getL(0)); 134 | sb_top.setOnSeekBarChangeListener(getL(1)); 135 | sb_right.setOnSeekBarChangeListener(getL(2)); 136 | sb_bottom.setOnSeekBarChangeListener(getL(3)); 137 | 138 | } 139 | 140 | @NonNull 141 | private SeekBar.OnSeekBarChangeListener getL(final int flag) { 142 | return new SeekBar.OnSeekBarChangeListener() { 143 | @Override 144 | public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { 145 | switch (flag) { 146 | case 0: 147 | mp.setLeftInterval(progress * dip2px(context, 10) / 100).complete(); 148 | break; 149 | case 1: 150 | mp.setTopInterval(progress * dip2px(context, 10) / 100).complete(); 151 | break; 152 | case 2: 153 | mp.setRightInterval(progress * dip2px(context, 10) / 100).complete(); 154 | break; 155 | case 3: 156 | mp.setBottomInterval(progress * dip2px(context, 10) / 100).complete(); 157 | break; 158 | } 159 | } 160 | 161 | @Override 162 | public void onStartTrackingTouch(SeekBar seekBar) { 163 | } 164 | 165 | @Override 166 | public void onStopTrackingTouch(SeekBar seekBar) { 167 | } 168 | }; 169 | } 170 | 171 | public int dip2px(Context context, float dipValue) { 172 | float scale = context.getResources().getDisplayMetrics().density; 173 | return (int) (dipValue * scale + 0.5F); 174 | } 175 | 176 | private void initView() { 177 | sbProgress = (SeekBar) findViewById(R.id.sbProgress); 178 | sbProgress.setOnSeekBarChangeListener(this); 179 | 180 | sbProgressSecond = (SeekBar) findViewById(R.id.sbProgressSecond); 181 | sbProgressSecond.setOnSeekBarChangeListener(this); 182 | 183 | 184 | cbShowAnim = findViewById(R.id.cbShowAnim); 185 | cbShowAnim.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { 186 | @Override 187 | public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { 188 | mp.setUseAnimation(isChecked); 189 | } 190 | }); 191 | 192 | sbBorderWidth = (SeekBar) findViewById(R.id.sbBorderWidth); 193 | sbBorderWidth.setOnSeekBarChangeListener(this); 194 | 195 | tvBgColor = findViewById(R.id.tvBgColor); 196 | tvBgColor.setOnClickListener(this); 197 | 198 | tvBorderColor = findViewById(R.id.tvBorderColor); 199 | tvBorderColor.setOnClickListener(this); 200 | 201 | tvProgressColor = findViewById(R.id.tvProgressColor); 202 | tvProgressColor.setOnClickListener(this); 203 | 204 | cbTopLeftNoRadius = findViewById(R.id.cbTopLeftNoRadius); 205 | cbTopLeftNoRadius.setOnCheckedChangeListener(this); 206 | 207 | cbTopRightNoRadius = findViewById(R.id.cbTopRightNoRadius); 208 | cbTopRightNoRadius.setOnCheckedChangeListener(this); 209 | 210 | cbBottomRightNoRadius = findViewById(R.id.cbBottomRightNoRadius); 211 | cbBottomRightNoRadius.setOnCheckedChangeListener(this); 212 | 213 | cbBottomLeftNoRadius = findViewById(R.id.cbBottomLeftNoRadius); 214 | cbBottomLeftNoRadius.setOnCheckedChangeListener(this); 215 | 216 | 217 | 218 | cbTopLeftNoRadius2 = findViewById(R.id.cbTopLeftNoRadius2); 219 | cbTopLeftNoRadius2.setOnCheckedChangeListener(this); 220 | 221 | cbTopRightNoRadius2 = findViewById(R.id.cbTopRightNoRadius2); 222 | cbTopRightNoRadius2.setOnCheckedChangeListener(this); 223 | 224 | cbBottomRightNoRadius2 = findViewById(R.id.cbBottomRightNoRadius2); 225 | cbBottomRightNoRadius2.setOnCheckedChangeListener(this); 226 | 227 | cbBottomLeftNoRadius2 = findViewById(R.id.cbBottomLeftNoRadius2); 228 | cbBottomLeftNoRadius2.setOnCheckedChangeListener(this); 229 | 230 | } 231 | 232 | @Override 233 | public void onClick(View v) { 234 | switch (v.getId()) { 235 | case R.id.tvProgressColor: 236 | selectColorDialog = new SelectColorDialog(this); 237 | selectColorDialog.setListener(new SelectColorListener() { 238 | @Override 239 | public void selectColor(int color) { 240 | mp.setProgressColor(color).complete(); 241 | tvProgressColor.setBackgroundColor(color); 242 | } 243 | }); 244 | selectColorDialog.show(); 245 | break; 246 | case R.id.tvBgColor: 247 | selectColorDialog = new SelectColorDialog(this); 248 | selectColorDialog.setListener(new SelectColorListener() { 249 | @Override 250 | public void selectColor(int color) { 251 | mp.setBgColor(color).complete(); 252 | tvBgColor.setBackgroundColor(color); 253 | } 254 | }); 255 | selectColorDialog.show(); 256 | break; 257 | case R.id.tvBorderColor: 258 | selectColorDialog = new SelectColorDialog(this); 259 | selectColorDialog.setListener(new SelectColorListener() { 260 | @Override 261 | public void selectColor(int color) { 262 | mp.setBorderColor(color).complete(); 263 | tvBorderColor.setBackgroundColor(color); 264 | } 265 | }); 266 | selectColorDialog.show(); 267 | break; 268 | } 269 | } 270 | 271 | @Override 272 | public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { 273 | switch (seekBar.getId()) { 274 | case R.id.sbProgress: 275 | mp.setNowProgress(progress).complete(); 276 | break; 277 | case R.id.sbProgressSecond: 278 | mp.setNowProgressSecond(progress).complete(); 279 | break; 280 | case R.id.sbBorderWidth: 281 | mp.setBorderWidth(progress / 3).complete(); 282 | break; 283 | } 284 | } 285 | 286 | @Override 287 | public void onStartTrackingTouch(SeekBar seekBar) { 288 | 289 | } 290 | 291 | @Override 292 | public void onStopTrackingTouch(SeekBar seekBar) { 293 | 294 | } 295 | 296 | @Override 297 | public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { 298 | switch (buttonView.getId()){ 299 | case R.id.cbTopLeftNoRadius: 300 | mp.setNoTopLeftRadius(isChecked).complete(); 301 | break; 302 | case R.id.cbTopRightNoRadius: 303 | mp.setNoTopRightRadius(isChecked).complete(); 304 | break; 305 | case R.id.cbBottomRightNoRadius: 306 | mp.setNoBottomRightRadius(isChecked).complete(); 307 | break; 308 | case R.id.cbBottomLeftNoRadius: 309 | mp.setNoBottomLeftRadius(isChecked).complete(); 310 | break; 311 | case R.id.cbTopLeftNoRadius2: 312 | mp.setNoTopLeftRadiusSecond(isChecked).complete(); 313 | break; 314 | case R.id.cbTopRightNoRadius2: 315 | mp.setNoTopRightRadiusSecond(isChecked).complete(); 316 | break; 317 | case R.id.cbBottomRightNoRadius2: 318 | mp.setNoBottomRightRadiusSecond(isChecked).complete(); 319 | break; 320 | case R.id.cbBottomLeftNoRadius2: 321 | mp.setNoBottomLeftRadiusSecond(isChecked).complete(); 322 | break; 323 | } 324 | } 325 | } 326 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 21 | 22 | 26 | 27 | 31 | 32 | 37 | 38 | 45 | 46 | 54 | 55 | 63 | 64 | 72 | 79 | 80 | 81 | 87 | 88 | 92 | 93 | 99 | 100 | 106 | 107 | 113 | 119 | 120 | 126 | 127 | 132 | 133 | 139 | 140 | 141 | 147 | 148 | 153 | 154 | 160 | 161 | 162 | 168 | 169 | 174 | 175 | 181 | 182 | 183 | 189 | 190 | 195 | 196 | 202 | 203 | 204 | 210 | 211 | 216 | 217 | 223 | 224 | 225 | 231 | 232 | 237 | 238 | 244 | 245 | 246 | 252 | 253 | 258 | 259 | 265 | 266 | 267 | 273 | 279 | 286 | 293 | 300 | 307 | 308 | 314 | 320 | 327 | 334 | 341 | 348 | 349 |