Android Custom-Toast


Source link: https://github.com/shivam301296/Android-CustomToast

Android-CustomToast

Watch this video

Android-CustomToast is a powerful & easy to use Custom Toast library for Android. It runs on API level 14 and upwards. This library provides some predefined custom toast. Also you can coustomize the toast according to your need

⚡?A Single line of code can add a beautiful toast message in your app. ⚡?

Code Output
CT.success(this, "Success");
CT.success2(this, "Success");
CT.failed(this, "Failed");
CT.failed2(this, "Failed");
CT.loading(this, "Loading...");
CT.loading2(this, "Loading...");
CT.mute(this, "Silent mode");
CT.mute2(this, "Silent mode");
CT.normal(this, "Normal Toast");
CT.normal2(this, "Normal Toast");
Custom Toast
Custom Toast2

Setup

Gradle dependency (recommended)

  • Add the following to your project level build.gradle:
allprojects {
  repositories {

maven {
 url "https://jitpack.io" 
}
  
}
 
}
  • Add this to your app build.gradle:
dependencies {
  compile 'com.github.shivam301296:Android-CustomToast:1.0.1' 
}

Or use Maven

  • Add the following to the <repositories> section of your pom.xml:
<repository>

  <id>jitpack.io</id>

  <url>https://jitpack.io</url> </repository>
  • Add the following to the <dependencies> section of your pom.xml:
<dependency>

  <groupId>com.github.shivam301296</groupId>

 <artifactId>Android-CustomToast</artifactId>

 <version>1.0.0</version> </dependency>

Documentation

For a detailed documentation 📔, please have a look at the Wiki

For using predefined Toast

Refer to the above table (Code and Output)

For using Custom Toast

new CT.Builder(this, "Your message")

 .textCol(Color.BLACK)

 .backCol(Color.YELLOW)

 .borderCol(Color.BLACK)

 .borderWidth(20)

 .image(R.drawable.apple)

 .gravity(Gravity.CENTER)

 .radius(80,0,0,80)

 .show();
 
Method Use
textCol(int color) Set text color
backCol(int color Set background color
borderCol(int color) Set border color
borderWidth(int width Set border width
image(int imageResource) Set image in the toast
gravity(int gravityConstant) Set Toast gravity (Location)
radius(int topLeft, int topRight, int bottomLeft, int bottomRight), Set toast layout corner radius
shape(int shape) Set toast shape
duration(int duration) Set toast duration
show() Don't forget to call this method

Works on

  • Android 4.0.1 (Ice Cream Sandwich) and above.

Permissions

  • Does not require any special permission

Built With

Third party libraries

  • No external library dependency

Authors

Version

  • Version 1.0.1

License

Resources

Small simple android calendar implementation.

Android specific assertions and mocks for mockito for cleaner test code.

ToggleDrawable helps to create animated drawable transitions. The implementation relies on bezier curves instead of SVG graphics.

A lightweight Youtube frontend for Android.

Simple Custom Tabs A library made to use custom tabs without going crazy!

Android passcode view.

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