├── app ├── .gitignore ├── .DS_Store ├── release │ ├── app-release.apk │ └── output.json ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ ├── 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 │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── layout │ │ │ │ └── activity_main.xml │ │ │ └── drawable │ │ │ │ └── ic_launcher_background.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── lkx │ │ │ └── codeeditview │ │ │ └── MainActivity.java │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── lkx │ │ │ └── codeeditview │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── lkx │ │ └── codeeditview │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro ├── build.gradle └── app.iml ├── library ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ └── attrs.xml │ │ │ ├── drawable │ │ │ │ ├── shape_popupwindow_normal_bg.xml │ │ │ │ ├── shape_popupwindow_pressed_bg.xml │ │ │ │ ├── shape_border_normal.xml │ │ │ │ ├── shape_border_pressed.xml │ │ │ │ └── select_popupwindow_bg.xml │ │ │ └── layout │ │ │ │ └── popupwindow_view.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── lkx │ │ │ └── library │ │ │ ├── DensityUtil.java │ │ │ └── CodeEditView.java │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── lkx │ │ │ └── library │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── lkx │ │ └── library │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro ├── build.gradle └── library.iml ├── .gradle ├── buildOutputCleanup │ ├── built.bin │ ├── cache.properties.lock │ └── cache.properties └── 4.1 │ ├── fileChanges │ └── last-build.bin │ ├── fileHashes │ ├── fileHashes.bin │ ├── fileHashes.lock │ └── resourceHashesCache.bin │ ├── javaCompile │ ├── taskJars.bin │ ├── jarAnalysis.bin │ ├── javaCompile.lock │ ├── taskHistory.bin │ └── classAnalysis.bin │ ├── fileContent │ └── fileContent.lock │ └── taskHistory │ ├── taskHistory.bin │ ├── taskHistory.lock │ └── fileSnapshots.bin ├── settings.gradle ├── .DS_Store ├── scan.png ├── QQ20180906-101622.gif ├── .idea ├── caches │ ├── gradle_models.ser │ └── build_file_checksums.ser ├── encodings.xml ├── vcs.xml ├── libraries │ ├── net_sf_kxml_kxml2_2_3_0_jar.xml │ ├── com_google_code_findbugs_jsr305_2_0_1_jar.xml │ ├── Gradle__com_google_code_findbugs_jsr305_2_0_1_jar.xml │ ├── com_android_support_constraint_constraint_layout_solver_1_1_3_jar.xml │ ├── Gradle__com_android_support_constraint_constraint_layout_solver_1_1_3_jar.xml │ ├── junit_junit_4_12_jar.xml │ ├── Gradle__junit_junit_4_12_jar.xml │ ├── com_android_support_constraint_constraint_layout_1_1_3.xml │ ├── Gradle__net_sf_kxml_kxml2_2_3_0_jar.xml │ ├── javax_inject_javax_inject_1_jar.xml │ ├── android_arch_core_common_1_0_0_jar.xml │ ├── com_squareup_javawriter_2_1_1_jar.xml │ ├── Gradle__com_android_support_constraint_constraint_layout_1_1_3_aar.xml │ ├── Gradle__javax_inject_javax_inject_1_jar.xml │ ├── org_hamcrest_hamcrest_core_1_3_jar.xml │ ├── Gradle__android_arch_core_common_1_0_0_jar.xml │ ├── Gradle__com_squareup_javawriter_2_1_1_jar.xml │ ├── android_arch_lifecycle_common_1_0_0_jar.xml │ ├── Gradle__org_hamcrest_hamcrest_core_1_3_jar.xml │ ├── org_hamcrest_hamcrest_library_1_3_jar.xml │ ├── Gradle__android_arch_lifecycle_common_1_0_0_jar.xml │ ├── Gradle__org_hamcrest_hamcrest_library_1_3_jar.xml │ ├── org_hamcrest_hamcrest_integration_1_3_jar.xml │ ├── Gradle__org_hamcrest_hamcrest_integration_1_3_jar.xml │ ├── com_android_support_support_annotations_26_1_0_jar.xml │ ├── com_android_support_support_annotations_27_1_1_jar.xml │ ├── Gradle__com_android_support_support_annotations_26_1_0_jar.xml │ ├── Gradle__com_android_support_support_annotations_27_1_1_jar.xml │ ├── android_arch_lifecycle_runtime_1_0_0.xml │ ├── com_android_support_test_runner_1_0_2.xml │ ├── com_android_support_test_monitor_1_0_2.xml │ ├── com_android_support_support_v4_26_1_0.xml │ ├── Gradle__android_arch_lifecycle_runtime_1_0_0_aar.xml │ ├── Gradle__com_android_support_test_runner_1_0_2_aar.xml │ ├── com_android_support_appcompat_v7_26_1_0.xml │ ├── Gradle__com_android_support_test_monitor_1_0_2_aar.xml │ ├── Gradle__com_android_support_support_v4_26_1_0_aar.xml │ ├── com_android_support_support_compat_26_1_0.xml │ ├── com_android_support_support_core_ui_26_1_0.xml │ ├── Gradle__com_android_support_appcompat_v7_26_1_0_aar.xml │ ├── com_android_support_support_fragment_26_1_0.xml │ ├── Gradle__com_android_support_support_compat_26_1_0_aar.xml │ ├── com_android_support_support_core_utils_26_1_0.xml │ ├── Gradle__com_android_support_support_core_ui_26_1_0_aar.xml │ ├── com_android_support_test_espresso_espresso_core_3_0_2.xml │ ├── Gradle__com_android_support_support_fragment_26_1_0_aar.xml │ ├── com_android_support_support_media_compat_26_1_0.xml │ ├── Gradle__com_android_support_support_core_utils_26_1_0_aar.xml │ ├── Gradle__com_android_support_test_espresso_espresso_core_3_0_2_aar.xml │ ├── com_android_support_support_vector_drawable_26_1_0.xml │ ├── Gradle__com_android_support_support_media_compat_26_1_0_aar.xml │ ├── com_android_support_animated_vector_drawable_26_1_0.xml │ ├── Gradle__com_android_support_support_vector_drawable_26_1_0_aar.xml │ ├── Gradle__com_android_support_animated_vector_drawable_26_1_0_aar.xml │ ├── com_android_support_test_espresso_espresso_idling_resource_3_0_2.xml │ └── Gradle__com_android_support_test_espresso_espresso_idling_resource_3_0_2_aar.xml ├── modules.xml ├── runConfigurations.xml ├── gradle.xml ├── misc.xml └── workspace.xml ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── 04BB29B5-929C-474F-BDCB-0147F475FB94.png ├── local.properties ├── gradle.properties ├── CodeEditView.iml ├── README.md ├── gradlew.bat └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /library/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /.gradle/buildOutputCleanup/built.bin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gradle/4.1/fileChanges/last-build.bin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':library' 2 | -------------------------------------------------------------------------------- /.gradle/buildOutputCleanup/cache.properties.lock: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvkaixuan/CodeEditView/HEAD/.DS_Store -------------------------------------------------------------------------------- /scan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvkaixuan/CodeEditView/HEAD/scan.png -------------------------------------------------------------------------------- /app/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvkaixuan/CodeEditView/HEAD/app/.DS_Store -------------------------------------------------------------------------------- /.gradle/buildOutputCleanup/cache.properties: -------------------------------------------------------------------------------- 1 | #Thu Sep 06 09:15:17 CST 2018 2 | gradle.version=4.1 3 | -------------------------------------------------------------------------------- /QQ20180906-101622.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvkaixuan/CodeEditView/HEAD/QQ20180906-101622.gif -------------------------------------------------------------------------------- /app/release/app-release.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvkaixuan/CodeEditView/HEAD/app/release/app-release.apk -------------------------------------------------------------------------------- /.idea/caches/gradle_models.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvkaixuan/CodeEditView/HEAD/.idea/caches/gradle_models.ser -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | CodeEditView 3 | 4 | -------------------------------------------------------------------------------- /library/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Library 3 | 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvkaixuan/CodeEditView/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /.gradle/4.1/fileHashes/fileHashes.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvkaixuan/CodeEditView/HEAD/.gradle/4.1/fileHashes/fileHashes.bin -------------------------------------------------------------------------------- /.gradle/4.1/javaCompile/taskJars.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvkaixuan/CodeEditView/HEAD/.gradle/4.1/javaCompile/taskJars.bin -------------------------------------------------------------------------------- /.idea/caches/build_file_checksums.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvkaixuan/CodeEditView/HEAD/.idea/caches/build_file_checksums.ser -------------------------------------------------------------------------------- /.gradle/4.1/fileContent/fileContent.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvkaixuan/CodeEditView/HEAD/.gradle/4.1/fileContent/fileContent.lock -------------------------------------------------------------------------------- /.gradle/4.1/fileHashes/fileHashes.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvkaixuan/CodeEditView/HEAD/.gradle/4.1/fileHashes/fileHashes.lock -------------------------------------------------------------------------------- /.gradle/4.1/javaCompile/jarAnalysis.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvkaixuan/CodeEditView/HEAD/.gradle/4.1/javaCompile/jarAnalysis.bin -------------------------------------------------------------------------------- /.gradle/4.1/javaCompile/javaCompile.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvkaixuan/CodeEditView/HEAD/.gradle/4.1/javaCompile/javaCompile.lock -------------------------------------------------------------------------------- /.gradle/4.1/javaCompile/taskHistory.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvkaixuan/CodeEditView/HEAD/.gradle/4.1/javaCompile/taskHistory.bin -------------------------------------------------------------------------------- /.gradle/4.1/taskHistory/taskHistory.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvkaixuan/CodeEditView/HEAD/.gradle/4.1/taskHistory/taskHistory.bin -------------------------------------------------------------------------------- /.gradle/4.1/taskHistory/taskHistory.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvkaixuan/CodeEditView/HEAD/.gradle/4.1/taskHistory/taskHistory.lock -------------------------------------------------------------------------------- /04BB29B5-929C-474F-BDCB-0147F475FB94.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvkaixuan/CodeEditView/HEAD/04BB29B5-929C-474F-BDCB-0147F475FB94.png -------------------------------------------------------------------------------- /.gradle/4.1/javaCompile/classAnalysis.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvkaixuan/CodeEditView/HEAD/.gradle/4.1/javaCompile/classAnalysis.bin -------------------------------------------------------------------------------- /.gradle/4.1/taskHistory/fileSnapshots.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvkaixuan/CodeEditView/HEAD/.gradle/4.1/taskHistory/fileSnapshots.bin -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvkaixuan/CodeEditView/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvkaixuan/CodeEditView/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvkaixuan/CodeEditView/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /.gradle/4.1/fileHashes/resourceHashesCache.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvkaixuan/CodeEditView/HEAD/.gradle/4.1/fileHashes/resourceHashesCache.bin -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvkaixuan/CodeEditView/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvkaixuan/CodeEditView/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /library/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvkaixuan/CodeEditView/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/lvkaixuan/CodeEditView/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/lvkaixuan/CodeEditView/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/lvkaixuan/CodeEditView/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvkaixuan/CodeEditView/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/release/output.json: -------------------------------------------------------------------------------- 1 | [{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":1},"path":"app-release.apk","properties":{"packageId":"com.lkx.codeeditview","split":"","minSdkVersion":"15"}}] -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ffffff 4 | #ffffff 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/shape_popupwindow_normal_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/shape_popupwindow_pressed_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Sep 05 15:51:27 CST 2018 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.1-all.zip 7 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/shape_border_normal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/shape_border_pressed.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /.idea/libraries/net_sf_kxml_kxml2_2_3_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/select_popupwindow_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /.idea/libraries/com_google_code_findbugs_jsr305_2_0_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_google_code_findbugs_jsr305_2_0_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /library/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /local.properties: -------------------------------------------------------------------------------- 1 | ## This file is automatically generated by Android Studio. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file should *NOT* be checked into Version Control Systems, 5 | # as it contains information specific to your local configuration. 6 | # 7 | # Location of the SDK. This is only used by Gradle. 8 | # For customization when using a Version Control System, please read the 9 | # header note. 10 | sdk.dir=/Users/lvkaixuan/Library/Android/sdk -------------------------------------------------------------------------------- /library/src/test/java/com/lkx/library/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.lkx.library; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /.idea/libraries/com_android_support_constraint_constraint_layout_solver_1_1_3_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/test/java/com/lkx/codeeditview/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.lkx.codeeditview; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_android_support_constraint_constraint_layout_solver_1_1_3_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/junit_junit_4_12_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__junit_junit_4_12_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/com_android_support_constraint_constraint_layout_1_1_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__net_sf_kxml_kxml2_2_3_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/javax_inject_javax_inject_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/android_arch_core_common_1_0_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/com_squareup_javawriter_2_1_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_android_support_constraint_constraint_layout_1_1_3_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__javax_inject_javax_inject_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/org_hamcrest_hamcrest_core_1_3_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__android_arch_core_common_1_0_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_squareup_javawriter_2_1_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/android_arch_lifecycle_common_1_0_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/org_hamcrest_hamcrest_library_1_3_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__android_arch_lifecycle_common_1_0_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_hamcrest_hamcrest_library_1_3_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /library/src/main/res/layout/popupwindow_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 14 | -------------------------------------------------------------------------------- /.idea/libraries/org_hamcrest_hamcrest_integration_1_3_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__org_hamcrest_hamcrest_integration_1_3_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/com_android_support_support_annotations_26_1_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/com_android_support_support_annotations_27_1_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_android_support_support_annotations_26_1_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_android_support_support_annotations_27_1_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/android_arch_lifecycle_runtime_1_0_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/com_android_support_test_runner_1_0_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/com_android_support_test_monitor_1_0_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/com_android_support_support_v4_26_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__android_arch_lifecycle_runtime_1_0_0_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_android_support_test_runner_1_0_2_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/libraries/com_android_support_appcompat_v7_26_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_android_support_test_monitor_1_0_2_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_android_support_support_v4_26_1_0_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/com_android_support_support_compat_26_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/com_android_support_support_core_ui_26_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_android_support_appcompat_v7_26_1_0_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/com_android_support_support_fragment_26_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_android_support_support_compat_26_1_0_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/com_android_support_support_core_utils_26_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_android_support_support_core_ui_26_1_0_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/com_android_support_test_espresso_espresso_core_3_0_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_android_support_support_fragment_26_1_0_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/com_android_support_support_media_compat_26_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_android_support_support_core_utils_26_1_0_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_android_support_test_espresso_espresso_core_3_0_2_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/com_android_support_support_vector_drawable_26_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_android_support_support_media_compat_26_1_0_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/com_android_support_animated_vector_drawable_26_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_android_support_support_vector_drawable_26_1_0_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_android_support_animated_vector_drawable_26_1_0_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /library/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 | -------------------------------------------------------------------------------- /.idea/libraries/com_android_support_test_espresso_espresso_idling_resource_3_0_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/Gradle__com_android_support_test_espresso_espresso_idling_resource_3_0_2_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /library/src/androidTest/java/com/lkx/library/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.lkx.library; 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() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.lkx.library.test", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/lkx/codeeditview/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.lkx.codeeditview; 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() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.lkx.codeeditview", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /CodeEditView.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /library/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 26 5 | 6 | 7 | 8 | defaultConfig { 9 | minSdkVersion 15 10 | targetSdkVersion 26 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.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:26.1.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/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 26 5 | defaultConfig { 6 | applicationId "com.lkx.codeeditview" 7 | minSdkVersion 15 8 | targetSdkVersion 26 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.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | configurations.all { 20 | resolutionStrategy.force 'com.android.support:support-annotations:27.1.1' 21 | } 22 | } 23 | 24 | dependencies { 25 | implementation fileTree(include: ['*.jar'], dir: 'libs') 26 | implementation 'com.android.support:appcompat-v7:26.1.0' 27 | implementation 'com.android.support.constraint:constraint-layout:1.1.3' 28 | testImplementation 'junit:junit:4.12' 29 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 30 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 31 | implementation project(':library') 32 | } 33 | -------------------------------------------------------------------------------- /library/src/main/java/com/lkx/library/DensityUtil.java: -------------------------------------------------------------------------------- 1 | package com.lkx.library; 2 | 3 | import android.content.Context; 4 | 5 | public class DensityUtil { 6 | /** 7 | * 根据手机的分辨率从 dp 的单位 转成为 px(像素) 8 | */ 9 | public static int dip2px(Context context, float dpValue) { 10 | final float scale = context.getResources().getDisplayMetrics().density; 11 | return (int) (dpValue * scale + 0.5f); 12 | } 13 | 14 | /** 15 | * 根据手机的分辨率从 px(像素) 的单位 转成为 dp 16 | */ 17 | public static int px2dip(Context context, float pxValue) { 18 | final float scale = context.getResources().getDisplayMetrics().density; 19 | return (int) (pxValue / scale + 0.5f); 20 | } 21 | 22 | /** 23 | * 将px值转换为sp值,保证文字大小不变 24 | */ 25 | public static int px2sp(Context context, float pxValue) { 26 | final float fontScale = context.getResources().getDisplayMetrics().scaledDensity; 27 | return (int) (pxValue / fontScale + 0.5f); 28 | } 29 | 30 | /** 31 | * 将sp值转换为px值,保证文字大小不变 32 | */ 33 | public static int sp2px(Context context, float spValue) { 34 | final float fontScale = context.getResources().getDisplayMetrics().scaledDensity; 35 | return (int) (spValue * fontScale + 0.5f); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/java/com/lkx/codeeditview/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.lkx.codeeditview; 2 | 3 | import android.os.Build; 4 | import android.support.v7.app.AppCompatActivity; 5 | import android.os.Bundle; 6 | import android.view.View; 7 | import android.widget.TextView; 8 | import android.widget.Toast; 9 | import com.lkx.library.CodeEditView; 10 | 11 | /** 12 | * 作者: LKX 13 | * 时间: 2018/9/3 14 | * 描述: 验证码输入框 https://github.com/lvkaixuan 15 | */ 16 | public class MainActivity extends AppCompatActivity { 17 | 18 | private CodeEditView mCodeEditView; 19 | 20 | @Override 21 | protected void onCreate(Bundle savedInstanceState) { 22 | super.onCreate(savedInstanceState); 23 | setContentView(R.layout.activity_main); 24 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { 25 | getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN|View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); 26 | } 27 | 28 | init(); 29 | } 30 | 31 | private void init() { 32 | mCodeEditView = (CodeEditView) findViewById(R.id.codeEditView); 33 | final TextView textView = (TextView) findViewById(R.id.textview); 34 | mCodeEditView.setOnInputEndCallBack(new CodeEditView.inputEndListener() { 35 | @Override 36 | public void input(String text) { //输入完毕后的回调 37 | Toast.makeText(MainActivity.this, text, Toast.LENGTH_SHORT).show(); 38 | } 39 | 40 | @Override 41 | public void afterTextChanged(String text) { //输入内容改变后的回调 42 | textView.setText(text); 43 | } 44 | }); 45 | } 46 | 47 | //清除文字 48 | public void clear(View view) { 49 | mCodeEditView.clearText(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 26 | 27 | 28 | 29 | 30 | 31 | 33 | 34 | 35 | 36 | 37 | 1.8 38 | 39 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CodeEditView 2 | ### 通知 3 | 近期有用户反馈在Android9.0的手机上无法输入的问题,原因是因为项目中的targetSdkVersion版本设置过高,目前已知(targetSdkVersion 28)会出现该问题,目前已修复,新版本: 4 | 5 | ``` 6 | dependencies { 7 | implementation 'com.github.lvkaixuan:CodeEditView:v1.0.5' 8 | } 9 | ``` 10 | ### 效果图 11 | 12 | 13 | ### 动态图 14 | ![Alt text](https://github.com/lvkaixuan/CodeEditView/blob/master/QQ20180906-101622.gif) 15 | 16 | ### 使用方法 17 | ``` 18 | allprojects { 19 | repositories { 20 | ... 21 | maven { url 'https://jitpack.io' } 22 | } 23 | } 24 | ``` 25 | 26 | ``` 27 | dependencies { 28 | implementation 'com.github.lvkaixuan:CodeEditView:v1.0.5' 29 | } 30 | ``` 31 | 布局中使用控件 32 | ``` 33 | 38 | ``` 39 | 代码中的回调监听 40 | ``` 41 | codeEditView.setOnInputEndCallBack(new CodeEditView.inputEndListener() { 42 | @Override 43 | public void input(String text) { //输入完毕后的回调 44 | Toast.makeText(MainActivity.this, text, Toast.LENGTH_SHORT).show(); 45 | } 46 | 47 | @Override 48 | public void afterTextChanged(String text) { //输入内容改变后的回调 49 | textView.setText(text); 50 | } 51 | }); 52 | 53 | //清除输入框内容 (v1.0.2新增方法) 54 | codeEditView.clearText(); 55 | //新增长按粘贴 (v1.0.3新增) 56 | ``` 57 | ### 高级使用(自定义) 58 | ``` 59 | 69 | ``` 70 | ``` 71 | app:textColor=@color/colorAccent //字体颜色 72 | app:borderNum=4 //输入框个数 73 | app:borderMargin=20 //输入框间距 74 | app:borderSize=48 //输入框大小 75 | app:textSize=10 //字体大小" 76 | ``` 77 | 78 | ### Demo地址 79 | 80 | - CSDN博客地址: https://blog.csdn.net/lvkaixuan/article/details/82455366 81 | - 扫码下载apk 82 | ![这里写图片描述](https://github.com/lvkaixuan/CodeEditView/blob/master/scan.png) 83 | - 如果项目对你有帮助,欢迎star 84 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 16 | 21 | 27 |