Search in sources :

Example 66 with FragmentManager

use of android.support.v4.app.FragmentManager in project HoloEverywhere by Prototik.

the class DatePreference method getDatePickerDialog.

private DatePickerDialog getDatePickerDialog(boolean create) {
    if (mDatePickerDialog == null && create) {
        mDatePickerDialog = DatePickerDialog.newInstance(mCallback, mYear, mMonth, mDay);
        mDatePickerDialog.setForceNotShow(true);
        final FragmentManager fm = Activity.extract(getContext(), true).getSupportFragmentManager();
        final FragmentTransaction ft = fm.beginTransaction();
        ft.add(mDatePickerDialog, getClass().getName() + "@" + getKey());
        ft.commitAllowingStateLoss();
        fm.executePendingTransactions();
    }
    return mDatePickerDialog;
}
Also used : FragmentManager(android.support.v4.app.FragmentManager) FragmentTransaction(android.support.v4.app.FragmentTransaction)

Example 67 with FragmentManager

use of android.support.v4.app.FragmentManager in project paper-onboarding-android by Ramotion.

the class FragmentsActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.fragments_activity_layout);
    fragmentManager = getSupportFragmentManager();
    final PaperOnboardingFragment onBoardingFragment = PaperOnboardingFragment.newInstance(getDataForOnboarding());
    FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
    fragmentTransaction.add(R.id.fragment_container, onBoardingFragment);
    fragmentTransaction.commit();
    onBoardingFragment.setOnRightOutListener(new PaperOnboardingOnRightOutListener() {

        @Override
        public void onRightOut() {
            FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
            Fragment bf = new BlankFragment();
            fragmentTransaction.replace(R.id.fragment_container, bf);
            fragmentTransaction.commit();
        }
    });
}
Also used : PaperOnboardingFragment(com.ramotion.paperonboarding.PaperOnboardingFragment) FragmentTransaction(android.support.v4.app.FragmentTransaction) Fragment(android.support.v4.app.Fragment) PaperOnboardingFragment(com.ramotion.paperonboarding.PaperOnboardingFragment) PaperOnboardingOnRightOutListener(com.ramotion.paperonboarding.listeners.PaperOnboardingOnRightOutListener)

Example 68 with FragmentManager

use of android.support.v4.app.FragmentManager in project RoboBinding-gallery by RoboBinding.

the class AbstractFragmentActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_fragment);
    FragmentManager fm = getSupportFragmentManager();
    Fragment fragment = fm.findFragmentById(R.id.fragmentContainer);
    if (fragment == null) {
        fragment = createFragment();
        fm.beginTransaction().add(R.id.fragmentContainer, fragment).commit();
    }
}
Also used : FragmentManager(android.support.v4.app.FragmentManager) Fragment(android.support.v4.app.Fragment)

Example 69 with FragmentManager

use of android.support.v4.app.FragmentManager in project RxJava-Android-Samples by kaushikgopal.

the class RotationPersist1Fragment method startOperationFromWorkerFrag.

// -----------------------------------------------------------------------------------
@OnClick(R.id.btn_rotate_persist)
public void startOperationFromWorkerFrag() {
    _logs = new ArrayList<>();
    _adapter.clear();
    FragmentManager fm = getActivity().getSupportFragmentManager();
    RotationPersist1WorkerFragment frag = (RotationPersist1WorkerFragment) fm.findFragmentByTag(RotationPersist1WorkerFragment.TAG);
    if (frag == null) {
        frag = new RotationPersist1WorkerFragment();
        fm.beginTransaction().add(frag, RotationPersist1WorkerFragment.TAG).commit();
    } else {
        Timber.d("Worker frag already spawned");
    }
}
Also used : FragmentManager(android.support.v4.app.FragmentManager) OnClick(butterknife.OnClick)

Example 70 with FragmentManager

use of android.support.v4.app.FragmentManager in project barcodescanner by dm77.

the class FullScannerActivity method closeDialog.

public void closeDialog(String dialogName) {
    FragmentManager fragmentManager = getSupportFragmentManager();
    DialogFragment fragment = (DialogFragment) fragmentManager.findFragmentByTag(dialogName);
    if (fragment != null) {
        fragment.dismiss();
    }
}
Also used : FragmentManager(android.support.v4.app.FragmentManager) DialogFragment(android.support.v4.app.DialogFragment)

Aggregations

FragmentManager (android.support.v4.app.FragmentManager)293 FragmentTransaction (android.support.v4.app.FragmentTransaction)106 Fragment (android.support.v4.app.Fragment)99 View (android.view.View)53 TextView (android.widget.TextView)35 Bundle (android.os.Bundle)31 OnClickListener (android.view.View.OnClickListener)24 DialogFragment (android.support.v4.app.DialogFragment)23 Intent (android.content.Intent)20 ImageView (android.widget.ImageView)16 ScrollView (android.widget.ScrollView)14 ListFragment (android.support.v4.app.ListFragment)12 Button (android.widget.Button)11 ArrayList (java.util.ArrayList)9 FrontPageFragment (ingage.ingage20.fragments.FrontPageFragment)8 SearchResultFragment (ingage.ingage20.fragments.SearchResultFragment)8 ViewPager (android.support.v4.view.ViewPager)7 ActionBar (android.support.v7.app.ActionBar)7 RecyclerView (android.support.v7.widget.RecyclerView)7 CategoriesPageFragment (ingage.ingage20.fragments.CategoriesPageFragment)7