Search in sources :

Example 6 with FragmentActivity

use of android.support.v4.app.FragmentActivity in project material-dialogs by afollestad.

the class FileChooserDialog method show.

public void show(FragmentActivity context) {
    final String tag = getBuilder().tag;
    Fragment frag = context.getSupportFragmentManager().findFragmentByTag(tag);
    if (frag != null) {
        ((DialogFragment) frag).dismiss();
        context.getSupportFragmentManager().beginTransaction().remove(frag).commit();
    }
    show(context.getSupportFragmentManager(), tag);
}
Also used : DialogFragment(android.support.v4.app.DialogFragment) DialogFragment(android.support.v4.app.DialogFragment) Fragment(android.support.v4.app.Fragment)

Example 7 with FragmentActivity

use of android.support.v4.app.FragmentActivity in project Klyph by jonathangerbaud.

the class Groups method onCreateOptionsMenu.

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    if (getAdapter() != null && getAdapter().getCount() > 0) {
        // Create the search view
        SearchView searchView = new SearchView(((FragmentActivity) getActivity()).getActionBar().getThemedContext());
        searchView.setQueryHint("Search for groups");
        searchView.setOnQueryTextListener(this);
        menu.add("Search").setIcon(AttrUtil.getResourceId(getActivity(), R.attr.searchIcon)).setActionView(searchView).setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW);
    }
    super.onCreateOptionsMenu(menu, inflater);
}
Also used : FragmentActivity(android.support.v4.app.FragmentActivity) SearchView(android.widget.SearchView)

Example 8 with FragmentActivity

use of android.support.v4.app.FragmentActivity in project Klyph by jonathangerbaud.

the class PageTimeline method doLikeAction.

private void doLikeAction() {
    final Page page = (Page) getElement();
    if (page.getIs_fan() == false) {
        page.setIs_fan(true);
        ((FragmentActivity) getActivity()).invalidateOptionsMenu();
        new AsyncRequest(Query.POST_LIKE, page.getPage_id(), "", new AsyncRequest.Callback() {

            @Override
            public void onComplete(Response response) {
                Log.i("onComplete", "" + response.getError());
                onLikeRequestComplete(response);
            }
        }).execute();
    } else {
        page.setIs_fan(false);
        ((FragmentActivity) getActivity()).invalidateOptionsMenu();
        new AsyncRequest(Query.POST_UNLIKE, page.getPage_id(), "", new AsyncRequest.Callback() {

            @Override
            public void onComplete(Response response) {
                Log.i("onComplete", "" + response.getError());
                onUnlikeRequestComplete(response);
            }
        }).execute();
    }
}
Also used : Response(com.abewy.android.apps.klyph.core.request.Response) FragmentActivity(android.support.v4.app.FragmentActivity) AsyncRequest(com.abewy.android.apps.klyph.request.AsyncRequest) Page(com.abewy.android.apps.klyph.core.fql.Page)

Example 9 with FragmentActivity

use of android.support.v4.app.FragmentActivity in project superCleanMaster by joyoyao.

the class DialogUtil method showAlertDialog.

/**
	 * 显示一个一般的对话框(标题,String内容,确认,取消).
	 * @param context
	 * @param title 对话框标题内容
	 * @param message 对话框提示内容
	 * @param onClickListener 点击确认按钮的事件监听
	 */
public static AlertDialogFragment showAlertDialog(Context context, String title, String message, AlertDialogFragment.DialogOnClickListener onClickListener) {
    FragmentActivity activity = (FragmentActivity) context;
    AlertDialogFragment newFragment = AlertDialogFragment.newInstance(0, title, message, null, onClickListener);
    FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
    // 指定一个系统转场动画   
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    newFragment.show(ft, mDialogTag);
    return newFragment;
}
Also used : FragmentActivity(android.support.v4.app.FragmentActivity) FragmentTransaction(android.app.FragmentTransaction)

Example 10 with FragmentActivity

use of android.support.v4.app.FragmentActivity in project superCleanMaster by joyoyao.

the class DialogUtil method showAlertDialog.

/**
	 * 显示一个一般的对话框(View内容).
	 * @param view 对话框标题内容
	 */
public static AlertDialogFragment showAlertDialog(View view) {
    FragmentActivity activity = (FragmentActivity) view.getContext();
    AlertDialogFragment newFragment = AlertDialogFragment.newInstance(0, null, null, view, null);
    FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
    // 指定一个系统转场动画   
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    newFragment.show(ft, mDialogTag);
    return newFragment;
}
Also used : FragmentActivity(android.support.v4.app.FragmentActivity) FragmentTransaction(android.app.FragmentTransaction)

Aggregations

FragmentActivity (android.support.v4.app.FragmentActivity)91 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 MediaControllerCompat (android.support.v4.media.session.MediaControllerCompat)11 Intent (android.content.Intent)7 Bundle (android.os.Bundle)5 View (android.view.View)5 TextView (android.widget.TextView)4 DialogFragment (android.support.v4.app.DialogFragment)3 SearchView (android.widget.SearchView)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 ImageView (android.widget.ImageView)2 InjectView (butterknife.InjectView)2 RequestManager (com.bumptech.glide.RequestManager)2