diff --git a/mobile/android/base/BrowserApp.java b/mobile/android/base/BrowserApp.java index 7d126bf9529f..27e3c72c3237 100644 --- a/mobile/android/base/BrowserApp.java +++ b/mobile/android/base/BrowserApp.java @@ -1686,9 +1686,6 @@ abstract public class BrowserApp extends GeckoApp public void onButtonClicked() { showBookmarkDialog(); } - - @Override - public void onToastHidden(ButtonToast.ReasonHidden reason) { } }); item.setIcon(R.drawable.ic_menu_bookmark_remove); } diff --git a/mobile/android/base/widget/ButtonToast.java b/mobile/android/base/widget/ButtonToast.java index 1b9df9fe8c79..6e7eaec2e9a9 100644 --- a/mobile/android/base/widget/ButtonToast.java +++ b/mobile/android/base/widget/ButtonToast.java @@ -47,12 +47,6 @@ public class ButtonToast { private final LinkedList mQueue = new LinkedList(); private Toast mCurrentToast; - public enum ReasonHidden { - CLICKED, - TIMEOUT, - STARTUP - } - // State objects private static class Toast { public final CharSequence buttonMessage; @@ -71,7 +65,6 @@ public class ButtonToast { public interface ToastListener { void onButtonClicked(); - void onToastHidden(ReasonHidden reason); } public ButtonToast(View view) { @@ -86,14 +79,14 @@ public class ButtonToast { if (t == null) return; - hide(false, ReasonHidden.CLICKED); + hide(false); if (t.listener != null) { t.listener.onButtonClicked(); } } }); - hide(true, ReasonHidden.STARTUP); + hide(true); } public void show(boolean immediate, CharSequence message, @@ -130,15 +123,12 @@ public class ButtonToast { mView.startAnimation(alpha); } - public void hide(boolean immediate, ReasonHidden reason) { - if (mButton.isPressed() && reason != ReasonHidden.CLICKED) { + public void hide(boolean immediate) { + if (mButton.isPressed()) { mHideHandler.postDelayed(mHideRunnable, TOAST_DURATION); return; } - if (mCurrentToast != null && mCurrentToast.listener != null) { - mCurrentToast.listener.onToastHidden(reason); - } mCurrentToast = null; mButton.setEnabled(false); mHideHandler.removeCallbacks(mHideRunnable); @@ -183,7 +173,7 @@ public class ButtonToast { private Runnable mHideRunnable = new Runnable() { @Override public void run() { - hide(false, ReasonHidden.TIMEOUT); + hide(false); } }; }