CreditCardView Rich UI for Creating Credit Card in Android

CreditCardView Rich UI for Creating Credit Card in Android

Welcome Folks I am back with another blog post.In this post we will be learning about a library which is CreditCardView which is a Credit Card Library for Android Applications.It is very useful when you want to integrate Payment Gateways such as Stripe and Visa Cards in your android application. In this post we will be seeing examples of this library. Let’s get started.

See also  Material Time Picker Dialog in Android

 

Screenshots

Setup

In dependencies

 

dependencies {
    compile : 'com.vinaygaba:creditcardview:1.0.4'

}

 

Use the Library

 

XML Code

 

<com.vinaygaba.creditcardview.CreditCardView
        android:id="@+id/card1"
        android:layout_width="fill_parent"
        android:layout_height="225dp"
        android:background="@drawable/cardbackground_world"
        android:layout_marginBottom="16dp"
        android:layout_marginTop="16dp"
        app:cardNumber="5500005555555559"
        app:cardName="Vinay Gaba"
        app:cardNumberTextColor="#cccccc"
        app:cardNumberFormat="masked_all_but_last_four"
        app:cardNameTextColor="#cccccc"
        app:type="auto"
        app:brandLogo="@drawable/brandlogo"
        app:putChip="true"
        app:expiryDate = "02/22"
        app:expiryDateTextColor="#cccccc"
        app:isEditable="true"
        app:validTillTextColor="#cccccc"
        app:hintTextColor = "#cccccc"
        />

 

See also  Build a Android Image Slider With Arrows and Indicators Animation in App Using Java Using Custom Library Full Project For Beginners

Or add this view programmatically.

 

CreditCardView creditCardView= new CreditCardView(this);

 

Or

 

CreditCardView creditCardView= (CreditCardView)findViewById(R.id.ID_OF_CARD);

 

 

 

 

 

 

Leave a Reply