Comments (3)
为了快速满足你的需要,我发布了一个新版本v1.0.3。新暴露一个方法SmartToast.isShowing()。
如果按back键,使Toast消失(界面不退出),可在activity的onBackPressed()方法中如此设置:
@OverRide
public void onBackPressed() {
if (SmartToast.isShowing()){
SmartToast.dismiss();
}else {
super.onBackPressed();
}
}
如果按back键,界面退出,Toast也立即消失,可如此设置。
@OverRide
public void onBackPressed() {
SmartToast.dismiss();
super.onBackPressed();
}
如果每个界面都需要这样,可以在你的BaseActivity里设置就可以了。
v1.0.3只做了微小改动,为了能快速满足你的需求而推出。下一版,会考虑将其封装到SmartToast配置信息里,不需要使用者自己在activity中处理。
如果你觉得该库好用,记得star一下,并且帮我推荐给别人。谢谢你!
from smart-show.
谢谢,棒极了!已经 star和推荐。
from smart-show.
新版本已实现,可直接配置:
SmartToast.setting()
.dismissOnLeave(true);
from smart-show.
Related Issues (20)
- 3.0.3版本吐司内存泄漏 HOT 1
- 3.1.0版本不能依赖,版本号一提升就报错。 HOT 1
- SmartToast.classic()设置白色背景色无效 HOT 5
- 继承NormalDialog自定义布局
- 库自带的Dialog大小怎么调整呢? HOT 2
- NullPointerException HOT 2
- 使用自定义SmartShow异常IllegalArgumentException HOT 2
- 魅族pro6s toast闪退 HOT 2
- javax.annotation.processing.FilerException HOT 3
- 2s内间隔不停调用SmartToast.show() toast dismiss后会一直不显示 HOT 1
- NPE
- Could not download toast.aar (com.github.zhiqiang-series.smart-show:toast:3.1.9): No cached version available for offline mode HOT 1
- You need to use a Theme.AppCompat theme (or descendant) with this activity. HOT 1
- java.lang.NullPointerException: Attempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable.mutate()' on a null object reference #23 HOT 2
- SmartSnackBar show()方法 java无法调用,只有三参数结构show方法 HOT 1
- lateinit property application has not been initialized HOT 6
- java.lang.NullPointerException HOT 1
- 4.x之后 Java调用起来很不方便啊 HOT 2
- dialog: ensure 添加设置图标的功能
- Manifest merger failed : Attribute provider#androidx.startup.InitializationProvider@authorities HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smart-show.