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();
}
Aggregations