同步操作将从 Gitee 极速下载/PuddingAlert 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
代替Toast/SnackBar新方式,使用WindowManager 无需申请权限
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
implementation 'com.github.o0o0oo00:Pudding:1.2.1'
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
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
Choco
两种addView方式
内部显示队列(考虑可以使用kotlin通道来实现)
左右/上下滑动消失动画
Pudding cover dialog
Pudding使用的是WindowManager 难道不需要申请权限吗?
WindowManager.LayoutParams.TYPE_APPLICATION_SUB_PANEL
的层级低于系统级层级TYPE_SYSTEM_ALERT
也就是在2000之下,是不需要申请权限的。不同的Activity对应的WindowManager是否相同
不同的WindowManager为什么可以移除对方的View
如何去维护一个Pudding队列
Map<string,pudding>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。