Search in sources :

Example 56 with FragmentTransaction

use of android.support.v4.app.FragmentTransaction in project android-betterpickers by code-troopers.

the class TimePickerBuilder method show.

/**
     * Instantiate and show the Picker
     */
public void show() {
    if (manager == null || styleResId == null) {
        Log.e("TimePickerBuilder", "setFragmentManager() and setStyleResId() must be called.");
        return;
    }
    FragmentTransaction ft = manager.beginTransaction();
    final Fragment prev = manager.findFragmentByTag("time_dialog");
    if (prev != null) {
        ft.remove(prev).commit();
        ft = manager.beginTransaction();
    }
    ft.addToBackStack(null);
    final TimePickerDialogFragment fragment = TimePickerDialogFragment.newInstance(mReference, styleResId);
    if (targetFragment != null) {
        fragment.setTargetFragment(targetFragment, 0);
    }
    fragment.setTimePickerDialogHandlers(mTimePickerDialogHandlers);
    fragment.setOnDismissListener(mOnDismissListener);
    fragment.show(ft, "time_dialog");
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction) Fragment(android.support.v4.app.Fragment)

Example 57 with FragmentTransaction

use of android.support.v4.app.FragmentTransaction in project android-betterpickers by code-troopers.

the class SampleDateUsingFragment method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.frame_layout);
    Fragment fragment = new SampleDateFragment();
    FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
    transaction.replace(R.id.frame, fragment);
    transaction.commit();
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction) SampleDateFragment(com.codetroopers.betterpickers.sample.fragment.SampleDateFragment) SampleDateFragment(com.codetroopers.betterpickers.sample.fragment.SampleDateFragment) Fragment(android.support.v4.app.Fragment)

Example 58 with FragmentTransaction

use of android.support.v4.app.FragmentTransaction in project TakePhoto by crazycodeboy.

the class SimpleFragmentActivity method onCreate.

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.simple_fragment_layout);
    FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
    transaction.add(R.id.fragment1, fragment = new SimpleFragment(), "test");
    transaction.commit();
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction)

Example 59 with FragmentTransaction

use of android.support.v4.app.FragmentTransaction in project photo-picker-plus-android by chute.

the class AssetActivity method onCreate.

@SuppressLint("NewApi")
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    retrieveSavedValuesFromBundle(savedInstanceState);
    wrapper = new PhotosIntentWrapper(getIntent());
    account = wrapper.getAccount();
    filterType = wrapper.getFilterType();
    FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
    if (savedInstanceState == null) {
        fragmentRoot = FragmentRoot.newInstance(account, filterType, selectedAccountsPositions, selectedImagesPositions, selectedVideosPositions);
        ft.add(R.id.gcFragments, fragmentRoot, FragmentUtil.TAG_FRAGMENT_FOLDER).commit();
    }
}
Also used : PhotosIntentWrapper(com.getchute.android.photopickerplus.util.intent.PhotosIntentWrapper) FragmentTransaction(android.support.v4.app.FragmentTransaction) SuppressLint(android.annotation.SuppressLint)

Example 60 with FragmentTransaction

use of android.support.v4.app.FragmentTransaction in project photo-picker-plus-android by chute.

the class AssetActivity method onAccountFolderSelect.

@Override
public void onAccountFolderSelect(AccountModel account, String folderId) {
    this.folderId = folderId;
    FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
    fragmentTransaction.replace(R.id.gcFragments, FragmentSingle.newInstance(account, folderId, selectedAccountsPositions), FragmentUtil.TAG_FRAGMENT_FILES);
    fragmentTransaction.addToBackStack(null);
    fragmentTransaction.commit();
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction)

Aggregations

FragmentTransaction (android.support.v4.app.FragmentTransaction)392 Fragment (android.support.v4.app.Fragment)135 FragmentManager (android.support.v4.app.FragmentManager)79 View (android.view.View)29 DialogFragment (android.support.v4.app.DialogFragment)27 FragmentActivity (android.support.v4.app.FragmentActivity)25 Bundle (android.os.Bundle)21 TextView (android.widget.TextView)19 FragmentTransaction (android.app.FragmentTransaction)18 Intent (android.content.Intent)18 Button (android.widget.Button)17 OnClickListener (android.view.View.OnClickListener)16 SherlockFragment (com.actionbarsherlock.app.SherlockFragment)12 ActionBar (android.support.v7.app.ActionBar)8 TargetApi (android.annotation.TargetApi)6 AppCompatActivity (android.support.v7.app.AppCompatActivity)6 Toolbar (android.support.v7.widget.Toolbar)6 FriendsTimeLineFragment (org.qii.weiciyuan.ui.maintimeline.FriendsTimeLineFragment)6 UserInfoFragment (org.qii.weiciyuan.ui.userinfo.UserInfoFragment)6 Transition (android.transition.Transition)5