Search in sources :

Example 6 with NowPlayingView

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);
        }
    }
}
Also used : FragmentManager(android.support.v4.app.FragmentManager) NowPlayingView(org.gateshipone.malp.application.views.NowPlayingView) DrawerLayout(android.support.v4.widget.DrawerLayout) NavigationView(android.support.design.widget.NavigationView) ImageView(android.widget.ImageView) View(android.view.View) AdapterView(android.widget.AdapterView) CurrentPlaylistView(org.gateshipone.malp.application.views.CurrentPlaylistView) TextView(android.widget.TextView) NowPlayingView(org.gateshipone.malp.application.views.NowPlayingView)

Example 7 with NowPlayingView

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();
    }
}
Also used : NowPlayingView(org.gateshipone.malp.application.views.NowPlayingView)

Aggregations

NowPlayingView (org.gateshipone.malp.application.views.NowPlayingView)7 NavigationView (android.support.design.widget.NavigationView)5 View (android.view.View)5 AdapterView (android.widget.AdapterView)5 ImageView (android.widget.ImageView)5 TextView (android.widget.TextView)5 CurrentPlaylistView (org.gateshipone.malp.application.views.CurrentPlaylistView)5 Bundle (android.os.Bundle)4 FragmentTransaction (android.support.v4.app.FragmentTransaction)4 Slide (android.transition.Slide)3 AlbumsFragment (org.gateshipone.malp.application.fragments.serverfragments.AlbumsFragment)3 FragmentManager (android.support.v4.app.FragmentManager)2 DrawerLayout (android.support.v4.widget.DrawerLayout)2 AlbumTracksFragment (org.gateshipone.malp.application.fragments.serverfragments.AlbumTracksFragment)2 Intent (android.content.Intent)1 Fragment (android.support.v4.app.Fragment)1 ArtworkSettingsFragment (org.gateshipone.malp.application.fragments.ArtworkSettingsFragment)1 EditProfileFragment (org.gateshipone.malp.application.fragments.EditProfileFragment)1 InformationSettingsFragment (org.gateshipone.malp.application.fragments.InformationSettingsFragment)1 ProfilesFragment (org.gateshipone.malp.application.fragments.ProfilesFragment)1