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);
}
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);
}
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();
}
}
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;
}
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;
}
Aggregations