Search in sources :

Example 1 with PlaylistTracksFragment

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

the class MainActivity method openPlaylist.

@Override
public void openPlaylist(String name) {
    // Create fragment and give it an argument for the selected article
    PlaylistTracksFragment newFragment = new PlaylistTracksFragment();
    Bundle args = new Bundle();
    args.putString(PlaylistTracksFragment.EXTRA_PLAYLIST_NAME, name);
    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);
    transaction.addToBackStack("PlaylistTracksFragment");
    // Commit the transaction
    transaction.commit();
}
Also used : Slide(android.transition.Slide) Bundle(android.os.Bundle) PlaylistTracksFragment(org.gateshipone.malp.application.fragments.serverfragments.PlaylistTracksFragment) FragmentTransaction(android.support.v4.app.FragmentTransaction)

Aggregations

Bundle (android.os.Bundle)1 FragmentTransaction (android.support.v4.app.FragmentTransaction)1 Slide (android.transition.Slide)1 PlaylistTracksFragment (org.gateshipone.malp.application.fragments.serverfragments.PlaylistTracksFragment)1