# ToastUtils **Repository Path**: mengpeng920223/ToastUtils ## Basic Information - **Project Name**: ToastUtils - **Description**: 是时候改变一下你的toast了,让你的toast变个样子吧。最简单炫酷的toast,一行代码实现多种提示,关键是简单,好看,你值得拥有。 - **Primary Language**: Android - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 144 - **Forks**: 19 - **Created**: 2018-03-08 - **Last Updated**: 2025-06-12 ## Categories & Tags **Categories**: android-modules **Tags**: None ## README ## 版本计划 - v1.0.0 添加各式各样的toast,并提供自定义toast - v1.1.0 给不同种类的toast加上合适的动画,并提供自定义动画 - v1.2.0 未完待续... ![](image/toast.gif) ### 使用方式 Step 1. Add the JitPack repository to your build file ``` allprojects { repositories { ... maven { url 'https://jitpack.io' } } } ``` Step 2. Add the dependency ``` dependencies { compile 'com.github.mengpeng920223:ToastUtils:v1.0.3' } ``` ### 初始化 ``` ToastUtils.getInstance().initToast(context); ``` ### 成功Toast ``` ToastUtils.onSuccessShowToast( "成功toast") ``` ### 失败Toast ``` ToastUtils.onErrorShowToast( "失败toast") ``` ### 默认Toast ``` ToastUtils.onDefaultShowToast( "默认toast") ``` ### 默认没有icon Toast ``` ToastUtils.onDefaultWithoutIconShowToast( "默认没有 icon toast") ``` ### Warn Toast ``` ToastUtils.onWarnShowToast( "Warn toast") ``` ### Info Toast ``` ToastUtils.onInfoShowToast( "Info toast") ``` ### 自定义Toast(建议看源码,然后选择构建方式) ``` ToastUtils.onShowToast(...) ```