Replaced back arrow with x in some places and cleaned some code up
This commit is contained in:
parent
eb9b4bcb25
commit
6c7ee47d3f
7 changed files with 27 additions and 21 deletions
|
|
@ -33,7 +33,7 @@ public abstract class AbsSmartPlaylist extends Playlist {
|
|||
this.iconRes = R.drawable.ic_queue_music_white_24dp;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@NonNull
|
||||
public SmartPlaylistSongAdapter createAdapter(AppCompatActivity activity, @Nullable CabHolder cabHolder) {
|
||||
return new SmartPlaylistSongAdapter(activity, this, cabHolder);
|
||||
}
|
||||
|
|
@ -51,7 +51,7 @@ public abstract class AbsSmartPlaylist extends Playlist {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(@NonNull final Object obj) {
|
||||
public boolean equals(@Nullable final Object obj) {
|
||||
if (super.equals(obj)) {
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -424,6 +424,7 @@ public class AlbumDetailActivity extends AbsFabActivity implements PaletteColorH
|
|||
if (cab != null && cab.isActive()) cab.finish();
|
||||
cab = new MaterialCab(this, R.id.cab_stub)
|
||||
.setMenu(menuRes)
|
||||
.setCloseDrawableRes(R.drawable.ic_close_white_24dp)
|
||||
.setBackgroundColor(getPaletteColor())
|
||||
.start(new MaterialCab.Callback() {
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -570,6 +570,7 @@ public class ArtistDetailActivity extends AbsFabActivity implements PaletteColor
|
|||
if (cab != null && cab.isActive()) cab.finish();
|
||||
cab = new MaterialCab(this, R.id.cab_stub)
|
||||
.setMenu(menuRes)
|
||||
.setCloseDrawableRes(R.drawable.ic_close_white_24dp)
|
||||
.setBackgroundColor(getPaletteColor())
|
||||
.start(new MaterialCab.Callback() {
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ import butterknife.ButterKnife;
|
|||
import butterknife.InjectView;
|
||||
|
||||
public class MainActivity extends AbsFabActivity
|
||||
implements KabViewsDisableAble, CabHolder, View.OnClickListener {
|
||||
implements KabViewsDisableAble, CabHolder {
|
||||
|
||||
public static final String TAG = MainActivity.class.getSimpleName();
|
||||
|
||||
|
|
@ -256,7 +256,18 @@ public class MainActivity extends AbsFabActivity
|
|||
if (song.id != -1) {
|
||||
if (navigationDrawerHeader == null) {
|
||||
navigationDrawerHeader = navigationView.inflateHeaderView(R.layout.navigation_drawer_header);
|
||||
navigationDrawerHeader.setOnClickListener(this);
|
||||
//noinspection ConstantConditions
|
||||
navigationDrawerHeader.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
//noinspection ConstantConditions
|
||||
NavigationUtil.openCurrentPlayingIfPossible(MainActivity.this, getSharedViewsWithFab(new Pair[]{
|
||||
Pair.create(navigationDrawerHeader.findViewById(R.id.album_art),
|
||||
getResources().getString(R.string.transition_album_cover)
|
||||
)
|
||||
}));
|
||||
}
|
||||
});
|
||||
}
|
||||
((TextView) navigationDrawerHeader.findViewById(R.id.song_title)).setText(song.title);
|
||||
((TextView) navigationDrawerHeader.findViewById(R.id.song_artist)).setText(song.artistName);
|
||||
|
|
@ -270,8 +281,10 @@ public class MainActivity extends AbsFabActivity
|
|||
.build()
|
||||
);
|
||||
} else {
|
||||
navigationView.removeHeaderView(navigationDrawerHeader);
|
||||
navigationDrawerHeader = null;
|
||||
if (navigationDrawerHeader != null) {
|
||||
navigationView.removeHeaderView(navigationDrawerHeader);
|
||||
navigationDrawerHeader = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -596,27 +609,17 @@ public class MainActivity extends AbsFabActivity
|
|||
if (cab != null && cab.isActive()) cab.finish();
|
||||
cab = new MaterialCab(this, R.id.cab_stub)
|
||||
.setMenu(menu)
|
||||
.setCloseDrawableRes(R.drawable.ic_close_white_24dp)
|
||||
.setBackgroundColor(PreferenceUtils.getInstance(this).getThemeColorPrimary())
|
||||
.start(callback);
|
||||
return cab;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (v == navigationDrawerHeader) {
|
||||
NavigationUtil.openCurrentPlayingIfPossible(this, getSharedViewsWithFab(new Pair[]{
|
||||
Pair.create(((ImageView) navigationDrawerHeader.findViewById(R.id.album_art)),
|
||||
getResources().getString(R.string.transition_album_cover)
|
||||
)
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
public void addOnAppBarOffsetChangedListener(OnOffsetChangedListener onOffsetChangedListener) {
|
||||
appbar.addOnOffsetChangedListener(onOffsetChangedListener);
|
||||
}
|
||||
|
||||
public void removeOnAppBArOffsetChangedListener(OnOffsetChangedListener onOffsetChangedListener) {
|
||||
public void removeOnAppBarOffsetChangedListener(OnOffsetChangedListener onOffsetChangedListener) {
|
||||
appbar.removeOnOffsetChangedListener(onOffsetChangedListener);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -180,6 +180,7 @@ public class MusicControllerActivity extends AbsFabActivity {
|
|||
//noinspection ConstantConditions
|
||||
getSupportActionBar().setTitle(null);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_close_white_24dp);
|
||||
}
|
||||
|
||||
private void animateFabCircularRevealOnEnterTransitionEnd() {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package com.kabouzeid.gramophone.ui.activities;
|
|||
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v7.widget.GridLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
|
|
@ -45,10 +44,8 @@ public class PlaylistDetailActivity extends AbsFabActivity implements CabHolder
|
|||
@InjectView(android.R.id.empty)
|
||||
TextView empty;
|
||||
|
||||
@Nullable
|
||||
private Playlist playlist;
|
||||
private MaterialCab cab;
|
||||
@Nullable
|
||||
private AbsPlaylistSongAdapter adapter;
|
||||
|
||||
@Override
|
||||
|
|
@ -111,6 +108,7 @@ public class PlaylistDetailActivity extends AbsFabActivity implements CabHolder
|
|||
} catch (ClassCastException ignored) {
|
||||
}
|
||||
if (playlist == null) {
|
||||
playlist = new Playlist();
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
|
@ -159,6 +157,7 @@ public class PlaylistDetailActivity extends AbsFabActivity implements CabHolder
|
|||
if (cab != null && cab.isActive()) cab.finish();
|
||||
cab = new MaterialCab(this, R.id.cab_stub)
|
||||
.setMenu(menu)
|
||||
.setCloseDrawableRes(R.drawable.ic_close_white_24dp)
|
||||
.setBackgroundColor(PreferenceUtils.getInstance(this).getThemeColorPrimary())
|
||||
.start(callback);
|
||||
return cab;
|
||||
|
|
|
|||
|
|
@ -137,6 +137,7 @@ public abstract class AbsMainActivityRecyclerViewFragment extends AbsMainActivit
|
|||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
getMainActivity().removeOnAppBarOffsetChangedListener(this);
|
||||
ButterKnife.reset(this);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue