EditCredit


Source link: https://github.com/Mostafa-MA-Saleh/EditCredit

EditCredit

Custom EditText for entering Credit Card numbers, this EditText will also display the image of the card number type being entered (after entering the second digit). And supports adding a separator (spaces or dashes) after every four digits.
This version (1.5.0) supports Visa, MasterCard and American Express cards, but more will be added soon.

Installation via Gradle:

Step 1. Add the JitPack repository to your root build.gradle at the end of repositories:

allprojects {

repositories {

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

}
 
}

Step 2. Add the dependency

dependencies {

...
compile 'com.github.Mostafa-MA-Saleh:EditCredit:1.5.0' 
}

Changelog

v 1.5.0

  • Added support for American Express.
  • Added the ability to disable cards.
  • Lowered the minSDK to 9.
  • Changed the demo app icon.

v 1.0.1

  • Changed the package name.

v 1.0

  • Initial Version

Summary

XML attributes

Name Description values
app:separator Sets the separator style no_separator
spaces
dashes
app:disabledCards Sets disabled cards
this can be multiple values seperated by "|"
(eg. app:disabledCards="visa|amex")
none
visa
mastercard
amex

Constants

type Name
int NO_SEPARATOR
int SPACES_SEPARATOR
int DASHES_SEPARATOR
int NONE
int VISA
int MASTERCARD
int AMEX

Public Methods

return Name/Description
String getTextWithoutSeparator()
Returns the card number without the separators.
boolean isCardValid()
Validates the entered card number.
void setSeparator(int separator)
Sets the separator style. Should be NO_SEPARATOR, SPACES_SEPARATOR or DASHES_SEPARATOR.
void setDisabledCards(int disabledCards)
Sets the disabled cards. Should be NONE, VISA, MASTERCARD or AMEX.
If you want to disable more than one type of card add "|" between each one.
(eg. setDisabledCards(EditCredit.VISA|EditCredit.AMEX); )

Usage

EditCredit can be used just like a normal EditText

<mostafa.ma.saleh.gmail.com.editcredit.EditCredit

android:layout_width="match_parent"

android:layout_height="wrap_content"

app:disabledCards="visa|amex"

app:separator="spaces" />

License

This is free and unencumbered software released into the public domain.  Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.  In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  For more information, please refer to <http://unlicense.org> 

Resources

Android widget to present calendar in a recycler view. The idea was to replicate calendar the way calendar is presented in the amazing Airbnb app.

Konveyor is a tiny library which intends to battle RecyclerView.Adapter Hell by introducing "Composition over inheritance" approach when dealing with RecyclerView adapters. While making your Adapter related logic testable by providing abstraction layer over its logic, it will make you forget all of the ViewType hassle all together.

Secure and efficient cryptography library for Android. (Auto fix SecureRandom bugs in API 18 and below.)

Features

  • AES-256 encryption algorithm
  • CBC/CTR mode of operations
  • Block padding with PKCS7 (only with CBC)
  • Computationally secure random salt (of cipher block size)
  • Password stretching with PBKDF2
  • Random IV generated on each encryption (16 bytes)
  • Supports MD5, SHA1, and SHA2 hash functions
  • Generate secure keys with SecureRandom or random.org
  • Asymmetric encryption with RSA
  • Auto handle large data by using hybrid asymmetric encryption
  • Supported RSA key sizes are 2048 bits and 4096 bits

This is an IntelliJ/Android Studio IDE plugin to detect the code with @Experimental and @Beta annotations and show a custom icon on the gutter when you use it.

Waterfall Toolbar is an Android version of Material Design's web component waterfall toolbar. Basically, what it does is dynamize an ordinary Toolbar, increasing and decreasing its shadow when an associated view is scrolled.

A smart switchable button, support multiple tabs.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes