Search in sources :

Example 31 with Fragment

use of android.app.Fragment in project SeriesGuide by UweTrottmann.

the class UpcomingEpisodeSettingsActivity method onCreate.

public void onCreate(Bundle savedInstanceState) {
    // set a theme based on user preference
    setTheme(SeriesGuidePreferences.THEME);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_singlepane);
    setupActionBar();
    if (savedInstanceState == null) {
        Fragment f = new SettingsFragment();
        FragmentTransaction ft = getFragmentManager().beginTransaction();
        ft.add(R.id.content_frame, f);
        ft.commit();
    }
}
Also used : FragmentTransaction(android.app.FragmentTransaction) Fragment(android.app.Fragment) PreferenceFragment(android.preference.PreferenceFragment)

Example 32 with Fragment

use of android.app.Fragment in project SeriesGuide by UweTrottmann.

the class SeriesGuidePreferences method switchToSettings.

public void switchToSettings(String settingsId) {
    Bundle args = new Bundle();
    args.putString(EXTRA_SETTINGS_SCREEN, settingsId);
    Fragment f = new SettingsFragment();
    f.setArguments(args);
    FragmentTransaction ft = getFragmentManager().beginTransaction();
    ft.replace(R.id.containerSettings, f);
    ft.addToBackStack(null);
    ft.commit();
}
Also used : FragmentTransaction(android.app.FragmentTransaction) Bundle(android.os.Bundle) Fragment(android.app.Fragment) PreferenceFragment(android.preference.PreferenceFragment)

Example 33 with Fragment

use of android.app.Fragment in project SeriesGuide by UweTrottmann.

the class SeriesGuidePreferences method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    setTheme(SeriesGuidePreferences.THEME);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_settings);
    setupActionBar();
    if (savedInstanceState == null) {
        Fragment f = new SettingsFragment();
        FragmentTransaction ft = getFragmentManager().beginTransaction();
        ft.add(R.id.containerSettings, f);
        ft.commit();
        // open a sub settings screen if requested
        String settingsScreen = getIntent().getStringExtra(EXTRA_SETTINGS_SCREEN);
        if (settingsScreen != null) {
            switchToSettings(settingsScreen);
        }
    }
}
Also used : FragmentTransaction(android.app.FragmentTransaction) Fragment(android.app.Fragment) PreferenceFragment(android.preference.PreferenceFragment)

Example 34 with Fragment

use of android.app.Fragment in project Fairphone by Kwamecorp.

the class WallpaperChooser method onCreate.

@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    setContentView(R.layout.wallpaper_chooser_base);
    Fragment fragmentView = getFragmentManager().findFragmentById(R.id.wallpaper_chooser_fragment);
    // needs to be revived again.
    if (fragmentView == null) {
        /* When the screen is XLarge, the fragment is not included in the layout, so show it
             * as a dialog
             */
        DialogFragment fragment = WallpaperChooserDialogFragment.newInstance();
        fragment.show(getFragmentManager(), "dialog");
    }
}
Also used : DialogFragment(android.app.DialogFragment) Fragment(android.app.Fragment) DialogFragment(android.app.DialogFragment)

Example 35 with Fragment

use of android.app.Fragment in project material-camera by afollestad.

the class BaseCaptureActivity method onBackPressed.

@Override
public final void onBackPressed() {
    Fragment frag = getFragmentManager().findFragmentById(R.id.container);
    if (frag != null) {
        if (frag instanceof PlaybackVideoFragment && allowRetry()) {
            onRetry(((CameraUriInterface) frag).getOutputUri());
            return;
        } else if (frag instanceof BaseCameraFragment) {
            ((BaseCameraFragment) frag).cleanup();
        } else if (frag instanceof BaseGalleryFragment && allowRetry()) {
            onRetry(((CameraUriInterface) frag).getOutputUri());
            return;
        }
    }
    finish();
}
Also used : Fragment(android.app.Fragment)

Aggregations

Fragment (android.app.Fragment)209 FragmentTransaction (android.app.FragmentTransaction)82 FragmentManager (android.app.FragmentManager)51 DialogFragment (android.app.DialogFragment)44 Bundle (android.os.Bundle)22 Intent (android.content.Intent)13 View (android.view.View)13 PreferenceFragment (android.support.v14.preference.PreferenceFragment)12 TextView (android.widget.TextView)8 BizFragment (org.aisen.weibo.sina.ui.fragment.base.BizFragment)8 Uri (android.net.Uri)6 ABaseFragment (org.aisen.android.ui.fragment.ABaseFragment)6 Activity (android.app.Activity)5 PreferenceFragment (android.preference.PreferenceFragment)4 HashMap (java.util.HashMap)4 Map (java.util.Map)4 ViewGroup (android.view.ViewGroup)3 FrameLayout (android.widget.FrameLayout)3 ContactVcardViewerFragment (com.xabber.android.ui.fragment.ContactVcardViewerFragment)3 Method (java.lang.reflect.Method)3