Skip to content

Commit

Permalink
Migrate to Android X (#39)
Browse files Browse the repository at this point in the history
* Delete Visa and Mastercard "drawable" image.
Update SDK and libraries

* Update support library to stable version.

* Update .gitignore and Android Gradle

* Update travis.yml

* Migrate to Android X
  • Loading branch information
javichaques authored and vinaygaba committed Nov 3, 2018
1 parent 46527ce commit 9c43418
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ android:
- tools

# The BuildTools version used by your project
- build-tools-28.0.2
- build-tools-28.0.3

# The SDK version used to compile your project
- android-28
Expand Down
20 changes: 4 additions & 16 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,29 +1,17 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'


// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
}

allprojects {
repositories {
google()
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
android.enableJetifier=true
android.useAndroidX=true
4 changes: 2 additions & 2 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'com.nineoldandroids:library:2.4.0'
implementation 'com.android.support:support-annotations:28.0.0'
implementation 'androidx.annotation:annotation:1.0.0'
}

//apply from: '../maven_push.gradle'
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@
import android.content.res.TypedArray;
import android.graphics.Color;
import android.graphics.Typeface;
import android.support.annotation.ColorInt;
import android.support.annotation.DrawableRes;
import android.support.annotation.IntDef;
import android.support.annotation.Nullable;
import android.text.Editable;
import android.text.InputFilter;
import android.text.TextUtils;
Expand All @@ -50,6 +46,11 @@
import java.lang.annotation.RetentionPolicy;
import java.util.regex.Pattern;

import androidx.annotation.ColorInt;
import androidx.annotation.DrawableRes;
import androidx.annotation.IntDef;
import androidx.annotation.Nullable;

import static com.vinaygaba.creditcardview.CardNumberFormat.ALL_DIGITS;
import static com.vinaygaba.creditcardview.CardNumberFormat.MASKED_ALL;
import static com.vinaygaba.creditcardview.CardNumberFormat.MASKED_ALL_BUT_LAST_FOUR;
Expand Down Expand Up @@ -135,15 +136,15 @@ private void init() {
final LayoutInflater inflater = LayoutInflater.from(mContext);
inflater.inflate(R.layout.creditcardview, this, true);

mCardNumberView = (EditText) findViewById(R.id.card_number);
mCardNameView = (EditText) findViewById(R.id.card_name);
mCardTypeView = (ImageView) findViewById(R.id.card_logo);
mBrandLogoView = (ImageView) findViewById(R.id.brand_logo);
mChipView = (ImageView) findViewById(R.id.chip);
mValidTill = (TextView) findViewById(R.id.valid_till);
mExpiryDateView = (EditText) findViewById(R.id.expiry_date);
mFlipBtn = (ImageButton) findViewById(R.id.flip_btn);
mCvvView = (EditText) findViewById(R.id.cvv_et);
mCardNumberView = findViewById(R.id.card_number);
mCardNameView = findViewById(R.id.card_name);
mCardTypeView = findViewById(R.id.card_logo);
mBrandLogoView = findViewById(R.id.brand_logo);
mChipView = findViewById(R.id.chip);
mValidTill = findViewById(R.id.valid_till);
mExpiryDateView = findViewById(R.id.expiry_date);
mFlipBtn = findViewById(R.id.flip_btn);
mCvvView = findViewById(R.id.cvv_et);
mStripe = findViewById(R.id.stripe);
mAuthorizedSig = findViewById(R.id.authorized_sig_tv);
mSignature = findViewById(R.id.signature);
Expand Down
2 changes: 1 addition & 1 deletion sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//implementation 'com.vinaygaba:creditcardview:1.0.2'
implementation project(':library')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'androidx.appcompat:appcompat:1.0.0'
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.vinaygaba.creditcardview.sample;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import androidx.appcompat.app.AppCompatActivity;


public class MainActivity extends AppCompatActivity {
Expand Down

0 comments on commit 9c43418

Please sign in to comment.