From 1a58ee3ad7d2c676325ae4cb329844030ac65754 Mon Sep 17 00:00:00 2001 From: newcaoguo Date: Sat, 5 May 2018 22:40:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E6=95=B0=E5=AD=97=E6=95=88?= =?UTF-8?q?=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/caches/build_file_checksums.ser | Bin 0 -> 604 bytes .idea/codeStyles/Project.xml | 29 +++ .idea/misc.xml | 34 ++++ .idea/modules.xml | 10 + .idea/runConfigurations.xml | 12 ++ .idea/vcs.xml | 6 + app/.gitignore | 1 + app/build.gradle | 29 +++ app/proguard-rules.pro | 21 +++ .../ExampleInstrumentedTest.java | 26 +++ app/src/main/AndroidManifest.xml | 21 +++ .../newcaoguo/rollingnumber/MainActivity.java | 43 +++++ .../drawable-v24/ic_launcher_foreground.xml | 34 ++++ .../res/drawable/ic_launcher_background.xml | 170 +++++++++++++++++ app/src/main/res/layout/activity_main.xml | 42 +++++ .../res/mipmap-anydpi-v26/ic_launcher.xml | 5 + .../mipmap-anydpi-v26/ic_launcher_round.xml | 5 + app/src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 21689 bytes .../res/mipmap-hdpi/ic_launcher_round.png | Bin 0 -> 5024 bytes app/src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 17432 bytes .../res/mipmap-mdpi/ic_launcher_round.png | Bin 0 -> 2858 bytes app/src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 20636 bytes .../res/mipmap-xhdpi/ic_launcher_round.png | Bin 0 -> 7098 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 25027 bytes .../res/mipmap-xxhdpi/ic_launcher_round.png | Bin 0 -> 10676 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 29662 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 0 -> 15523 bytes app/src/main/res/values-w820dp/dimens.xml | 6 + app/src/main/res/values/colors.xml | 6 + app/src/main/res/values/dimens.xml | 5 + app/src/main/res/values/strings.xml | 3 + app/src/main/res/values/styles.xml | 11 ++ .../rollingnumber/ExampleUnitTest.java | 17 ++ build.gradle | 27 +++ easyrollingnumber/.gitignore | 1 + easyrollingnumber/build.gradle | 34 ++++ easyrollingnumber/proguard-rules.pro | 21 +++ .../ExampleInstrumentedTest.java | 26 +++ .../src/main/AndroidManifest.xml | 2 + .../view/ScrollingDigitalAnimation.java | 159 ++++++++++++++++ .../drawable-v24/ic_launcher_foreground.xml | 34 ++++ .../res/drawable/ic_launcher_background.xml | 170 +++++++++++++++++ .../src/main/res/layout/activity_main.xml | 41 +++++ .../res/mipmap-anydpi-v26/ic_launcher.xml | 5 + .../mipmap-anydpi-v26/ic_launcher_round.xml | 5 + .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 21689 bytes .../res/mipmap-hdpi/ic_launcher_round.png | Bin 0 -> 5024 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 17432 bytes .../res/mipmap-mdpi/ic_launcher_round.png | Bin 0 -> 2858 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 20636 bytes .../res/mipmap-xhdpi/ic_launcher_round.png | Bin 0 -> 7098 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 25027 bytes .../res/mipmap-xxhdpi/ic_launcher_round.png | Bin 0 -> 10676 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 29662 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 0 -> 15523 bytes .../src/main/res/values-w820dp/dimens.xml | 6 + .../src/main/res/values/colors.xml | 6 + .../src/main/res/values/dimens.xml | 5 + .../src/main/res/values/strings.xml | 3 + .../src/main/res/values/styles.xml | 11 ++ .../easyrollingnumber/ExampleUnitTest.java | 17 ++ gradle.properties | 13 ++ gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 54708 bytes gradle/wrapper/gradle-wrapper.properties | 6 + gradlew | 172 ++++++++++++++++++ gradlew.bat | 84 +++++++++ settings.gradle | 1 + 67 files changed, 1385 insertions(+) create mode 100644 .idea/caches/build_file_checksums.ser create mode 100644 .idea/codeStyles/Project.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/runConfigurations.xml create mode 100644 .idea/vcs.xml create mode 100644 app/.gitignore create mode 100644 app/build.gradle create mode 100644 app/proguard-rules.pro create mode 100644 app/src/androidTest/java/com/newcaoguo/rollingnumber/ExampleInstrumentedTest.java create mode 100644 app/src/main/AndroidManifest.xml create mode 100644 app/src/main/java/com/newcaoguo/rollingnumber/MainActivity.java create mode 100644 app/src/main/res/drawable-v24/ic_launcher_foreground.xml create mode 100644 app/src/main/res/drawable/ic_launcher_background.xml create mode 100644 app/src/main/res/layout/activity_main.xml create mode 100644 app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml create mode 100644 app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml create mode 100644 app/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-hdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png create mode 100644 app/src/main/res/values-w820dp/dimens.xml create mode 100644 app/src/main/res/values/colors.xml create mode 100644 app/src/main/res/values/dimens.xml create mode 100644 app/src/main/res/values/strings.xml create mode 100644 app/src/main/res/values/styles.xml create mode 100644 app/src/test/java/com/newcaoguo/rollingnumber/ExampleUnitTest.java create mode 100644 build.gradle create mode 100644 easyrollingnumber/.gitignore create mode 100644 easyrollingnumber/build.gradle create mode 100644 easyrollingnumber/proguard-rules.pro create mode 100644 easyrollingnumber/src/androidTest/java/com/newcaoguo/easyrollingnumber/ExampleInstrumentedTest.java create mode 100644 easyrollingnumber/src/main/AndroidManifest.xml create mode 100644 easyrollingnumber/src/main/java/com/newcaoguo/easyrollingnumber/view/ScrollingDigitalAnimation.java create mode 100644 easyrollingnumber/src/main/res/drawable-v24/ic_launcher_foreground.xml create mode 100644 easyrollingnumber/src/main/res/drawable/ic_launcher_background.xml create mode 100644 easyrollingnumber/src/main/res/layout/activity_main.xml create mode 100644 easyrollingnumber/src/main/res/mipmap-anydpi-v26/ic_launcher.xml create mode 100644 easyrollingnumber/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml create mode 100644 easyrollingnumber/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 easyrollingnumber/src/main/res/mipmap-hdpi/ic_launcher_round.png create mode 100644 easyrollingnumber/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 easyrollingnumber/src/main/res/mipmap-mdpi/ic_launcher_round.png create mode 100644 easyrollingnumber/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 easyrollingnumber/src/main/res/mipmap-xhdpi/ic_launcher_round.png create mode 100644 easyrollingnumber/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 easyrollingnumber/src/main/res/mipmap-xxhdpi/ic_launcher_round.png create mode 100644 easyrollingnumber/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 easyrollingnumber/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png create mode 100644 easyrollingnumber/src/main/res/values-w820dp/dimens.xml create mode 100644 easyrollingnumber/src/main/res/values/colors.xml create mode 100644 easyrollingnumber/src/main/res/values/dimens.xml create mode 100644 easyrollingnumber/src/main/res/values/strings.xml create mode 100644 easyrollingnumber/src/main/res/values/styles.xml create mode 100644 easyrollingnumber/src/test/java/com/newcaoguo/easyrollingnumber/ExampleUnitTest.java create mode 100644 gradle.properties create mode 100644 gradle/wrapper/gradle-wrapper.jar create mode 100644 gradle/wrapper/gradle-wrapper.properties create mode 100644 gradlew create mode 100644 gradlew.bat create mode 100644 settings.gradle diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser new file mode 100644 index 0000000000000000000000000000000000000000..ee442f15a685ff8aa3d4f8e4a2d2bac8b546b790 GIT binary patch literal 604 zcmZ4UmVvdnh`~NNKUXg?FQq6yGexf?KR>5fFEb@IQ7^qHF(oHeub?PDD>b=9F91S2 zm1gFoxMk*~I%lLNXBU^|7Q2L-Ts|(GuF1r}uGBYr_F>vMNC#JY1CYR(Fc`|U8WE7@RRyZvXIyzcw--~ViGJ`4jo zu{gD)Br`9)7^bn1p^kwKq_+R_EZy6Gdomeir~Huiym`8WK`u41xUwieCkLoLuQWF) zwFuQtxYnzxyc3j1gna#B|hiG^(2Ov%m6%PcM_ zN(6>i4Ad_%h$zM|?22s9&3=YWEH4{4XT160R9C_vh)4D3UglMM5|;XHvQ0C7c2*#% F0syHk*vtR` literal 0 HcmV?d00001 diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..30aa626 --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..99202cc --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..93a30bb --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml new file mode 100644 index 0000000..7f68460 --- /dev/null +++ b/.idea/runConfigurations.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..f4d4169 --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,29 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 27 + defaultConfig { + applicationId "com.newcaoguo.rollingnumber" + minSdkVersion 15 + targetSdkVersion 27 + versionCode 1 + versionName "1.0" + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + implementation fileTree(include: ['*.jar'], dir: 'libs') + implementation 'com.android.support:appcompat-v7:27.1.1' + implementation 'com.android.support.constraint:constraint-layout:1.1.0' + testImplementation 'junit:junit:4.12' + androidTestImplementation 'com.android.support.test:runner:1.0.2' + androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' + implementation project(':easyrollingnumber') +} diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..f1b4245 --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/app/src/androidTest/java/com/newcaoguo/rollingnumber/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/newcaoguo/rollingnumber/ExampleInstrumentedTest.java new file mode 100644 index 0000000..72a0981 --- /dev/null +++ b/app/src/androidTest/java/com/newcaoguo/rollingnumber/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.newcaoguo.rollingnumber; + +import android.content.Context; +import android.support.test.InstrumentationRegistry; +import android.support.test.runner.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getTargetContext(); + + assertEquals("com.newcaoguo.rollingnumber", appContext.getPackageName()); + } +} diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..888973f --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/com/newcaoguo/rollingnumber/MainActivity.java b/app/src/main/java/com/newcaoguo/rollingnumber/MainActivity.java new file mode 100644 index 0000000..9ae325d --- /dev/null +++ b/app/src/main/java/com/newcaoguo/rollingnumber/MainActivity.java @@ -0,0 +1,43 @@ +package com.newcaoguo.rollingnumber; + +import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; +import android.view.View; + +import com.newcaoguo.easyrollingnumber.view.ScrollingDigitalAnimation; + +public class MainActivity extends AppCompatActivity { + + private ScrollingDigitalAnimation money; // 显示金钱的自定义控件 + private ScrollingDigitalAnimation number; // 显示数字的自定义控件 + private ScrollingDigitalAnimation percentage; // 显示百分比的自定义控件 + + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + init(); + } + + private void init() { + money = findViewById(R.id.text); + number = findViewById(R.id.text1); + percentage = findViewById(R.id.text2); + } + + + /** + * 启动按钮单击事件 + */ + public void start(View view) { + money.setPrefixString("¥");//设置符号 + money.setNumberString("9", "9999999999");//设置起始于结束的数字 + money.setDuration(3000); + number.setNumberString("1234567890"); + number.setDuration(4000); + percentage.setPostfixString("%"); + percentage.setNumberString("0.99", "99.99"); + percentage.setDuration(5000); + } +} diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..c7bd21d --- /dev/null +++ b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..d5fccc5 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..05a7645 --- /dev/null +++ b/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + +