use of android.support.v4.app.DialogFragment in project ActionBarSherlock by JakeWharton.
the class FragmentDialogOrActivitySupport method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
//Used for theme switching in samples
setTheme(SampleList.THEME);
super.onCreate(savedInstanceState);
setContentView(R.layout.fragment_dialog_or_activity);
if (savedInstanceState == null) {
// First-time init; create fragment to embed in activity.
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
DialogFragment newFragment = MyDialogFragment.newInstance();
ft.add(R.id.embedded, newFragment);
ft.commit();
}
// Watch for button clicks.
Button button = (Button) findViewById(R.id.show_dialog);
button.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
showDialog();
}
});
}
use of android.support.v4.app.DialogFragment in project AndroidChromium by JackyAndroid.
the class MediaRouteControllerDialogManager method openDialogInternal.
@Override
protected DialogFragment openDialogInternal(FragmentManager fm) {
if (fm.findFragmentByTag(DIALOG_FRAGMENT_TAG) != null)
return null;
Fragment fragment = new Fragment(this, mCallback);
MediaRouteSelector selector = mediaSource().buildRouteSelector();
if (selector == null)
return null;
androidMediaRouter().addCallback(selector, mCallback);
fragment.show(fm, DIALOG_FRAGMENT_TAG);
fm.executePendingTransactions();
return fragment;
}
use of android.support.v4.app.DialogFragment in project materialistic by hidroh.
the class ItemFragment method showPreferences.
private void showPreferences() {
Bundle args = new Bundle();
args.putInt(PopupSettingsFragment.EXTRA_TITLE, R.string.font_options);
args.putInt(PopupSettingsFragment.EXTRA_SUMMARY, R.string.pull_up_hint);
args.putIntArray(PopupSettingsFragment.EXTRA_XML_PREFERENCES, new int[] { R.xml.preferences_font, R.xml.preferences_comments });
((DialogFragment) Fragment.instantiate(getActivity(), PopupSettingsFragment.class.getName(), args)).show(getFragmentManager(), PopupSettingsFragment.class.getName());
}
use of android.support.v4.app.DialogFragment in project materialistic by hidroh.
the class BaseListFragment method showPreferences.
private void showPreferences() {
Bundle args = new Bundle();
args.putInt(PopupSettingsFragment.EXTRA_TITLE, R.string.list_display_options);
args.putInt(PopupSettingsFragment.EXTRA_SUMMARY, R.string.pull_up_hint);
args.putIntArray(PopupSettingsFragment.EXTRA_XML_PREFERENCES, new int[] { R.xml.preferences_font, R.xml.preferences_list });
((DialogFragment) Fragment.instantiate(getActivity(), PopupSettingsFragment.class.getName(), args)).show(getFragmentManager(), PopupSettingsFragment.class.getName());
}
use of android.support.v4.app.DialogFragment in project materialistic by hidroh.
the class WebFragment method showPreferences.
private void showPreferences() {
Bundle args = new Bundle();
args.putInt(PopupSettingsFragment.EXTRA_TITLE, R.string.font_options);
args.putIntArray(PopupSettingsFragment.EXTRA_XML_PREFERENCES, new int[] { R.xml.preferences_readability });
((DialogFragment) Fragment.instantiate(getActivity(), PopupSettingsFragment.class.getName(), args)).show(getFragmentManager(), PopupSettingsFragment.class.getName());
}
Aggregations