Search in sources :

Example 61 with Fragment

use of android.app.Fragment in project android_frameworks_base by DirtyUnicorns.

the class PrintActivity method ensureProgressUiShown.

private void ensureProgressUiShown() {
    if (isFinishing() || isDestroyed()) {
        return;
    }
    if (mUiState != UI_STATE_PROGRESS) {
        mUiState = UI_STATE_PROGRESS;
        mPrintPreviewController.setUiShown(false);
        Fragment fragment = PrintProgressFragment.newInstance();
        showFragment(fragment);
    }
}
Also used : DialogFragment(android.app.DialogFragment) Fragment(android.app.Fragment)

Example 62 with Fragment

use of android.app.Fragment in project android_frameworks_base by DirtyUnicorns.

the class BiDiTestActivity method onListItemClick.

private void onListItemClick(ListView lv, View v, int position, long id) {
    // Show the test
    Map<String, Object> map = (Map<String, Object>) lv.getItemAtPosition(position);
    int fragmentId = (Integer) map.get(KEY_FRAGMENT_ID);
    Fragment fragment = getFragmentManager().findFragmentById(fragmentId);
    if (fragment == null) {
        try {
            // Create an instance of the test
            Class<? extends Fragment> clazz = (Class<? extends Fragment>) map.get(KEY_CLASS);
            fragment = clazz.newInstance();
            // Replace the old test fragment with the new one
            FragmentTransaction ft = getFragmentManager().beginTransaction();
            ft.replace(R.id.testframe, fragment);
            ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
            ft.commit();
        } catch (InstantiationException e) {
        } catch (IllegalAccessException e) {
        }
    }
}
Also used : FragmentTransaction(android.app.FragmentTransaction) HashMap(java.util.HashMap) Map(java.util.Map) Fragment(android.app.Fragment)

Example 63 with Fragment

use of android.app.Fragment in project WordPress-Android by wordpress-mobile.

the class ReaderSubsActivity method getPageAdapter.

private SubsPageAdapter getPageAdapter() {
    if (mPageAdapter == null) {
        List<Fragment> fragments = new ArrayList<>();
        fragments.add(ReaderTagFragment.newInstance());
        fragments.add(ReaderBlogFragment.newInstance(ReaderBlogType.FOLLOWED));
        fragments.add(ReaderBlogFragment.newInstance(ReaderBlogType.RECOMMENDED));
        FragmentManager fm = getFragmentManager();
        mPageAdapter = new SubsPageAdapter(fm, fragments);
    }
    return mPageAdapter;
}
Also used : FragmentManager(android.app.FragmentManager) ArrayList(java.util.ArrayList) Fragment(android.app.Fragment)

Example 64 with Fragment

use of android.app.Fragment in project ActionBar-PullToRefresh by chrisbanes.

the class BaseSampleActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // Add the Sample Fragment if there is one
    Fragment sampleFragment = getSampleFragment();
    if (sampleFragment != null) {
        getFragmentManager().beginTransaction().replace(android.R.id.content, sampleFragment).commit();
    }
}
Also used : Fragment(android.app.Fragment)

Example 65 with Fragment

use of android.app.Fragment in project android_frameworks_base by AOSPA.

the class PrintActivity method ensureProgressUiShown.

private void ensureProgressUiShown() {
    if (isFinishing() || isDestroyed()) {
        return;
    }
    if (mUiState != UI_STATE_PROGRESS) {
        mUiState = UI_STATE_PROGRESS;
        mPrintPreviewController.setUiShown(false);
        Fragment fragment = PrintProgressFragment.newInstance();
        showFragment(fragment);
    }
}
Also used : DialogFragment(android.app.DialogFragment) 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