aritraroy/Flashbar

One Bar at a time

Closed this issue · 2 comments

Is there a way to make sure i only have one bar showing at any given moment ?

You can simply use something like this in the meantime:

    if(scanCompleteFlashBar == null) {
        scanCompleteFlashBar = new Flashbar.Builder(ScanActivity.this)
                .gravity(Flashbar.Gravity.TOP)
                .title("Hello World!")
                .duration(3000)
                .message("You can show a modal overlay to give a dim effect in the entire screen.")
                .vibrateOn(Flashbar.Vibration.SHOW)
                .backgroundColorRes(R.color.colorPrimaryDark)
                .showOverlay()
                .build();
    }
    if(!scanCompleteFlashBar.isShown()){
        scanCompleteFlashBar.show();
    }

Thanks