use of android.support.v4.app.FragmentActivity in project AndroidChromium by JackyAndroid.
the class BaseMediaRouteDialogManager method openDialog.
@Override
public void openDialog() {
if (mAndroidMediaRouter == null) {
mDelegate.onDialogCancelled();
return;
}
FragmentActivity currentActivity = (FragmentActivity) ApplicationStatus.getLastTrackedFocusedActivity();
if (currentActivity == null) {
mDelegate.onDialogCancelled();
return;
}
FragmentManager fm = currentActivity.getSupportFragmentManager();
if (fm == null) {
mDelegate.onDialogCancelled();
return;
}
mDialogFragment = openDialogInternal(fm);
if (mDialogFragment == null) {
mDelegate.onDialogCancelled();
return;
}
}
use of android.support.v4.app.FragmentActivity in project AndroidTraining by mixi-inc.
the class ActionBarImpl method selectTab.
@Override
public void selectTab(Tab tab) {
if (getNavigationMode() != NAVIGATION_MODE_TABS) {
mSavedTabPosition = tab != null ? tab.getPosition() : INVALID_POSITION;
return;
}
FragmentTransaction trans = null;
if (mActivity instanceof FragmentActivity) {
trans = ((FragmentActivity) mActivity).getSupportFragmentManager().beginTransaction().disallowAddToBackStack();
}
if (mSelectedTab == tab) {
if (mSelectedTab != null) {
mSelectedTab.getCallback().onTabReselected(mSelectedTab, trans);
mTabScrollView.animateToTab(tab.getPosition());
}
} else {
mTabScrollView.setTabSelected(tab != null ? tab.getPosition() : Tab.INVALID_POSITION);
if (mSelectedTab != null) {
mSelectedTab.getCallback().onTabUnselected(mSelectedTab, trans);
}
mSelectedTab = (TabImpl) tab;
if (mSelectedTab != null) {
mSelectedTab.getCallback().onTabSelected(mSelectedTab, trans);
}
}
if (trans != null && !trans.isEmpty()) {
trans.commit();
}
}
use of android.support.v4.app.FragmentActivity in project Douya by DreaminginCodeZH.
the class AccountUserResource method attachTo.
public static AccountUserResource attachTo(Account account, Fragment fragment, String tag, int requestCode) {
FragmentActivity activity = fragment.getActivity();
AccountUserResource instance = FragmentUtils.findByTag(activity, tag);
if (instance == null) {
instance = newInstance(account);
instance.targetAt(fragment, requestCode);
FragmentUtils.add(instance, activity, tag);
}
return instance;
}
use of android.support.v4.app.FragmentActivity in project Douya by DreaminginCodeZH.
the class AuthenticateRequest method attachTo.
public static AuthenticateRequest attachTo(Fragment fragment, String tag, int requestCode) {
FragmentActivity activity = fragment.getActivity();
AuthenticateRequest instance = FragmentUtils.findByTag(activity, tag);
if (instance == null) {
//noinspection deprecation
instance = new AuthenticateRequest();
instance.targetAt(fragment, requestCode);
FragmentUtils.add(instance, activity, tag);
}
return instance;
}
use of android.support.v4.app.FragmentActivity in project Douya by DreaminginCodeZH.
the class BroadcastRebroadcasterListResource method attachTo.
public static BroadcastRebroadcasterListResource attachTo(long broadcastId, Fragment fragment, String tag, int requestCode) {
FragmentActivity activity = fragment.getActivity();
BroadcastRebroadcasterListResource instance = FragmentUtils.findByTag(activity, tag);
if (instance == null) {
instance = newInstance(broadcastId);
instance.targetAt(fragment, requestCode);
FragmentUtils.add(instance, activity, tag);
}
return instance;
}
Aggregations