• Android Toast的多功能封装——Android开发之路1


    Android封装实现各种功能的Toast

    GitHub地址:https://github.com/SibreiaDante/ToastUtils

    效果图:

    方法封装如下:

    showSingletonLong(String content):Toast文本,单例,长时间
    showSingletonShort(String content):Toast文本,单例,短时间
    showTextShort(String content):Toast文本,非单例,短时间
    showTextLong(String content):Toast文本,非单例,长时间
    showSingletonText(String content,int duration,int position ):Toast文本,自定义时长、位置
    showSingletonImageCenter(int resId, int duration): Toast一张图片,单例,居中
    showImageCenter(int resId,int duration):Toast一张图片,非单例,居中
    showSingletonImage(int resId, int duration, int position):Toast一张图片,单例,自定义位置
    showImage(int resId, int duration, int position):Toast一张图片,非单例,自定义位置
    showImage(Bitmap bitmap, int duration, int position):Toast一张图片,非单例,自定义位置
    showITSingleton(int resId, String content, int duration, int position):Toast图文,单例,自定义时长,自定义位置
    showIT(int resId, String content, int duration, int position):Toast图文,非单例,自定义时长,自定义位置
    showLines(List contents, int size):Toast 多行文本 非单例
    showSingletonLines(List contents, int size):Toast 多行文本 单例
    showLayout(View view, int duration, int position):Toast 自定义布局 非单例
    howSingletonLayout(View view, int duration, int position):Toast 自定义布局 单例
    showThread(String url):异步线程下载图片并Toast
    cancel():取消一个Toast,当弹出多个toast时,只会在最后一次toast被创建时取消
    cancelAll():取消创建的所有的toast
    使用说明:
    
    第一步,在你的工程中
        allprojects {
            repositories {
                ...
                maven { url 'https://jitpack.io' }
            }
        }
        dependencies {
                compile 'com.github.SibreiaDante:SiberiaDanteLib:v1.0.0'
        }
    
    第二部,在你的项目中初始化
    ToastApp.initToastUtils(getApplicationContext());
  • 相关阅读:
    九九乘法表
    数据汇总特殊处理-标题都在第N行
    Python库——Faker 安装及用法
    faker库 生成数据导入文件
    faker库的使用 faker是一个第三方Python包,为您生成你所需要的任何(假)数据。 安装:pip install faker
    生成随机数据:faker库
    运算符
    初识编码
    网页设计基础(二)
    网页设计基础
  • 原文地址:https://www.cnblogs.com/shen-hua/p/6106303.html
Copyright © 2020-2023  润新知