use of org.mozilla.focus.fragment.BrowserFragment in project Rocket by mozilla-tw.
the class CaptureRunnable method promptScreenshotResult.
private void promptScreenshotResult(final boolean success) {
Context context = refContext.get();
if (context == null) {
return;
}
if (refBrowserFragment != null) {
final BrowserFragment browserFragment = refBrowserFragment.get();
if (browserFragment != null && browserFragment.getCaptureStateListener() != null) {
browserFragment.getCaptureStateListener().onPromptScreenshotResult();
}
if (browserFragment != null && success && !Settings.getInstance(context).getEventHistory().contains(Settings.Event.ShowMyShotOnBoardingDialog)) {
// My shot on boarding didn't show before and capture is succeed, skip to show toast
browserFragment.checkToShowMyShotOnBoarding();
return;
}
}
Toast.makeText(context, success ? R.string.screenshot_saved : R.string.screenshot_failed, Toast.LENGTH_SHORT).show();
}
Aggregations