use of org.mozilla.focus.activity.MainActivity in project focus-android by mozilla-mobile.
the class SessionsSheetFragment method animateAndDismiss.
/* package */
Animator animateAndDismiss() {
final Animator animator = playAnimation(true);
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
final MainActivity activity = (MainActivity) getActivity();
if (activity != null) {
activity.getSupportFragmentManager().beginTransaction().remove(SessionsSheetFragment.this).commit();
}
}
});
return animator;
}
use of org.mozilla.focus.activity.MainActivity in project Rocket by mozilla-tw.
the class SessionLoadedIdlingResource method isIdleNow.
@Override
public boolean isIdleNow() {
final MainActivity mainActivity = activityWeakReference.get();
if (mainActivity == null || mainActivity.getVisibleBrowserFragment() == null) {
return false;
}
// TODO: Maybe use an interface to wait for the state is better than depending on the activity directly
final boolean isLoading = mainActivity.getVisibleBrowserFragment().isLoading();
if (isLoading) {
return false;
} else {
invokeCallback();
return true;
}
}
Aggregations