use of org.gateshipone.malp.application.fragments.serverfragments.AlbumTracksFragment in project malp by gateship-one.
the class MainActivity method onAlbumSelected.
@Override
public void onAlbumSelected(MPDAlbum album, Bitmap bitmap) {
if (mNowPlayingDragStatus == DRAG_STATUS.DRAGGED_UP) {
NowPlayingView nowPlayingView = findViewById(R.id.now_playing_layout);
if (nowPlayingView != null) {
View coordinatorLayout = findViewById(R.id.main_coordinator_layout);
coordinatorLayout.setVisibility(View.VISIBLE);
nowPlayingView.minimize();
}
}
// Create fragment and give it an argument for the selected article
AlbumTracksFragment newFragment = new AlbumTracksFragment();
Bundle args = new Bundle();
args.putParcelable(AlbumTracksFragment.BUNDLE_STRING_EXTRA_ALBUM, album);
if (bitmap != null) {
args.putParcelable(AlbumTracksFragment.BUNDLE_STRING_EXTRA_BITMAP, bitmap);
}
newFragment.setArguments(args);
android.support.v4.app.FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
// 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
newFragment.setEnterTransition(new Slide(Gravity.BOTTOM));
newFragment.setExitTransition(new Slide(Gravity.TOP));
transaction.replace(R.id.fragment_container, newFragment, AlbumTracksFragment.TAG);
transaction.addToBackStack("AlbumTracksFragment");
NavigationView navigationView = findViewById(R.id.nav_view);
navigationView.setCheckedItem(R.id.nav_library);
// Commit the transaction
transaction.commit();
}
Aggregations