disable auto hide
how can i disable auto hide by duration? i want to hide that after finish some process for example:
toast = SuperActivityToast.create(ActivityRegister.this,
new SuperToastStyle(),
SuperToastStyle.TYPE_PROGRESS_BAR, 0)
.setProgressBarColor(Color.WHITE)
.setHeight(142)
.setText(AndroidUtilities.getString(R.string.please_try_again, context))
.setFrame(SuperToastStyle.FRAME_LOLLIPOP)
.setColor(PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_INDIGO))
.setIconPosition(SuperToastStyle.ICONPOSITION_RIGHT)
.setAnimations(SuperToastStyle.ANIMATIONS_FADE);
toast.show();
//get data from server
toast.hide();
step1: add a flag of keeping show in Style Class: public static final int DURATION_MAX=-1; step2: set duration with the flag: toast.setDuration(Style.DURATION_MAX); step3: compare duration with the flag in displaySuperToast() of Toast Class , if matched do nothing before execute sendDelayedMessage():
private void displaySuperToast(SuperToast superToast) { ... if (duration == Style.DURATION_MAX) return; sendDelayedMessage(superToast, Messages.REMOVE_SUPERTOAST, superToast.getDuration() + AnimationUtils.SHOW_DURATION); ... }
@ga25 thanks, let me to test that 👍
Have you solved that?
@ga25 i'm so sorry sir, i dont have free time now. please let me to test that, thanks
.setIndeterminate(true)
and then
.dismiss()