Search in sources :

Example 76 with FragmentActivity

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;
    }
}
Also used : FragmentManager(android.support.v4.app.FragmentManager) FragmentActivity(android.support.v4.app.FragmentActivity)

Example 77 with FragmentActivity

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();
    }
}
Also used : FragmentActivity(android.support.v4.app.FragmentActivity) FragmentTransaction(android.support.v4.app.FragmentTransaction)

Example 78 with FragmentActivity

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;
}
Also used : FragmentActivity(android.support.v4.app.FragmentActivity)

Example 79 with FragmentActivity

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;
}
Also used : FragmentActivity(android.support.v4.app.FragmentActivity)

Example 80 with FragmentActivity

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;
}
Also used : FragmentActivity(android.support.v4.app.FragmentActivity)

Aggregations

FragmentActivity (android.support.v4.app.FragmentActivity)84 FragmentTransaction (android.app.FragmentTransaction)16 FragmentManager (android.support.v4.app.FragmentManager)16 FragmentTransaction (android.support.v4.app.FragmentTransaction)16 Fragment (android.support.v4.app.Fragment)11 Intent (android.content.Intent)6 Bundle (android.os.Bundle)5 View (android.view.View)4 DialogFragment (android.support.v4.app.DialogFragment)3 MediaControllerCompat (android.support.v4.media.session.MediaControllerCompat)3 SearchView (android.widget.SearchView)3 TextView (android.widget.TextView)3 Fragment (android.app.Fragment)2 ActionBar (android.support.v7.app.ActionBar)2 AppCompatActivity (android.support.v7.app.AppCompatActivity)2 MediaRouteDialogFactory (android.support.v7.app.MediaRouteDialogFactory)2 RecyclerView (android.support.v7.widget.RecyclerView)2 InjectView (butterknife.InjectView)2 RequestManager (com.bumptech.glide.RequestManager)2 FacebookException (com.facebook.FacebookException)2