use of org.gateshipone.malp.application.views.NowPlayingView in project malp by gateship-one.
the class MainActivity method onBackPressed.
@Override
public void onBackPressed() {
DrawerLayout drawer = findViewById(R.id.drawer_layout);
FragmentManager fragmentManager = getSupportFragmentManager();
if (drawer.isDrawerOpen(GravityCompat.START)) {
drawer.closeDrawer(GravityCompat.START);
} else 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();
}
} else {
super.onBackPressed();
// enable navigation bar when backstack empty
if (fragmentManager.getBackStackEntryCount() == 0) {
mDrawerToggle.setDrawerIndicatorEnabled(true);
}
}
}
use of org.gateshipone.malp.application.views.NowPlayingView in project malp by gateship-one.
the class MainActivity method onPause.
@Override
protected void onPause() {
super.onPause();
NowPlayingView nowPlayingView = findViewById(R.id.now_playing_layout);
if (nowPlayingView != null) {
nowPlayingView.registerDragStatusReceiver(null);
nowPlayingView.onPause();
}
}
Aggregations