Search in sources :

Example 6 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 7 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 8 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 9 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 10 with Fragment

use of android.app.Fragment in project FadingActionBar by ManuelPeinado.

the class NavigationDrawerActivity method selectItem.

private void selectItem(int position) {
    // update the main content by replacing fragments
    Fragment fragment = new SampleFragment();
    Bundle args = new Bundle();
    args.putInt(SampleFragment.ARG_IMAGE_RES, mCityImages[position]);
    args.putInt(SampleFragment.ARG_ACTION_BG_RES, R.drawable.ab_background);
    fragment.setArguments(args);
    FragmentManager fragmentManager = getFragmentManager();
    fragmentManager.beginTransaction().replace(R.id.content_frame, fragment).commit();
    // update selected item and title, then close the drawer
    mDrawerList.setItemChecked(position, true);
    setTitle(mCityNames[position]);
    mDrawerLayout.closeDrawer(mDrawerList);
}
Also used : FragmentManager(android.app.FragmentManager) Bundle(android.os.Bundle) Fragment(android.app.Fragment)

Aggregations

Fragment (android.app.Fragment)183 FragmentTransaction (android.app.FragmentTransaction)65 DialogFragment (android.app.DialogFragment)42 FragmentManager (android.app.FragmentManager)34 Bundle (android.os.Bundle)18 PreferenceFragment (android.support.v14.preference.PreferenceFragment)12 Intent (android.content.Intent)11 View (android.view.View)11 BizFragment (org.aisen.weibo.sina.ui.fragment.base.BizFragment)8 TextView (android.widget.TextView)6 ABaseFragment (org.aisen.android.ui.fragment.ABaseFragment)6 Uri (android.net.Uri)5 PreferenceFragment (android.preference.PreferenceFragment)4 HashMap (java.util.HashMap)4 Map (java.util.Map)4 SuppressLint (android.annotation.SuppressLint)3 ViewGroup (android.view.ViewGroup)3 FrameLayout (android.widget.FrameLayout)3 Method (java.lang.reflect.Method)3 APagingFragment (org.aisen.android.ui.fragment.APagingFragment)3