CreditCardView Rich UI for Creating Credit Card in Android – Coding Shiksha

CreditCardView Rich UI for Creating Credit Card in Android – Coding Shiksha

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.

READ  Android Parallax RecyclerView Background - Coding Shiksha

 

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"
        />

 

READ  How to Integrate Emojis Keyboard in Android App

Or add this view programmatically.

 

CreditCardView creditCardView= new CreditCardView(this);

 

Or

 

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

 

 

 

 

 

 

Leave a Reply

Close Menu