Skip to content

Commit

Permalink
Merge pull request #38 from BlacKCaT27/next
Browse files Browse the repository at this point in the history
Next
  • Loading branch information
BlacKCaT27 authored Sep 24, 2017
2 parents 8892c13 + e2a1def commit 36c8344
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 19 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha6'
classpath 'com.android.tools.build:gradle:3.0.0-beta6'
}

}
6 changes: 3 additions & 3 deletions currencyedittext/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ apply plugin: 'com.android.library'

android {
compileSdkVersion 26
buildToolsVersion '26.0.0'
buildToolsVersion '26.0.1'

defaultConfig {
minSdkVersion 9
targetSdkVersion 26
versionCode 201
versionName "2.0.0"
versionCode 202
versionName "2.0.2"
}

buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ public Locale getDefaultLocale(){
}

/**
* Pass in a value to have it formatted using the same rules used during data entry.
* @param val A string which represents the value you'd like formatted. It is expected that this string will be in the same format returned by the getRawValue() method (i.e. a series of digits, such as
* Pass in a value to have it formatted using the same rules used during data entry.
* @param val A string which represents the value you'd like formatted. It is expected that this string will be in the same format returned by the getRawValue() method (i.e. a series of digits, such as
* "1000" to represent "$10.00"). Note that formatCurrency will take in ANY string, and will first strip any non-digit characters before working on that string. If the result of that processing
* reveals an empty string, or a string whose number of digits is greater than the max number of digits, an exception will be thrown.
* @return A deviceLocale-formatted string of the passed in value, represented as currentCurrency.
Expand All @@ -202,7 +202,6 @@ public String formatCurrency(long rawVal){
return format(rawVal);
}


/*
PRIVATE HELPER METHODS
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ public void afterTextChanged(Editable editable) {


//Move the cursor to the end of the numerical value to enter the next number in a right-to-left fashion, like you would on a calculator.
editText.setSelection(cursorPosition);
if (currentText.length() >= cursorPosition){
editText.setSelection(cursorPosition);
}

}
else{
Expand Down
13 changes: 6 additions & 7 deletions currencyedittexttester/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha6'
classpath 'com.android.tools.build:gradle:3.0.0-beta6'
}
}

android {
compileSdkVersion 26
buildToolsVersion '26.0.0'
buildToolsVersion '26.0.1'

defaultConfig {
applicationId "com.blackcat.currencyedittexttester"
Expand Down Expand Up @@ -50,16 +50,15 @@ dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(':currencyedittext')

compile 'com.jakewharton:butterknife:8.7.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.7.0'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'

testImplementation 'junit:junit:4.12'
testImplementation "org.mockito:mockito-core:2.8.47"
testImplementation 'org.hamcrest:hamcrest-library:1.3'
testImplementation "org.assertj:assertj-core:2.6.0"
testImplementation "org.robolectric:robolectric:3.3.2"
testImplementation 'com.android.support.test.espresso:espresso-core:2.2.2'
testImplementation 'com.github.mikinw:DataSet:-SNAPSHOT'

testAnnotationProcessor 'com.jakewharton:butterknife-compiler:8.7.0'
testImplementation 'com.github.mikinw:DataSet:4006389335'
testAnnotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
}
Original file line number Diff line number Diff line change
Expand Up @@ -262,4 +262,12 @@ public void ConfigureViewForLocaleDefaultsToUSDForInvalidLocaleAndDefaultLocaleT

assertThat(decimalDigits, is(equalTo(2)));
}

@Test
public void CanEnterSeparatorCharactersWhenViewWasResetTest(){
currencyEditText.setText("");
currencyEditText.setText(".");

assertThat(currencyEditText.getText().toString(), is(equalTo("")));
}
}
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION_NAME=2.0.1-SNAPSHOT
VERSION_CODE=201
VERSION_NAME=2.0.2-SNAPSHOT
VERSION_CODE=202
GROUP=com.github.blackcat27

POM_DESCRIPTION=A custom Android view for handling Currency input
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 @@
#Sun Jul 02 21:20:35 EDT 2017
#Sat Sep 23 21:25:11 EDT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-milestone-1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip

0 comments on commit 36c8344

Please sign in to comment.