Skip to content

Commit

Permalink
fix: remove extra space for error
Browse files Browse the repository at this point in the history
  • Loading branch information
julianraj committed Jan 3, 2017
1 parent bbaf8a8 commit 720a1ff
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 21 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0-alpha3'
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
6 changes: 4 additions & 2 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ general:
- /home/ubuntu/your-app-name/app/build/outputs/apk/

machine:
java:
version: openjdk8
environment:
ANDROID_HOME: /usr/local/android-sdk-linux

dependencies:
pre:
- echo y | android update sdk --no-ui --all --filter tool,extra-android-m2repository,extra-android-support,extra-google-google_play_services,extra-google-m2repository,android-23
- echo y | android update sdk --no-ui --all --filter build-tools-23.0.2
- echo y | android update sdk --no-ui --all --filter tool,extra-android-m2repository,extra-android-support,extra-google-google_play_services,extra-google-m2repository,android-25
- echo y | android update sdk --no-ui --all --filter build-tools-25.0.2

test:
override:
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Dec 28 10:00:20 PST 2015
#Tue Jan 03 09:15:01 NPT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
12 changes: 6 additions & 6 deletions sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
compileSdkVersion 25
buildToolsVersion "25.0.2"

defaultConfig {
applicationId "com.julianraj.validatedtextinputlayout"
minSdkVersion 9
targetSdkVersion 23
versionCode 1
targetSdkVersion 25
versionCode 2
versionName "1.0"
}
buildTypes {
Expand All @@ -24,6 +24,6 @@ dependencies {
testCompile 'junit:junit:4.12'

compile project(':validatedtextinputlayout')
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:design:23.2.0'
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:design:25.1.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ public void onClick(View v) {

private boolean validateFields() {
boolean flag = true;
if (!mUsernameInput.validate()) flag = false;
if (!mUsernameInput.validate()) {
flag = false;
}
if (!mPasswordInput.validate()) flag = false;
if (!mEmailInput.validate()) flag = false;
if (!mConfPasswordInput.validate()) flag = false;
Expand Down
16 changes: 16 additions & 0 deletions sample/src/main/res/drawable/background_input.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:top="4dp">
<shape android:shape="rectangle">
<padding
android:bottom="8dp"
android:left="8dp"
android:right="8dp"
android:top="16dp"/>
<solid android:color="@android:color/transparent"/>
<stroke
android:width="1dp"
android:color="@color/colorPrimary"/>
</shape>
</item>
</layer-list>
1 change: 1 addition & 0 deletions sample/src/main/res/layout/content_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<android.support.design.widget.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/background_input"
android:hint="Username"
android:singleLine="true"/>

Expand Down
12 changes: 6 additions & 6 deletions validatedtextinputlayout/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ext {
siteUrl = 'https://github.com/julianraj/ValidatedTextInputLayout'
gitUrl = 'https://github.com/julianraj/ValidatedTextInputLayout.git'

libraryVersion = '0.1.0'
libraryVersion = '0.1.1'

developerId = 'julianraj'
developerName = 'Julian Raj Manandhar'
Expand All @@ -26,14 +26,14 @@ ext {
}

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
compileSdkVersion 25
buildToolsVersion "25.0.2"

defaultConfig {
minSdkVersion 9
targetSdkVersion 23
targetSdkVersion 25
versionCode 1
versionName "0.1.0"
versionName "0.1.1"
}
buildTypes {
release {
Expand All @@ -47,7 +47,7 @@ dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
testCompile "org.mockito:mockito-core:1.10.19"
compile 'com.android.support:design:23.2.0'
compile 'com.android.support:design:25.1.0'
}

if (project.rootProject.file('local.properties').exists()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ public void clearValidators() {
*/
public void addValidator(BaseValidator pValidator) {
mValidators.add(pValidator);
setErrorEnabled(true);
}

/**
Expand Down Expand Up @@ -205,13 +204,15 @@ public boolean validate() {
String text = getValue();
for (IValidator validator : mValidators) {
if (!validator.isValid(text)) {
setErrorEnabled(true);
setError(validator.getErrorMessage());
status = false;
break;
} else {
setError(null);
//setError(null);
}
}
if(status) setErrorEnabled(false);
return status;
}

Expand Down

0 comments on commit 720a1ff

Please sign in to comment.