From eb8cba4dc3569ef820494d51458068cf20e404e6 Mon Sep 17 00:00:00 2001 From: fengt Date: Mon, 26 Dec 2016 15:38:19 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=96=B0=E7=BB=84=E7=BB=87=E4=BA=86?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=EF=BC=8C=E5=8A=A0=E4=B8=8A=E4=BA=86=E5=8F=AF?= =?UTF-8?q?=E7=88=B1=E7=9A=84=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + .idea/.name | 1 - .idea/encodings.xml | 6 --- .idea/gradle.xml | 4 +- .idea/misc.xml | 2 +- .idea/modules.xml | 4 +- .idea/vcs.xml | 2 +- .../anfq/numedittext/lib/ApplicationTest.java | 13 ------- .../src/main/AndroidManifest.xml | 13 ------- .../src/main/res/values/strings.xml | 3 -- .../.gitignore | 0 .../build.gradle | 14 +++++-- .../proguard-rules.pro | 0 .../lib/ExampleInstrumentedTest.java | 26 +++++++++++++ .../src/main/AndroidManifest.xml | 8 ++++ .../fj/edittextcount/lib/FJEditTextCount.java | 36 +++++++++++------- .../src/main/res/layout/fj_edittext_count.xml | 0 .../src/main/res/values/strings.xml | 3 ++ .../edittextcount}/lib/ExampleUnitTest.java | 6 ++- README-En.md | 15 ++++---- README.md | 18 ++++----- app/build.gradle | 19 +++++---- .../numedittext/demo/ApplicationTest.java | 13 ------- .../test/ExampleInstrumentedTest.java | 26 +++++++++++++ app/src/main/AndroidManifest.xml | 4 +- .../anfq/numedittext/demo/MainActivity.java | 24 ------------ .../fj/edittextcount/test/MainActivity.java | 34 +++++++++++++++++ app/src/main/res/layout/activity_main.xml | 10 +++-- app/src/main/res/values/strings.xml | 2 +- .../edittextcount/test}/ExampleUnitTest.java | 6 ++- build.gradle | 2 +- gradle.properties | 5 +-- gradle/wrapper/gradle-wrapper.jar | Bin 53637 -> 53636 bytes gradle/wrapper/gradle-wrapper.properties | 4 +- settings.gradle | 2 +- 35 files changed, 187 insertions(+), 139 deletions(-) delete mode 100644 .idea/.name delete mode 100644 .idea/encodings.xml delete mode 100644 AnFQNumEditTextLib/src/androidTest/java/anfq/numedittext/lib/ApplicationTest.java delete mode 100644 AnFQNumEditTextLib/src/main/AndroidManifest.xml delete mode 100644 AnFQNumEditTextLib/src/main/res/values/strings.xml rename {AnFQNumEditTextLib => FJEditTextCountLib}/.gitignore (100%) rename {AnFQNumEditTextLib => FJEditTextCountLib}/build.gradle (52%) rename {AnFQNumEditTextLib => FJEditTextCountLib}/proguard-rules.pro (100%) create mode 100644 FJEditTextCountLib/src/androidTest/java/fj/edittextcount/lib/ExampleInstrumentedTest.java create mode 100644 FJEditTextCountLib/src/main/AndroidManifest.xml rename AnFQNumEditTextLib/src/main/java/anfq/numedittext/lib/AnFQNumEditText.java => FJEditTextCountLib/src/main/java/fj/edittextcount/lib/FJEditTextCount.java (77%) rename AnFQNumEditTextLib/src/main/res/layout/anfq_num_edittext.xml => FJEditTextCountLib/src/main/res/layout/fj_edittext_count.xml (100%) create mode 100644 FJEditTextCountLib/src/main/res/values/strings.xml rename {AnFQNumEditTextLib/src/test/java/anfq/numedittext => FJEditTextCountLib/src/test/java/fj/edittextcount}/lib/ExampleUnitTest.java (51%) delete mode 100644 app/src/androidTest/java/anfq/numedittext/demo/ApplicationTest.java create mode 100644 app/src/androidTest/java/fj/edittextcount/test/ExampleInstrumentedTest.java delete mode 100644 app/src/main/java/anfq/numedittext/demo/MainActivity.java create mode 100644 app/src/main/java/fj/edittextcount/test/MainActivity.java rename app/src/test/java/{anfq/numedittext/demo => fj/edittextcount/test}/ExampleUnitTest.java (51%) diff --git a/.gitignore b/.gitignore index c6cbe56..39fb081 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ .DS_Store /build /captures +.externalNativeBuild diff --git a/.idea/.name b/.idea/.name deleted file mode 100644 index f58f2f4..0000000 --- a/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -AnFQNumEditText \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml deleted file mode 100644 index 97626ba..0000000 --- a/.idea/encodings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 1b34499..716a022 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -5,14 +5,14 @@ + diff --git a/.idea/misc.xml b/.idea/misc.xml index 1a3eaff..5d19981 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -37,7 +37,7 @@ - + diff --git a/.idea/modules.xml b/.idea/modules.xml index 6f93689..90e8912 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,8 +2,8 @@ - - + + diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 6564d52..94a25f7 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/AnFQNumEditTextLib/src/androidTest/java/anfq/numedittext/lib/ApplicationTest.java b/AnFQNumEditTextLib/src/androidTest/java/anfq/numedittext/lib/ApplicationTest.java deleted file mode 100644 index da29413..0000000 --- a/AnFQNumEditTextLib/src/androidTest/java/anfq/numedittext/lib/ApplicationTest.java +++ /dev/null @@ -1,13 +0,0 @@ -package anfq.numedittext.lib; - -import android.app.Application; -import android.test.ApplicationTestCase; - -/** - * Testing Fundamentals - */ -public class ApplicationTest extends ApplicationTestCase { - public ApplicationTest() { - super(Application.class); - } -} \ No newline at end of file diff --git a/AnFQNumEditTextLib/src/main/AndroidManifest.xml b/AnFQNumEditTextLib/src/main/AndroidManifest.xml deleted file mode 100644 index a003aa0..0000000 --- a/AnFQNumEditTextLib/src/main/AndroidManifest.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - diff --git a/AnFQNumEditTextLib/src/main/res/values/strings.xml b/AnFQNumEditTextLib/src/main/res/values/strings.xml deleted file mode 100644 index 41b5953..0000000 --- a/AnFQNumEditTextLib/src/main/res/values/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - AnFQNumEditTextLib - diff --git a/AnFQNumEditTextLib/.gitignore b/FJEditTextCountLib/.gitignore similarity index 100% rename from AnFQNumEditTextLib/.gitignore rename to FJEditTextCountLib/.gitignore diff --git a/AnFQNumEditTextLib/build.gradle b/FJEditTextCountLib/build.gradle similarity index 52% rename from AnFQNumEditTextLib/build.gradle rename to FJEditTextCountLib/build.gradle index 4b05e71..3cfa578 100644 --- a/AnFQNumEditTextLib/build.gradle +++ b/FJEditTextCountLib/build.gradle @@ -1,14 +1,17 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 23 - buildToolsVersion "23.0.3" + compileSdkVersion 25 + buildToolsVersion "25.0.0" defaultConfig { minSdkVersion 14 - targetSdkVersion 23 + targetSdkVersion 25 versionCode 1 versionName "1.0" + + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + } buildTypes { release { @@ -20,6 +23,9 @@ android { dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) + androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { + exclude group: 'com.android.support', module: 'support-annotations' + }) + compile 'com.android.support:appcompat-v7:25.0.1' testCompile 'junit:junit:4.12' - compile 'com.android.support:appcompat-v7:23.4.0' } diff --git a/AnFQNumEditTextLib/proguard-rules.pro b/FJEditTextCountLib/proguard-rules.pro similarity index 100% rename from AnFQNumEditTextLib/proguard-rules.pro rename to FJEditTextCountLib/proguard-rules.pro diff --git a/FJEditTextCountLib/src/androidTest/java/fj/edittextcount/lib/ExampleInstrumentedTest.java b/FJEditTextCountLib/src/androidTest/java/fj/edittextcount/lib/ExampleInstrumentedTest.java new file mode 100644 index 0000000..59182a9 --- /dev/null +++ b/FJEditTextCountLib/src/androidTest/java/fj/edittextcount/lib/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package fj.edittextcount.lib; + +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.*; + +/** + * Instrumentation test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() throws Exception { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getTargetContext(); + + assertEquals("fj.edittextcount.lib.test", appContext.getPackageName()); + } +} diff --git a/FJEditTextCountLib/src/main/AndroidManifest.xml b/FJEditTextCountLib/src/main/AndroidManifest.xml new file mode 100644 index 0000000..1629ea8 --- /dev/null +++ b/FJEditTextCountLib/src/main/AndroidManifest.xml @@ -0,0 +1,8 @@ + + + + + + + diff --git a/AnFQNumEditTextLib/src/main/java/anfq/numedittext/lib/AnFQNumEditText.java b/FJEditTextCountLib/src/main/java/fj/edittextcount/lib/FJEditTextCount.java similarity index 77% rename from AnFQNumEditTextLib/src/main/java/anfq/numedittext/lib/AnFQNumEditText.java rename to FJEditTextCountLib/src/main/java/fj/edittextcount/lib/FJEditTextCount.java index db78180..10602df 100644 --- a/AnFQNumEditTextLib/src/main/java/anfq/numedittext/lib/AnFQNumEditText.java +++ b/FJEditTextCountLib/src/main/java/fj/edittextcount/lib/FJEditTextCount.java @@ -1,4 +1,4 @@ -package anfq.numedittext.lib; +package fj.edittextcount.lib; import android.content.Context; import android.graphics.Color; @@ -13,11 +13,21 @@ import android.widget.TextView; /** - * AnFQ - * @time 2016-10-09 14:50 + * ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ + * ┃ ╭﹉﹊﹉╮ ╔═════╗╔═════╗╔═════╗┃ + * ┃╭╯老斯基㊣╠╣淡漠de人生╠╣2016-10-09╠╣ 欢迎关注 ╣┃ + * ┃╰⊙┈┈┈⊙╯╚◎═══◎╝╚◎═══◎╝╚◎═══◎╝┃ + * ┣━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┫ + * ┃GitHub┃https://github.com/FJ917 ┃ + * ┃简 书┃http://www.jianshu.com/users/3d2770e6e489 ┃ + * ┃Q Q┃511334686 ┃ + * ┗━━━┻━━━━━━━━━━━━━━━━━━━━━━━━┛ */ -public class AnFQNumEditText extends RelativeLayout{ + +// JUMP +public class FJEditTextCount extends RelativeLayout { + //类型1(单数类型):TextView显示总字数,然后根据输入递减.例:100,99,98 //类型2(百分比类型):TextView显示总字数和当前输入的字数,例:0/100,1/100,2/100 public static final String SINGULAR = "Singular";//类型1(单数类型) @@ -28,13 +38,13 @@ public class AnFQNumEditText extends RelativeLayout{ private String TYPES = SINGULAR;//类型 private int MaxNum = 100;//最大字符 - public AnFQNumEditText(Context context) { + public FJEditTextCount(Context context) { this(context, null); } - public AnFQNumEditText(Context context, AttributeSet attrs) { + public FJEditTextCount(Context context, AttributeSet attrs) { super(context, attrs); - LayoutInflater.from(context).inflate(R.layout.anfq_num_edittext, this, true); + LayoutInflater.from(context).inflate(R.layout.fj_edittext_count, this, true); etContent = (EditText) findViewById(R.id.etContent); tvNum = (TextView) findViewById(R.id.tvNum); vLine = findViewById(R.id.vLine); @@ -44,7 +54,7 @@ public AnFQNumEditText(Context context, AttributeSet attrs) { * 设置显示 * @return */ - public AnFQNumEditText show(){ + public FJEditTextCount show(){ if(TYPES.equals(SINGULAR)){//类型1 tvNum.setText(String.valueOf(MaxNum)); }else if(TYPES.equals(PERCENTAGE)){//类型2 @@ -62,7 +72,7 @@ public AnFQNumEditText show(){ * @param color --颜色值 * @return */ - public AnFQNumEditText setLineColor(String color){ + public FJEditTextCount setLineColor(String color){ vLine.setBackgroundColor(Color.parseColor(color)); return this; } @@ -72,7 +82,7 @@ public AnFQNumEditText setLineColor(String color){ * @param type --类型 * @return */ - public AnFQNumEditText setType(String type){ + public FJEditTextCount setType(String type){ TYPES = type; return this; } @@ -82,7 +92,7 @@ public AnFQNumEditText setType(String type){ * @param num --字数 * @return */ - public AnFQNumEditText setLength(int num){ + public FJEditTextCount setLength(int num){ this.MaxNum = num; return this; } @@ -92,7 +102,7 @@ public AnFQNumEditText setLength(int num){ * @param str --设置内容 * @return */ - public AnFQNumEditText setEtHint(String str){ + public FJEditTextCount setEtHint(String str){ etContent.setHint(str); return this; } @@ -102,7 +112,7 @@ public AnFQNumEditText setEtHint(String str){ * @param px --最小高度(单位px) * @return */ - public AnFQNumEditText setEtMinHeight(int px){ + public FJEditTextCount setEtMinHeight(int px){ etContent.setMinHeight(px); return this; } diff --git a/AnFQNumEditTextLib/src/main/res/layout/anfq_num_edittext.xml b/FJEditTextCountLib/src/main/res/layout/fj_edittext_count.xml similarity index 100% rename from AnFQNumEditTextLib/src/main/res/layout/anfq_num_edittext.xml rename to FJEditTextCountLib/src/main/res/layout/fj_edittext_count.xml diff --git a/FJEditTextCountLib/src/main/res/values/strings.xml b/FJEditTextCountLib/src/main/res/values/strings.xml new file mode 100644 index 0000000..dd203f1 --- /dev/null +++ b/FJEditTextCountLib/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + FJEditTextCountLib + diff --git a/AnFQNumEditTextLib/src/test/java/anfq/numedittext/lib/ExampleUnitTest.java b/FJEditTextCountLib/src/test/java/fj/edittextcount/lib/ExampleUnitTest.java similarity index 51% rename from AnFQNumEditTextLib/src/test/java/anfq/numedittext/lib/ExampleUnitTest.java rename to FJEditTextCountLib/src/test/java/fj/edittextcount/lib/ExampleUnitTest.java index 3a6fb2b..0494428 100644 --- a/AnFQNumEditTextLib/src/test/java/anfq/numedittext/lib/ExampleUnitTest.java +++ b/FJEditTextCountLib/src/test/java/fj/edittextcount/lib/ExampleUnitTest.java @@ -1,11 +1,13 @@ -package anfq.numedittext.lib; +package fj.edittextcount.lib; import org.junit.Test; import static org.junit.Assert.*; /** - * To work on unit tests, switch the Test Artifact in the Build Variants view. + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation */ public class ExampleUnitTest { @Test diff --git a/README-En.md b/README-En.md index 2479bef..fb20986 100644 --- a/README-En.md +++ b/README-En.md @@ -4,24 +4,23 @@ > ### Preview -![example.gif](http://upload-images.jianshu.io/upload_images/2071764-b45df6bf1d00205e.gif) - - -![example.gif](http://upload-images.jianshu.io/upload_images/2071764-7be37be47251b7d4.gif) +| PERCENTAGE | SINGULAR | +|:-------------:|:-------------:| +| ![PERCENTAGE.gif](http://upload-images.jianshu.io/upload_images/2071764-b45df6bf1d00205e.gif) | ![SINGULAR.gif](http://upload-images.jianshu.io/upload_images/2071764-7be37be47251b7d4.gif) | > ### usage: 1. xml Add to - 2. java Set up - anetDemo = (AnFQNumEditText) findViewById(R.id.anetDemo); - anetDemo.setEtHint("content")//Set prompt text + fjEdit = (FJEditTextCount) findViewById(R.id.fjEdit); + fjEdit.setEtHint("content")//Set prompt text .setEtMinHeight(200)//Set minimum height in px .setLength(50)//Set the total number of words //type(SINGULAR)(PERCENTAGE) diff --git a/README.md b/README.md index 7e1c13a..bf8bcf2 100644 --- a/README.md +++ b/README.md @@ -2,30 +2,30 @@ --- -> ### 栗子惯例,先上GIF - -![栗子1.gif](http://upload-images.jianshu.io/upload_images/2071764-b45df6bf1d00205e.gif) +> ### 栗子惯例,先上GIF -![栗子2.gif](http://upload-images.jianshu.io/upload_images/2071764-7be37be47251b7d4.gif) +| PERCENTAGE效果 | SINGULAR效果 | +|:-------------:|:-------------:| +| ![百分比类型.gif](http://upload-images.jianshu.io/upload_images/2071764-b45df6bf1d00205e.gif) | ![单数类型.gif](http://upload-images.jianshu.io/upload_images/2071764-7be37be47251b7d4.gif) | > ### 用法: 1. xml添加 - 2. java设置 - anetDemo = (AnFQNumEditText) findViewById(R.id.anetDemo); - anetDemo.setEtHint("内容")//设置提示文字 + fjEdit = (FJEditTextCount) findViewById(R.id.fjEdit); + fjEdit.setEtHint("内容")//设置提示文字 .setEtMinHeight(200)//设置最小高度,单位px .setLength(50)//设置总字数 //TextView显示类型(SINGULAR单数类型)(PERCENTAGE百分比类型) - .setType(AnFQNumEditText.SINGULAR) + .setType(FJEditTextCount.SINGULAR) .setLineColor("#3F51B5")//设置横线颜色 .show(); diff --git a/app/build.gradle b/app/build.gradle index ee3932a..a763dec 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,15 +1,15 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 23 - buildToolsVersion "23.0.3" - + compileSdkVersion 25 + buildToolsVersion "25.0.0" defaultConfig { - applicationId "anfq.numedittext.demo" + applicationId "fj.edittextcount.test" minSdkVersion 14 - targetSdkVersion 23 + targetSdkVersion 25 versionCode 1 versionName "1.0" + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { @@ -20,8 +20,11 @@ android { } dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) + compile fileTree(include: ['*.jar'], dir: 'libs') + androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { + exclude group: 'com.android.support', module: 'support-annotations' + }) + compile 'com.android.support:appcompat-v7:25.0.1' testCompile 'junit:junit:4.12' - compile 'com.android.support:appcompat-v7:23.4.0' - compile project(':AnFQNumEditTextLib') + compile project(':FJEditTextCountLib') } diff --git a/app/src/androidTest/java/anfq/numedittext/demo/ApplicationTest.java b/app/src/androidTest/java/anfq/numedittext/demo/ApplicationTest.java deleted file mode 100644 index a84a663..0000000 --- a/app/src/androidTest/java/anfq/numedittext/demo/ApplicationTest.java +++ /dev/null @@ -1,13 +0,0 @@ -package anfq.numedittext.demo; - -import android.app.Application; -import android.test.ApplicationTestCase; - -/** - * Testing Fundamentals - */ -public class ApplicationTest extends ApplicationTestCase { - public ApplicationTest() { - super(Application.class); - } -} \ No newline at end of file diff --git a/app/src/androidTest/java/fj/edittextcount/test/ExampleInstrumentedTest.java b/app/src/androidTest/java/fj/edittextcount/test/ExampleInstrumentedTest.java new file mode 100644 index 0000000..e9ccb96 --- /dev/null +++ b/app/src/androidTest/java/fj/edittextcount/test/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package fj.edittextcount.test; + +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.*; + +/** + * Instrumentation test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() throws Exception { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getTargetContext(); + + assertEquals("fj.edittextcount.test", appContext.getPackageName()); + } +} diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 1e0780e..b61b9ab 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ + package="fj.edittextcount.test"> - + \ No newline at end of file diff --git a/app/src/main/java/anfq/numedittext/demo/MainActivity.java b/app/src/main/java/anfq/numedittext/demo/MainActivity.java deleted file mode 100644 index c9fa98b..0000000 --- a/app/src/main/java/anfq/numedittext/demo/MainActivity.java +++ /dev/null @@ -1,24 +0,0 @@ -package anfq.numedittext.demo; - -import android.support.v7.app.AppCompatActivity; -import android.os.Bundle; - -import anfq.numedittext.lib.AnFQNumEditText; - -public class MainActivity extends AppCompatActivity { - - private AnFQNumEditText anetDemo; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - anetDemo = (AnFQNumEditText) findViewById(R.id.anetDemo); - anetDemo.setEtHint("内容")//设置提示文字 - .setEtMinHeight(200)//设置最小高度,单位px - .setLength(50)//设置总字数 - .setType(AnFQNumEditText.SINGULAR)//TextView显示类型(SINGULAR单数类型)(PERCENTAGE百分比类型) - .setLineColor("#3F51B5")//设置横线颜色 - .show(); - } -} diff --git a/app/src/main/java/fj/edittextcount/test/MainActivity.java b/app/src/main/java/fj/edittextcount/test/MainActivity.java new file mode 100644 index 0000000..9b6ed2f --- /dev/null +++ b/app/src/main/java/fj/edittextcount/test/MainActivity.java @@ -0,0 +1,34 @@ +package fj.edittextcount.test; + +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; + +import fj.edittextcount.lib.FJEditTextCount; +/** + * ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ + * ┃ ╭﹉﹊﹉╮ ╔═════╗╔═════╗╔═════╗┃ + * ┃╭╯老斯基㊣╠╣淡漠de人生╠╣2016-10-09╠╣ 欢迎关注 ╣┃ + * ┃╰⊙┈┈┈⊙╯╚◎═══◎╝╚◎═══◎╝╚◎═══◎╝┃ + * ┣━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┫ + * ┃GitHub┃https://github.com/FJ917 ┃ + * ┃简 书┃http://www.jianshu.com/users/3d2770e6e489 ┃ + * ┃Q Q┃511334686 ┃ + * ┗━━━┻━━━━━━━━━━━━━━━━━━━━━━━━┛ + */ +public class MainActivity extends AppCompatActivity { + + private FJEditTextCount fjEdit; + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + fjEdit = (FJEditTextCount) findViewById(R.id.fjEdit); + fjEdit.setEtHint("内容")//设置提示文字 + .setEtMinHeight(200)//设置最小高度,单位px + .setLength(50)//设置总字数 + //TextView显示类型(SINGULAR单数类型)(PERCENTAGE百分比类型) + .setType(FJEditTextCount.SINGULAR) + .setLineColor("#3F51B5")//设置横线颜色 + .show(); + } +} diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 09aeb62..2e68d7e 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -1,11 +1,13 @@ + android:layout_height="match_parent" + tools:context="fj.edittextcount.test.MainActivity"> - - diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a7b8470..3a913c7 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,3 +1,3 @@ - AnFQNumEditText + FJEditTextCount diff --git a/app/src/test/java/anfq/numedittext/demo/ExampleUnitTest.java b/app/src/test/java/fj/edittextcount/test/ExampleUnitTest.java similarity index 51% rename from app/src/test/java/anfq/numedittext/demo/ExampleUnitTest.java rename to app/src/test/java/fj/edittextcount/test/ExampleUnitTest.java index cd89160..f09e3fc 100644 --- a/app/src/test/java/anfq/numedittext/demo/ExampleUnitTest.java +++ b/app/src/test/java/fj/edittextcount/test/ExampleUnitTest.java @@ -1,11 +1,13 @@ -package anfq.numedittext.demo; +package fj.edittextcount.test; import org.junit.Test; import static org.junit.Assert.*; /** - * To work on unit tests, switch the Test Artifact in the Build Variants view. + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation */ public class ExampleUnitTest { @Test diff --git a/build.gradle b/build.gradle index e0b366a..c20bca1 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.5.0' + classpath 'com.android.tools.build:gradle:2.2.2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/gradle.properties b/gradle.properties index 1d3591c..aac7c9b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,10 +9,9 @@ # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. -# Default value: -Xmx10248m -XX:MaxPermSize=256m -# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 +org.gradle.jvmargs=-Xmx1536m # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true \ No newline at end of file +# org.gradle.parallel=true diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 05ef575b0cd0173fc735f2857ce4bd594ce4f6bd..13372aef5e24af05341d49695ee84e5f9b594659 100644 GIT binary patch delta 1915 zcmZWp3rtg27(Tr%g+V)>*5Oroilt5{MV$^`3?}1IR^*{Ur+_d!WoV`YHzrWTU>FAF zh|y>=kq#EeEYQLRf+_MW6iQ`=88e3lP!}{pR5nNE&i${IRc~_h{pY*?_rK0L_h=Qj zsER98M00ue2-(>oNkhd+p`VaI#7M=N%^MIxi6=M4ySYjvcT4V{Avt#hJ^k+kR@vuIp}i zC|R>=Ufe#X;+Bx_{yD8wSMN?(*|`7PX5Mt|@_pj!@a#{Whj{_{{N(B7$)a`F&$~a; zncu6KOdArv@0G7EJfkW8yW{B7ocWr(C3P;-zg`;dRN>${^`YJIPkcD#U*+-lPCUuq z7^HKYU-Ynk?1Qt7F5;b|4^|I(%N!DVsA3knQRH zhHvh$4KU9Oo^!yMDZIftn@Y?qQ&svSn}t(;<+$Ldkm7_MpJ!Kcz%E*DB^ z($^h0Lm_mDZz-jqkB@1SNIR;z$cm0Oe8OfJ*M_oc|6hh!X0|zj^@(rATo+~@pWQx; zHj!C`lh*^`ShE*)*Sm$jdDLWzH;>x5)dAyBZroSb5NGLESl>ge(XV9AJHDq61axm- z1-Q9=Js@t61srSN2bgqC4p@C{D~BBA{zG8+TXtE?677V_v&#-aX+$W;k=#C#MYZ$psP>1)|hU9V^gw6^P^0PP))TuJDIfh9O$r zN-J3ro*H~Pe-lmRG{Cs(8XRBs7iJbs{7FXj4avCHN;;y2%12B~AuVT!=FoW2&_^(q z<@1z delta 1838 zcmZWpdrVVT7(cz`Q65DLqJ}XU z9KpfZA`x1%7A{oS z(vw_%l9X#^jS!EAZ2aYwd@-LuOo2}96^0O!S8hrXemI#wmCr$ohA;i(m1=h`14bW! zrxFIRFK3uR4WBBYfG9D$55z9>Mj$joo`VH2tL$#EjD#5z2XYRSsWwxsg-B#W41nePuJks=cDqn#U5?0gea zClmdXC4os2$%Vjxi-Ex@d0+DFIMyz8`HsSSnN8y3!rxWS-m1~Yaq)dczGL-RwPH+l z+obdf;`j5hl2v`guPgrg6ZidBayulpQM+g31j;?nE5oHNR8)=AcAHR_7^U~Js+@nG zJX~#cvB+SQ-VW}bZHtyhsq1-EjDSwW6b* z>q~d|s$b+z=0*yCbXgy=%JZn#wE3CV7KO)WiF9U4z&>$}(X3&gSo3T4w%ix#V{v&w zKTNAWh>+E3l*3D`4gcX&R+lRU)gTJ5PePzFj@X ztqYpT8#xzRQy=f`ck}s;#17f)|1OzSig%~I!zHLur5&M|1rAU=0AhK@91t2&)&q87 zlZ`oW)Q}_M!J?y3#D&GZ-632%rg0v7IzOs1N2r#MIVFxbufj$nD>`KkM$-pgu==OP zgOLOqa{q$VnBa>_IToFvT(xjd$6_4Rwnd z9DQ?|%jQyfc9K0hcz!z@Z&VY`+W1`RXPKE+IR$~ETX@exxd?SxAru0ED|*ba?SP}^ zr?wcbJ(HU*%y%@J%t93Ti4aa0aK|oMVfdTFwnqNuu$hh+hZ1rZ9wOeQU2Xaj@fmF} zGx2y#`!1kM`x?OH_Kkp5?J~fT_AdZauOiTz3a6&z|3pO zfLE?b0j;jHc8cpMu)lmg70_PCx=q)83VVYt{>aJlWP}ZF^<&cG^ zdVO(Hr-z7%_opZS?-&k3QZg$6X53U?0u5*c;`EQ*6nw7V(wo3+5fsv-1i%6nwSXN|< zTXn3oKIh{;HOWjxhH34*j$pI$FRV1ifYeB&4tuKvg)8eetM0>6A^ zDd?psotoTC=)$e+A=LiUBt8Fys#>(?3ce=|`Pt(2UY6p?-dDZsqp7dXLqpD+SuQznns#5lT*^dJ=T^z7xBKH){nX5}3mKM-iKQ_FDw0jC(TDgXcg diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f23df6e..04e285f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Oct 21 11:34:03 PDT 2015 +#Mon Dec 28 10:00:20 PST 2015 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip diff --git a/settings.gradle b/settings.gradle index 48f1afa..3388b7a 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1 @@ -include ':app', ':AnFQNumEditTextLib' +include ':app', ':FJEditTextCountLib'