ToastLibrary


Source link: https://github.com/droidbyme/ToastLibrary

ToastLib

ToastLib is Library for Customize Toast.

Methods for implement

// ToastEnum.SHORT or ToastEnum.LONG
. duration(ToastEnum enum)

// Toast background color
. backgroundColor(int backgroundColor)

// Toast content textcolor
. textColor(int textColor)

// Toast content textsize (in SP), default is 20
. textSize(int size)

// Typeface for applying font to text
. typeface(Typeface ttf)

// true or false, for style bold to content
. isBold(boolean isBold)

// to apply fontAwesome icon, put fa-string in param
. icon(String faString)

// to add icon (drawable) in toast
. icon(int icon)

// to apply tint color on icon
. iconColor(int iconColor)

// icon size in dp, default is (24, 24)
. iconSize(int w, int h)

// corner radius for content, default is 4dp
. corner(int radius)

// margin from bottom/top (if Gravity is top then margin count from TOP and same for Bottom), default is 36
. margin(int margin)

// padding for inner content (default is 4)
. padding(int padding)

// space between icon and content, default is 8
. spacing(int spacing)

// toast UI stroke width and strokecolor
. stroke(int strokeWidth, int strokeColor)

// Gravity for placing toast ( NOTE: .margin apply only for TOP and BOTTOM Gravity)
. gravity(int Gravity)

// to show toast
. show()

Usage
For Custom Toast
new ToastLib.Builder(this, "Login Success")
   .duration(ToastEnum.SHORT)
   .backgroundColor(ContextCompat.getColor(this, R.color.green))
   .textColor(ContextCompat.getColor(this, R.color.black))
   .textSize(18)
   .typeface(Typeface.createFromAsset(getAssets(), "fonts/OpenSans-Regular.ttf"))
   .isBold(true)
   .icon(getString(R.string.fa_success))
   .icon(R.drawable.ic_check_black_24dp)
   .iconColor(ContextCompat.getColor(this, R.color.black))
   .iconSize(24, 24)
   .corner(8)
   .margin(56)
   .padding(36)
   .spacing(16)
   .stroke(2, ContextCompat.getColor(this, R.color.dark_green))
   .gravity(Gravity.BOTTOM)
   .show();


For Success Toast
ToastLib.success(this, "Success", Typeface.createFromAsset(getAssets(), "fonts/OpenSans-Regular.ttf"));


For Error Toast
ToastLib.error(this, "Ooops! Try Again..", Typeface.createFromAsset(getAssets(), "fonts/OpenSans-Regular.ttf"));


For Loading/Progress Toast
ToastLib.progress(this, "Loading..", Typeface.createFromAsset(getAssets(), "fonts/OpenSans-Regular.ttf"));


Resources

FingerprintAssistant is a library built to seamlessly integrate fingerprint api's into any android project. The custom callback structure implemented will provide callbacks for all possible scenarios encountered while integrating fingerprint api's. FingerprintAssistant primarily address the elimination of validations overhead and focus on business logic to make fingerprint auth as easy and as fast as possible.

InsLoadingAnimation is imitation of instagram and weibo avator animation of loading for Android.

A Kotlin Speech Recognizer that runs continuously and is triggered with an activation keyword.

Android Kotlin Starter is a starter project which implements MVP Pattern.

The MSAL library for Android gives your app the ability to begin using the Microsoft Cloud by supporting Microsoft Azure Active Directory and Microsoft Accounts in a converged experience using industry standard OAuth2 and OpenID Connect. The library also supports Azure AD B2C.

Android Architecture Components (AAC) is a new collection of libraries that contains the lifecycle-aware components. It can solve problems with configuration changes, supports data persistence, reduces boilerplate code, helps to prevent memory leaks and simplifies async data loading into your UI. I can’t say that it brings absolutely new approaches for solving these issues, but, finally, we have a formal, single and official direction.

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