Search in sources :

Example 36 with DialogFragment

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();
        }
    });
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction) Button(android.widget.Button) SherlockDialogFragment(com.actionbarsherlock.app.SherlockDialogFragment) DialogFragment(android.support.v4.app.DialogFragment) OnClickListener(android.view.View.OnClickListener) TextView(android.widget.TextView) View(android.view.View)

Example 37 with DialogFragment

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

Example 38 with DialogFragment

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

Example 39 with DialogFragment

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

Example 40 with DialogFragment

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

Aggregations

DialogFragment (android.support.v4.app.DialogFragment)85 Fragment (android.support.v4.app.Fragment)31 FragmentTransaction (android.support.v4.app.FragmentTransaction)24 Bundle (android.os.Bundle)10 FragmentManager (android.support.v4.app.FragmentManager)9 View (android.view.View)8 SherlockDialogFragment (com.actionbarsherlock.app.SherlockDialogFragment)8 TextView (android.widget.TextView)7 AlertDialog (android.app.AlertDialog)5 DialogInterface (android.content.DialogInterface)4 OnClickListener (android.content.DialogInterface.OnClickListener)4 Intent (android.content.Intent)4 ListFragment (android.support.v4.app.ListFragment)4 AppCompatDialogFragment (android.support.v7.app.AppCompatDialogFragment)4 OnClickListener (android.view.View.OnClickListener)4 Button (android.widget.Button)4 ItemPinnedMessageDialogFragment (com.h6ah4i.android.example.advrecyclerview.common.fragment.ItemPinnedMessageDialogFragment)4 ProgressDialogFragment (com.wada811.android.dialogfragments.material.ProgressDialogFragment)4 Dialog (android.app.Dialog)3 ProgressDialogFragment (com.wada811.android.dialogfragments.traditional.ProgressDialogFragment)3