Search in sources :

Example 1 with EditProfileFragment

use of org.gateshipone.malp.application.fragments.EditProfileFragment in project malp by gateship-one.

the class MainActivity method editProfile.

@Override
public void editProfile(MPDServerProfile profile) {
    if (null == profile) {
        profile = new MPDServerProfile(getString(R.string.fragment_profile_default_name), true);
        ConnectionManager.getInstance(getApplicationContext()).addProfile(profile, this);
    }
    // Create fragment and give it an argument for the selected article
    EditProfileFragment newFragment = new EditProfileFragment();
    Bundle args = new Bundle();
    if (null != profile) {
        args.putParcelable(EditProfileFragment.EXTRA_PROFILE, profile);
    }
    newFragment.setArguments(args);
    android.support.v4.app.FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
    newFragment.setEnterTransition(new Slide(GravityCompat.getAbsoluteGravity(GravityCompat.START, getResources().getConfiguration().getLayoutDirection())));
    newFragment.setExitTransition(new Slide(GravityCompat.getAbsoluteGravity(GravityCompat.END, getResources().getConfiguration().getLayoutDirection())));
    // Replace whatever is in the fragment_container view with this
    // fragment,
    // and add the transaction to the back stack so the user can navigate
    // back
    transaction.replace(R.id.fragment_container, newFragment, EditProfileFragment.TAG);
    transaction.addToBackStack("EditProfileFragment");
    // Commit the transaction
    transaction.commit();
}
Also used : Slide(android.transition.Slide) Bundle(android.os.Bundle) FragmentTransaction(android.support.v4.app.FragmentTransaction) MPDServerProfile(org.gateshipone.malp.mpdservice.profilemanagement.MPDServerProfile) EditProfileFragment(org.gateshipone.malp.application.fragments.EditProfileFragment)

Aggregations

Bundle (android.os.Bundle)1 FragmentTransaction (android.support.v4.app.FragmentTransaction)1 Slide (android.transition.Slide)1 EditProfileFragment (org.gateshipone.malp.application.fragments.EditProfileFragment)1 MPDServerProfile (org.gateshipone.malp.mpdservice.profilemanagement.MPDServerProfile)1