Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2 from tipsi/short_card_number_position
Browse files Browse the repository at this point in the history
Short card number position
  • Loading branch information
paynd authored Nov 7, 2017
2 parents 3eb0f16 + 3b9358f commit fa4ad49
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 14 deletions.
12 changes: 8 additions & 4 deletions CreditCardEntry/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'

android {
compileSdkVersion 24
buildToolsVersion "24.0.3"
compileSdkVersion 25
buildToolsVersion '25.0.3'

defaultConfig {
minSdkVersion 16
targetSdkVersion 24
targetSdkVersion 25
versionCode 1
versionName "1.0.0"
}
Expand Down Expand Up @@ -36,5 +36,9 @@ artifacts {
}

dependencies {
compile 'com.android.support:support-v4:24.2.1'
compile 'com.android.support:support-compat:25.3.1'
compile 'com.android.support:support-core-utils:25.3.1'
compile 'com.android.support:support-core-ui:25.3.1'
compile 'com.android.support:support-media-compat:25.3.1'
compile 'com.android.support:support-fragment:25.3.1'
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void init(AttributeSet attrs) {
addTextChangedListener(this);
setOnKeyListener(this);
setOnClickListener(this);
setPadding(20, 0, 20, 0);
setPadding(50, 0, 50, 0);

setStyle(attrs);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public CreditCardEntry(Context context, boolean includeExp, boolean includeSecur
} else {
textColor = null;
}
textSize = typedArray.getDimensionPixelSize(R.styleable.CreditCardForm_text_size, 19);
textSize = typedArray.getDimensionPixelSize(R.styleable.CreditCardForm_text_size, 26);
typedArray.recycle();

WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
Expand Down Expand Up @@ -217,6 +217,15 @@ public void onClick(View v) {
});
}

@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
super.onLayout(changed, l, t, r, b);
int shiftPadding = r - l - cardImage.getWidth() - expDateText.getWidth() - securityCodeText.getWidth() - 20;
if (shiftPadding > 0) {
textFourDigits.setPadding(0, 0, shiftPadding, 0);
}
}

@Override
public void onCardTypeChange(CardType type) {
cardImage.setImageResource(type.frontResource);
Expand Down
12 changes: 8 additions & 4 deletions CreditCardEntryDemo/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 24
buildToolsVersion "24.0.3"
compileSdkVersion 25
buildToolsVersion '25.0.3'

defaultConfig {
minSdkVersion 16
targetSdkVersion 24
targetSdkVersion 25
applicationId "com.devmarvel.creditcardentry"
versionCode 1
versionName "1.0.0"
Expand All @@ -27,5 +27,9 @@ android {

dependencies {
compile project(':CreditCardEntry')
compile 'com.android.support:support-v4:24.2.1'
compile 'com.android.support:support-compat:25.3.1'
compile 'com.android.support:support-core-utils:25.3.1'
compile 'com.android.support:support-core-ui:25.3.1'
compile 'com.android.support:support-media-compat:25.3.1'
compile 'com.android.support:support-fragment:25.3.1'
}
3 changes: 2 additions & 1 deletion CreditCardEntryDemo/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@

<com.devmarvel.creditcardentry.library.CreditCardForm
android:id="@+id/form_no_zip"
android:layout_width="wrap_content"
short_card_number_position

This comment has been minimized.

Copy link
@agrosner

agrosner Nov 15, 2017

this looks like a mistake floating here.

android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="15dp"
app:card_number_hint="XXXX XXXX XXXX XXXX"
Expand Down
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
buildscript {
repositories {
mavenLocal()
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
}
}
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 @@
#Wed Apr 29 14:57:37 PDT 2015
#Sun Nov 05 20:58:12 EET 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip

0 comments on commit fa4ad49

Please sign in to comment.