use of org.gateshipone.malp.application.fragments.serverfragments.AlbumsFragment in project malp by gateship-one.
the class MainActivity method showAlbumsForPath.
@Override
public void showAlbumsForPath(String path) {
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
AlbumsFragment newFragment = new AlbumsFragment();
Bundle args = new Bundle();
args.putString(AlbumsFragment.BUNDLE_STRING_EXTRA_PATH, path);
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, AlbumsFragment.TAG);
transaction.addToBackStack("DirectoryAlbumsFragment");
NavigationView navigationView = findViewById(R.id.nav_view);
navigationView.setCheckedItem(R.id.nav_library);
// Commit the transaction
transaction.commit();
}
use of org.gateshipone.malp.application.fragments.serverfragments.AlbumsFragment in project malp by gateship-one.
the class MainActivity method onArtistSelected.
@Override
public void onArtistSelected(MPDArtist artist, 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
AlbumsFragment newFragment = new AlbumsFragment();
Bundle args = new Bundle();
args.putString(AlbumsFragment.BUNDLE_STRING_EXTRA_ARTISTNAME, artist.getArtistName());
args.putParcelable(AlbumsFragment.BUNDLE_STRING_EXTRA_ARTIST, artist);
// Transfer the bitmap to the next fragment
if (bitmap != null) {
args.putParcelable(AlbumsFragment.BUNDLE_STRING_EXTRA_BITMAP, bitmap);
}
newFragment.setArguments(args);
android.support.v4.app.FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
newFragment.setEnterTransition(new Slide(Gravity.BOTTOM));
newFragment.setExitTransition(new Slide(Gravity.TOP));
// 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, AlbumsFragment.TAG);
transaction.addToBackStack("ArtistAlbumsFragment");
NavigationView navigationView = findViewById(R.id.nav_view);
navigationView.setCheckedItem(R.id.nav_library);
// Commit the transaction
transaction.commit();
}
Aggregations