# ToastBar **Repository Path**: archermind-ti/toastbar ## Basic Information - **Project Name**: ToastBar - **Description**: 一个Material Design风格的顶部/底部的Toast Bar库 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2021-05-31 - **Last Updated**: 2021-08-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Toastbar ### 简介 一个Material 风格的顶部和底部弹出的Toast。 ### 功能 1. 顶部弹出的ToastBar 2. 底部弹出的ToastBar 3. 支持动画插值器设置 4. 支持背景颜色设置 5. 支持显示时长设置 6. 支持延时显示 ### 演示 ![sample/2016_11_25_10_11_11_10_37_12.gif](sample/2016_11_25_10_11_11_10_37_12.gif) ### 集成 在project的build.gradle中添加mavenCentral()的引用 ```groovy repositories { ... mavenCentral() ... } ``` 在entry的build.gradle中添加依赖 ```groovy dependencies { implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) implementation 'com.gitee.archermind-ti:toastbar:1.0.0' …… } ``` ### 使用说明 1. 有容器控件(`ComponentContainer`)时: ```java //显示在底部 BottomToast.make((ComponentContainer) findComponentById(ResourceTable.Id_parent), "HELLO WORLD!!!!", Toast.LENGTH_SHORT).show(); //显示在顶部 TopToast.make((ComponentContainer) findComponentById(ResourceTable.Id_parent), "HELLO WORLD!!!!", Toast.LENGTH_SHORT).show(); ``` 2. 没有容器控件(显示为悬浮窗)时: ```java //显示在底部 BottomToast.make(this, "HELLO WORLD!!!!", Toast.LENGTH_SHORT).show(); //显示在顶部 TopToast.make(this, "HELLO WORLD!!!!", Toast.LENGTH_SHORT).show(); ``` 3. 所有公开API ```java setAnimationInterpolator(Animator.TimelineCurve enterInterpolator, Animator.TimelineCurve exitInterpolator); setPosition(Position position); setText(String text); setTime(long time); show(long delay); show(); setBackground(int color); setTextColor(int color); ``` ### 编译说明 1. 将项目通过git clone 至本地 2. 使用DevEco Studio 打开该项目,然后等待Gradle 构建完成 3. 点击`Run`运行即可(真机运行可能需要配置签名) ### 版权和许可信息 * [Apache-2.0 License](License.md)