Skip to content

Commit 5397fd0

Browse files
author
Julian Raj manandhar
authored
Merge pull request #5 from julianraj/fix-extra-error-space
fix: remove extra space for error
2 parents bbaf8a8 + 720a1ff commit 5397fd0

File tree

9 files changed

+43
-21
lines changed

9 files changed

+43
-21
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:2.1.0-alpha3'
8+
classpath 'com.android.tools.build:gradle:2.2.3'
99
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.3'
10-
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
10+
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
1111
// NOTE: Do not place your application dependencies here; they belong
1212
// in the individual module build.gradle files
1313
}

circle.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ general:
33
- /home/ubuntu/your-app-name/app/build/outputs/apk/
44

55
machine:
6+
java:
7+
version: openjdk8
68
environment:
79
ANDROID_HOME: /usr/local/android-sdk-linux
810

911
dependencies:
1012
pre:
11-
- 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
12-
- echo y | android update sdk --no-ui --all --filter build-tools-23.0.2
13+
- 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
14+
- echo y | android update sdk --no-ui --all --filter build-tools-25.0.2
1315

1416
test:
1517
override:
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Mon Dec 28 10:00:20 PST 2015
1+
#Tue Jan 03 09:15:01 NPT 2017
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip

sample/build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 23
5-
buildToolsVersion "23.0.2"
4+
compileSdkVersion 25
5+
buildToolsVersion "25.0.2"
66

77
defaultConfig {
88
applicationId "com.julianraj.validatedtextinputlayout"
99
minSdkVersion 9
10-
targetSdkVersion 23
11-
versionCode 1
10+
targetSdkVersion 25
11+
versionCode 2
1212
versionName "1.0"
1313
}
1414
buildTypes {
@@ -24,6 +24,6 @@ dependencies {
2424
testCompile 'junit:junit:4.12'
2525

2626
compile project(':validatedtextinputlayout')
27-
compile 'com.android.support:appcompat-v7:23.2.0'
28-
compile 'com.android.support:design:23.2.0'
27+
compile 'com.android.support:appcompat-v7:25.1.0'
28+
compile 'com.android.support:design:25.1.0'
2929
}

sample/src/main/java/com/julianraj/validatedtextinputlayoutsample/MainActivity.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ public void onClick(View v) {
6666

6767
private boolean validateFields() {
6868
boolean flag = true;
69-
if (!mUsernameInput.validate()) flag = false;
69+
if (!mUsernameInput.validate()) {
70+
flag = false;
71+
}
7072
if (!mPasswordInput.validate()) flag = false;
7173
if (!mEmailInput.validate()) flag = false;
7274
if (!mConfPasswordInput.validate()) flag = false;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
3+
<item android:top="4dp">
4+
<shape android:shape="rectangle">
5+
<padding
6+
android:bottom="8dp"
7+
android:left="8dp"
8+
android:right="8dp"
9+
android:top="16dp"/>
10+
<solid android:color="@android:color/transparent"/>
11+
<stroke
12+
android:width="1dp"
13+
android:color="@color/colorPrimary"/>
14+
</shape>
15+
</item>
16+
</layer-list>

sample/src/main/res/layout/content_main.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
<android.support.design.widget.TextInputEditText
3030
android:layout_width="match_parent"
3131
android:layout_height="wrap_content"
32+
android:background="@drawable/background_input"
3233
android:hint="Username"
3334
android:singleLine="true"/>
3435

validatedtextinputlayout/build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ext {
1414
siteUrl = 'https://github.com/julianraj/ValidatedTextInputLayout'
1515
gitUrl = 'https://github.com/julianraj/ValidatedTextInputLayout.git'
1616

17-
libraryVersion = '0.1.0'
17+
libraryVersion = '0.1.1'
1818

1919
developerId = 'julianraj'
2020
developerName = 'Julian Raj Manandhar'
@@ -26,14 +26,14 @@ ext {
2626
}
2727

2828
android {
29-
compileSdkVersion 23
30-
buildToolsVersion "23.0.2"
29+
compileSdkVersion 25
30+
buildToolsVersion "25.0.2"
3131

3232
defaultConfig {
3333
minSdkVersion 9
34-
targetSdkVersion 23
34+
targetSdkVersion 25
3535
versionCode 1
36-
versionName "0.1.0"
36+
versionName "0.1.1"
3737
}
3838
buildTypes {
3939
release {
@@ -47,7 +47,7 @@ dependencies {
4747
compile fileTree(dir: 'libs', include: ['*.jar'])
4848
testCompile 'junit:junit:4.12'
4949
testCompile "org.mockito:mockito-core:1.10.19"
50-
compile 'com.android.support:design:23.2.0'
50+
compile 'com.android.support:design:25.1.0'
5151
}
5252

5353
if (project.rootProject.file('local.properties').exists()) {

validatedtextinputlayout/src/main/java/com/julianraj/validatedtextinputlayout/ValidatedTextInputLayout.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ public void clearValidators() {
157157
*/
158158
public void addValidator(BaseValidator pValidator) {
159159
mValidators.add(pValidator);
160-
setErrorEnabled(true);
161160
}
162161

163162
/**
@@ -205,13 +204,15 @@ public boolean validate() {
205204
String text = getValue();
206205
for (IValidator validator : mValidators) {
207206
if (!validator.isValid(text)) {
207+
setErrorEnabled(true);
208208
setError(validator.getErrorMessage());
209209
status = false;
210210
break;
211211
} else {
212-
setError(null);
212+
//setError(null);
213213
}
214214
}
215+
if(status) setErrorEnabled(false);
215216
return status;
216217
}
217218

0 commit comments

Comments
 (0)