Search in sources :

Example 31 with FragmentActivity

use of android.support.v4.app.FragmentActivity in project Douya by DreaminginCodeZH.

the class BroadcastAndCommentListResource method attachTo.

public static BroadcastAndCommentListResource attachTo(long broadcastId, Broadcast broadcast, Fragment fragment, String tag, int requestCode) {
    FragmentActivity activity = fragment.getActivity();
    BroadcastAndCommentListResource instance = FragmentUtils.findByTag(activity, tag);
    if (instance == null) {
        instance = newInstance(broadcastId, broadcast);
        instance.targetAt(fragment, requestCode);
        FragmentUtils.add(instance, activity, tag);
    }
    return instance;
}
Also used : FragmentActivity(android.support.v4.app.FragmentActivity)

Example 32 with FragmentActivity

use of android.support.v4.app.FragmentActivity in project Douya by DreaminginCodeZH.

the class BroadcastCommentListResource method attachTo.

public static BroadcastCommentListResource attachTo(long broadcastId, Fragment fragment, String tag, int requestCode) {
    FragmentActivity activity = fragment.getActivity();
    BroadcastCommentListResource 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)

Example 33 with FragmentActivity

use of android.support.v4.app.FragmentActivity in project Douya by DreaminginCodeZH.

the class BroadcastLikerListResource method attachTo.

public static BroadcastLikerListResource attachTo(long broadcastId, Fragment fragment, String tag, int requestCode) {
    FragmentActivity activity = fragment.getActivity();
    BroadcastLikerListResource 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)

Example 34 with FragmentActivity

use of android.support.v4.app.FragmentActivity in project GSYVideoPlayer by CarGuo.

the class CommonUtil method hideSupportActionBar.

public static void hideSupportActionBar(Context context, boolean actionBar, boolean statusBar) {
    if (actionBar) {
        AppCompatActivity appCompatActivity = CommonUtil.getAppCompActivity(context);
        if (appCompatActivity != null) {
            ActionBar ab = appCompatActivity.getSupportActionBar();
            if (ab != null) {
                ab.setShowHideAnimationEnabled(false);
                ab.hide();
            }
        }
    }
    if (statusBar) {
        if (context instanceof FragmentActivity) {
            FragmentActivity fragmentActivity = (FragmentActivity) context;
            fragmentActivity.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        } else {
            CommonUtil.getAppCompActivity(context).getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        }
    }
}
Also used : FragmentActivity(android.support.v4.app.FragmentActivity) AppCompatActivity(android.support.v7.app.AppCompatActivity) ActionBar(android.support.v7.app.ActionBar)

Example 35 with FragmentActivity

use of android.support.v4.app.FragmentActivity in project GSYVideoPlayer by CarGuo.

the class CommonUtil method showSupportActionBar.

public static void showSupportActionBar(Context context, boolean actionBar, boolean statusBar) {
    if (actionBar) {
        AppCompatActivity appCompatActivity = CommonUtil.getAppCompActivity(context);
        if (appCompatActivity != null) {
            ActionBar ab = appCompatActivity.getSupportActionBar();
            if (ab != null) {
                ab.setShowHideAnimationEnabled(false);
                ab.show();
            }
        }
    }
    if (statusBar) {
        if (context instanceof FragmentActivity) {
            FragmentActivity fragmentActivity = (FragmentActivity) context;
            fragmentActivity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
        } else {
            CommonUtil.getAppCompActivity(context).getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
        }
    }
}
Also used : FragmentActivity(android.support.v4.app.FragmentActivity) AppCompatActivity(android.support.v7.app.AppCompatActivity) ActionBar(android.support.v7.app.ActionBar)

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