├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── images └── patterned-edit-text-sample.png ├── patterned-edit-text ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ └── attrs.xml │ │ │ ├── drawable-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ └── drawable-xxhdpi │ │ │ │ └── ic_launcher.png │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── faradaj │ │ │ └── patternededittext │ │ │ ├── PetSavedState.java │ │ │ ├── utils │ │ │ ├── Span.java │ │ │ └── PatternUtils.java │ │ │ ├── PatternedEditText.java │ │ │ └── PatternedViewHelper.java │ └── test │ │ └── java │ │ └── com │ │ └── faradaj │ │ └── patternededittext │ │ └── utils │ │ └── PatternUtilsTest.java ├── proguard-rules.txt └── build.gradle ├── patterned-edit-text-sample ├── src │ └── main │ │ ├── res │ │ ├── drawable-hdpi │ │ │ └── ic_launcher.png │ │ ├── drawable-mdpi │ │ │ └── ic_launcher.png │ │ ├── drawable-xhdpi │ │ │ └── ic_launcher.png │ │ ├── drawable-xxhdpi │ │ │ └── ic_launcher.png │ │ ├── values │ │ │ ├── strings.xml │ │ │ ├── styles.xml │ │ │ └── dimens.xml │ │ ├── values-w820dp │ │ │ └── dimens.xml │ │ ├── menu │ │ │ └── main.xml │ │ └── layout │ │ │ └── activity_main.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── faradaj │ │ └── patternededittext │ │ └── app │ │ └── MainActivity.java ├── proguard-rules.txt └── build.gradle ├── .travis.yml ├── gradle.properties ├── gradlew.bat ├── README.md └── gradlew /settings.gradle: -------------------------------------------------------------------------------- 1 | include 'patterned-edit-text', 'patterned-edit-text-sample' 2 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/faradaj/PatternedEditText/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Gradle 2 | .gradle 3 | local.properties 4 | build 5 | 6 | # IntelliJ IDEA 7 | .idea 8 | *.iml 9 | 10 | .DS_Store -------------------------------------------------------------------------------- /images/patterned-edit-text-sample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/faradaj/PatternedEditText/HEAD/images/patterned-edit-text-sample.png -------------------------------------------------------------------------------- /patterned-edit-text/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | PatternedEditText 3 | 4 | -------------------------------------------------------------------------------- /patterned-edit-text/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/faradaj/PatternedEditText/HEAD/patterned-edit-text/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /patterned-edit-text/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/faradaj/PatternedEditText/HEAD/patterned-edit-text/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /patterned-edit-text/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/faradaj/PatternedEditText/HEAD/patterned-edit-text/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /patterned-edit-text/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/faradaj/PatternedEditText/HEAD/patterned-edit-text/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /patterned-edit-text-sample/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/faradaj/PatternedEditText/HEAD/patterned-edit-text-sample/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /patterned-edit-text-sample/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/faradaj/PatternedEditText/HEAD/patterned-edit-text-sample/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /patterned-edit-text-sample/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/faradaj/PatternedEditText/HEAD/patterned-edit-text-sample/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /patterned-edit-text-sample/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/faradaj/PatternedEditText/HEAD/patterned-edit-text-sample/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /patterned-edit-text/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /patterned-edit-text-sample/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | PatternedEditText Sample 5 | Settings 6 | 7 | 8 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: android 2 | 3 | android: 4 | components: 5 | - tools 6 | - build-tools-23.0.3 7 | - android-23 8 | - extra-android-support 9 | - extra-android-m2repository 10 | 11 | script: 12 | - ./gradlew build 13 | 14 | 15 | -------------------------------------------------------------------------------- /patterned-edit-text-sample/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /patterned-edit-text-sample/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Apr 10 15:27:10 PDT 2013 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-2.13-all.zip 7 | -------------------------------------------------------------------------------- /patterned-edit-text/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /patterned-edit-text-sample/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /patterned-edit-text-sample/src/main/res/menu/main.xml: -------------------------------------------------------------------------------- 1 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /patterned-edit-text/proguard-rules.txt: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/gokberk/Documents/AndroidInstallations/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the ProGuard 5 | # include property in project.properties. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} -------------------------------------------------------------------------------- /patterned-edit-text-sample/proguard-rules.txt: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/gokberk/Documents/AndroidInstallations/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the ProGuard 5 | # include property in project.properties. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} -------------------------------------------------------------------------------- /patterned-edit-text-sample/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /patterned-edit-text-sample/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | mavenCentral() 4 | } 5 | dependencies { 6 | classpath 'com.android.tools.build:gradle:2.1.0' 7 | } 8 | } 9 | apply plugin: 'com.android.application' 10 | 11 | repositories { 12 | mavenCentral() 13 | } 14 | 15 | android { 16 | compileSdkVersion 23 17 | buildToolsVersion "23.0.3" 18 | 19 | defaultConfig { 20 | minSdkVersion 8 21 | targetSdkVersion 23 22 | versionCode 1 23 | versionName "1.0" 24 | } 25 | buildTypes { 26 | release { 27 | minifyEnabled false 28 | proguardFiles 'proguard-rules.txt' 29 | } 30 | } 31 | } 32 | 33 | dependencies { 34 | compile fileTree(dir: 'libs', include: ['*.jar']) 35 | compile 'com.android.support:appcompat-v7:23.3.0' 36 | compile project(':patterned-edit-text') 37 | } -------------------------------------------------------------------------------- /patterned-edit-text/src/main/java/com/faradaj/patternededittext/PetSavedState.java: -------------------------------------------------------------------------------- 1 | package com.faradaj.patternededittext; 2 | 3 | import android.os.Parcel; 4 | import android.os.Parcelable; 5 | import android.view.View; 6 | 7 | public class PetSavedState extends View.BaseSavedState { 8 | 9 | private String mRawText; 10 | 11 | protected PetSavedState(Parcel source) { 12 | super(source); 13 | mRawText = source.readString(); 14 | } 15 | 16 | protected PetSavedState(Parcelable superState, String rawText) { 17 | super(superState); 18 | mRawText = rawText; 19 | } 20 | 21 | protected String getRealText() { 22 | return mRawText; 23 | } 24 | 25 | @Override 26 | public void writeToParcel(Parcel destination, int flags) { 27 | super.writeToParcel(destination, flags); 28 | destination.writeString(mRawText); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Settings specified in this file will override any Gradle settings 5 | # configured through the IDE. 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 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /patterned-edit-text/src/main/java/com/faradaj/patternededittext/utils/Span.java: -------------------------------------------------------------------------------- 1 | package com.faradaj.patternededittext.utils; 2 | 3 | public class Span { 4 | 5 | private int mOffset; 6 | private int mLength; 7 | 8 | public Span(int offset, int length) { 9 | this.mOffset = offset; 10 | this.mLength = length; 11 | } 12 | 13 | public int getOffset() { 14 | return mOffset; 15 | } 16 | 17 | public void setOffset(int offset) { 18 | this.mOffset = offset; 19 | } 20 | 21 | public int getLength() { 22 | return mLength; 23 | } 24 | 25 | public void setLength(int length) { 26 | this.mLength = length; 27 | } 28 | 29 | @Override 30 | public boolean equals(Object o) { 31 | if (this == o) return true; 32 | if (o == null || getClass() != o.getClass()) return false; 33 | 34 | Span span = (Span) o; 35 | 36 | if (mLength != span.mLength) return false; 37 | if (mOffset != span.mOffset) return false; 38 | 39 | return true; 40 | } 41 | 42 | @Override 43 | public int hashCode() { 44 | int result = mOffset; 45 | result = 31 * result + mLength; 46 | return result; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /patterned-edit-text-sample/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 19 |