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

Latest commit

 

History

History
133 lines (108 loc) · 5.15 KB

README.eng.md

File metadata and controls

133 lines (108 loc) · 5.15 KB

Bank Card View


💳 Bank Card View is a simple and elegant card view with Flip animation.

License API repo size
forks stars

Including in your project

Gradle

Add below codes to your root build.gradle file (not your module build.gradle file).

allprojects {
  repositories {
    ...
    maven { url 'https://jitpack.io' }
  }
}

And add a dependency code to your module's build.gradle file.

dependencies {
    implementation 'com.github.iamageo:bank-card-view:1.0.0'
}

Basic Usage

Add in you layout file.

<com.iamageo.bank_card_view_android.BankCardView
    android:id="@+id/myBankCardView"
    app:isFrontCard="true"
    app:bankCardName="Geovani Amaral"
    app:bankCardNumber="0001 0002 0003 0004"
    app:bankCardCVV="123"
    app:bankCardValidate="02/27"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
/>

Call in your Activity:

class MainActivity : AppCompatActivity() {

    private lateinit var binding: ActivityMainBinding

    private val animation: FlipBankCardViewAnimation? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        binding = ActivityMainBinding.inflate(layoutInflater)
        super.onCreate(savedInstanceState)
        setContentView(binding.root)
        
        //attributes
        binding.myBankCardView.bankCardName = "Jhon Doe"
        binding.myBankCardView.bankCardNumber = "0001 0002 0003 0004"
        binding.myBankCardView.bankCardValidate = "02/27"
        binding.myBankCardView.bankCardCVV = "007"
        binding.myBankCardView.bankCardLogo = BankCardView.CardLogo.MASTERCARD
        binding.myBankCardView.bankCardBackground = BankCardView.CardBackground.RIPE_MALINKA
        
        //click event
        binding.myBankCardView.setOnClickListener {
            startAnimation(animation, binding.myBankCardView, binding.myBankCardView, 180)
        }
    }
}

Bank Card View Attributes

Attributes Type Description
bankCardName String Name of card.
bankCardNumber String Number of card.
bankCardValidate String Validate date.
bankCardCVV String Security code of card.
bankCardLogo Int (drawable) Logo of card.
bankCardBackground Int (drawable) Background for card view.

Types of logo

Source of logos

VISA CIELO MASTERCARD AMERICAN_EXPRESS

For use card logo, call:

binding.myBankCardView.bankCardLogo = BankCardView.CardLogo.MASTERCARD

Types of background

Source of backgrounds

RIPE_MALINKA AMY_CHRISP TRUE_SUNSET PURPLE_DIVISION

For use backgrounds, call:

binding.myBankCardView.bankCardBackground = BankCardView.CardBackground.RIPE_MALINKA

License

    Copyright 2022 Geovani Amaral

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.