代替Toast/SnackBar新方式,使用WindowManager 无需申请权限

Pudding

代替Toast/SnackBar新方式,使用WindowManager 无需申请权限

WIKI

中文说明

Usage

allprojects {
    repositories {
    ...
     maven { url 'https://jitpack.io' }
复制代码
implementation 'com.github.o0o0oo00.Pudding:pudding:v1.1.2'
复制代码

GIF可能要等会就顺畅了,一开始可能会比较迟钝 (●゚ω゚●)

常见的可配置的几种形式

Common configurable Pudding

Pudding.create(this) {
    setTitle("This is Title")
    setText("this is text")
}.show()
复制代码
Pudding.create(this) {
    setChocoBackgroundColor(resources.getColor(R.color.colorAccent))
    setTitleTypeface(Typeface.DEFAULT_BOLD)
}.show()
复制代码
Pudding.create(this) {
    setTitle("Choco Title")
    setText("this is text")
    setIcon(R.drawable.ic_event_available_black_24dp)
}.show()
复制代码
Pudding.create(this) {
    setTitle("Choco Title")
    setText("This is Text , it's very short and I don't like short \n This is Text , it's very short and I don't like short")
    onShow {
        Toast.makeText(this@MainActivity, "onShowListener", Toast.LENGTH_SHORT).show()
    }
    onDismiss {
        Toast.makeText(this@MainActivity, "onDismissListener", Toast.LENGTH_SHORT).show()
    }
}.show()
复制代码

配合FancyDialog可实现Pudding显示在Dialog的阴影之上

With FancyDialog, Pudding can be displayed above the shadow of Dialog.

每个Activity拥有各自的Pudding,互相之间不影响

Each Activity has its own Pudding, which does not affect each other.

*Imitate Alerter and ☆⌒(^-゜)v THX!! a lot

what's different

Use activity decorView we can show a view on top of Activity。but when dialog is showing , its black background will cover the view , that is not cool. so i create this repository to solve this problem , and I hope it's useful to you

Something new

  • Use DSL style to config Choco
  • Show Queue
  • Cover Dialog/PopWindow
  • Don't need to request permission
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值