Zurück zum Ranking

GrenderG/Toasty

Java

The usual Toast, but with steroids 💪

toastui-widgetandroid
Sterne-Wachstum
Sterne
6.6k
Forks
801
Wochenwachstum
Issues
49
2k4k6k
Jan. 2017März 2020Mai 2023Juli 2026
ArtefakteMavengit clone https://github.com/GrenderG/Toasty.git
README

ko-fi

Toasty

API Android Arsenal

The usual Toast, but with steroids.

Prerequisites

Add this in your root build.gradle file (not your module build.gradle file):

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

Dependency

Add this to your module's build.gradle file (make sure the version matches the JitPack badge above):

dependencies {
	...
	implementation 'com.github.GrenderG:Toasty:1.5.2'
}

Configuration

This step is optional, but if you want you can configure some Toasty parameters. Place this anywhere in your app:

Toasty.Config.getInstance()
    .tintIcon(boolean tintIcon) // optional (apply textColor also to the icon)
    .setToastTypeface(@NonNull Typeface typeface) // optional
    .setTextSize(int sizeInSp) // optional
    .allowQueue(boolean allowQueue) // optional (prevents several Toastys from queuing)
    .setGravity(int gravity, int xOffset, int yOffset) // optional (set toast gravity, offsets are optional)
    .supportDarkTheme(boolean supportDarkTheme) // optional (whether to support dark theme or not)
    .setRTL(boolean isRTL) // optional (icon is on the right)
    .apply(); // required

You can reset the configuration by using reset() method:

Toasty.Config.reset();

Usage

Each method always returns a Toast object, so you can customize the Toast much more. DON'T FORGET THE show() METHOD!

To display an error Toast:

Toasty.error(yourContext, "This is an error toast.", Toast.LENGTH_SHORT, true).show();

To display a success Toast:

Toasty.success(yourContext, "Success!", Toast.LENGTH_SHORT, true).show();

To display an info Toast:

Toasty.info(yourContext, "Here is some info for you.", Toast.LENGTH_SHORT, true).show();

To display a warning Toast:

Toasty.warning(yourContext, "Beware of the dog.", Toast.LENGTH_SHORT, true).show();

To display the usual Toast:

Toasty.normal(yourContext, "Normal toast w/o icon").show();

To display the usual Toast with icon:

Toasty.normal(yourContext, "Normal toast w/ icon", yourIconDrawable).show();

You can also create your custom Toasts with the custom() method:

Toasty.custom(yourContext, "I'm a custom Toast", yourIconDrawable, tintColor, duration, withIcon, 
shouldTint).show();

Extra

You can pass formatted text to Toasty!

There are variants of each method, feel free to explore this library.

Screenshots

Please click the image below to enlarge.

Third Party Bindings

React Native

You may now use this library with React Native via this module.

Apps using Toasty

Want to be here? Open an issue or make a pull request.

ColorHub - Color Palette
Daily – News flipped around
Oz! Comic Reader
Impactor Unroot
Fusemounter
BlueWords
Photo Map - Photo and Video Gallery
Maki for Facebook & Twitter
ModPE IDE
Rocket Notes
OpenHub for GitHub
openHAB
Saarang
Kad ce mi bus - red voznje
Hide Files
LogViewer for openHAB
Ähnliche Repositories
Blankj/AndroidUtilCode

:fire: Android developers should collect the following utils(updating).

JavaMavenApache License 2.0androidapp
blankj.com/2016/07/31/android-utils-code/
33.7k10.6k
sweetalert2/sweetalert2

✨ A beautiful, responsive, highly customizable and accessible (WAI-ARIA) replacement for JavaScript's popup boxes. Zero dependencies. 🇺🇦🇪🇺

JavaScriptnpmMIT Licensesweetalertalert
sweetalert2.github.io
18.1k1.6k
fkhadra/react-toastify

React notification made easy 🚀 !

TypeScriptnpmMIT Licensetoastreact
fkhadra.github.io/react-toastify/introduction
13.4k742
emilkowalski/sonner

An opinionated toast component for React.

TypeScriptnpmMIT Licensereacttoast
sonner.emilkowal.ski
12.7k450
Tamsiree/RxTool

Android开发人员不得不收集的工具类集合 | 支付宝支付 | 微信支付(统一下单) | 微信分享 | Zip4j压缩(支持分卷压缩与加密) | 一键集成UCrop选择圆形头像 | 一键集成二维码和条形码的扫描与生成 | 常用Dialog | WebView的封装可播放视频 | 仿斗鱼滑动验证码 | Toast封装 | 震动 | GPS | Location定位 | 图片缩放 | Exif 图片添加地理位置信息(经纬度) | 蛛网等级 | 颜色选择器 | ArcGis | VTPK | 编译运行一下说不定会找到惊喜

KotlinApache License 2.0dialogprogressbar
12.3k2.8k
getActivity/AndroidProject

Android 技术中台,但愿人长久,搬砖不再有

JavaMavenApache License 2.0androidmvp
6.9k1.4k
jaredreich/notie

🔔 a clean and simple notification, input, and selection suite for javascript, with no dependencies

JavaScriptnpmMIT Licensejavascriptnotifications
6.3k368
calimarkus/JDStatusBarNotification

Highly customizable & feature rich notifications. Interactive dismiss. Custom Views. SwiftUI. Tap-to-hold. Progress. Written in Swift, compatible for ObjC!

SwiftMIT Licensebannerios
calimarkus.github.io/JDStatusBarNotification/documentation/jdstatusbarnotification
4.3k564
iamhosseindhv/notistack

Highly customizable notification snackbars (toasts) that can be stacked on top of each other

TypeScriptnpmOtherreactjsmaterial-ui
notistack.com
4.1k292
exyte/PopupView

Toasts and popups library written with SwiftUI

SwiftMIT Licenseswiftuiswiftui-framework
4.1k314
getActivity/Toaster

Android 吐司框架,专治 Toast 各种疑难杂症

JavaMavenApache License 2.0toasttoastutils
3.5k429
Maronato/vue-toastification

Vue notifications made easy!

TypeScriptnpmMIT Licensevuenotifications
vue-toastification.maronato.dev
3.4k159