Skip to content

Commit

Permalink
Merge pull request #65 from joejensen8/m.cardtype_name_conflict
Browse files Browse the repository at this point in the history
Renaming name in CardType to prevent Enum Kotlin override conflicts
  • Loading branch information
Joe Jensen authored Sep 6, 2018
2 parents 0c1a7e8 + cf8e4c9 commit b3044d2
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 16 deletions.
9 changes: 5 additions & 4 deletions CreditCardEntry/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
buildscript {
repositories {
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:3.1.4'
}
}
apply plugin: 'com.android.library'
Expand All @@ -13,12 +14,11 @@ repositories {
}

android {
compileSdkVersion 25
buildToolsVersion '25.0.3'
compileSdkVersion 28

defaultConfig {
minSdkVersion 9
targetSdkVersion 25
targetSdkVersion 28
}

sourceSets {
Expand All @@ -32,6 +32,7 @@ android {
manifest.srcFile 'AndroidManifest.xml'
}
}
buildToolsVersion '27.0.3'
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public enum CardType implements Serializable {
INVALID("Unknown", R.drawable.unknown_cc, null, null);

/** name for humans */
public final String name;
public final String friendlyName;

/** regex that matches the entire card number */
public final String fullRegex;
Expand All @@ -54,15 +54,15 @@ public enum CardType implements Serializable {
/** drawable for the back of the card */
public final int backResource = R.drawable.cc_back;

CardType(String name, @DrawableRes int imageResource, String fullRegex, String typeRegex) {
this.name = name;
CardType(String friendlyName, @DrawableRes int imageResource, String fullRegex, String typeRegex) {
this.friendlyName = friendlyName;
this.frontResource = imageResource;
this.fullRegex = fullRegex;
this.typeRegex = typeRegex;
}

@Override
public String toString() {
return name;
return friendlyName;
}
}
8 changes: 4 additions & 4 deletions CreditCardEntryDemo/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
buildscript {
repositories {
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:3.1.4'
}
}
apply plugin: 'com.android.application'
Expand All @@ -13,12 +14,11 @@ repositories {
}

android {
compileSdkVersion 25
buildToolsVersion '25.0.3'
compileSdkVersion 28

defaultConfig {
minSdkVersion 9
targetSdkVersion 25
targetSdkVersion 28
}

sourceSets {
Expand Down
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
buildscript {
repositories {
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:3.1.4'
}
}

repositories {
mavenCentral()
google()
}

task wrapper(type: Wrapper) {
gradleVersion = '2.3.3'
gradleVersion = '3.1.4'
}
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 16 05:52:41 WAT 2017
#Wed Sep 05 17:49:40 PDT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

0 comments on commit b3044d2

Please sign in to comment.