Giter VIP home page Giter VIP logo

Comments (3)

vincent-series avatar vincent-series commented on June 11, 2024

为了快速满足你的需要,我发布了一个新版本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.

weifengteng avatar weifengteng commented on June 11, 2024

谢谢,棒极了!已经 star和推荐。

from smart-show.

vincent-series avatar vincent-series commented on June 11, 2024

新版本已实现,可直接配置:
SmartToast.setting()
.dismissOnLeave(true);

from smart-show.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.