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;
|
this.iconRes = R.drawable.ic_queue_music_white_24dp;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@NonNull
|
||||||
public SmartPlaylistSongAdapter createAdapter(AppCompatActivity activity, @Nullable CabHolder cabHolder) {
|
public SmartPlaylistSongAdapter createAdapter(AppCompatActivity activity, @Nullable CabHolder cabHolder) {
|
||||||
return new SmartPlaylistSongAdapter(activity, this, cabHolder);
|
return new SmartPlaylistSongAdapter(activity, this, cabHolder);
|
||||||
}
|
}
|
||||||
|
|
@ -51,7 +51,7 @@ public abstract class AbsSmartPlaylist extends Playlist {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(@NonNull final Object obj) {
|
public boolean equals(@Nullable final Object obj) {
|
||||||
if (super.equals(obj)) {
|
if (super.equals(obj)) {
|
||||||
if (getClass() != obj.getClass()) {
|
if (getClass() != obj.getClass()) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -424,6 +424,7 @@ public class AlbumDetailActivity extends AbsFabActivity implements PaletteColorH
|
||||||
if (cab != null && cab.isActive()) cab.finish();
|
if (cab != null && cab.isActive()) cab.finish();
|
||||||
cab = new MaterialCab(this, R.id.cab_stub)
|
cab = new MaterialCab(this, R.id.cab_stub)
|
||||||
.setMenu(menuRes)
|
.setMenu(menuRes)
|
||||||
|
.setCloseDrawableRes(R.drawable.ic_close_white_24dp)
|
||||||
.setBackgroundColor(getPaletteColor())
|
.setBackgroundColor(getPaletteColor())
|
||||||
.start(new MaterialCab.Callback() {
|
.start(new MaterialCab.Callback() {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -570,6 +570,7 @@ public class ArtistDetailActivity extends AbsFabActivity implements PaletteColor
|
||||||
if (cab != null && cab.isActive()) cab.finish();
|
if (cab != null && cab.isActive()) cab.finish();
|
||||||
cab = new MaterialCab(this, R.id.cab_stub)
|
cab = new MaterialCab(this, R.id.cab_stub)
|
||||||
.setMenu(menuRes)
|
.setMenu(menuRes)
|
||||||
|
.setCloseDrawableRes(R.drawable.ic_close_white_24dp)
|
||||||
.setBackgroundColor(getPaletteColor())
|
.setBackgroundColor(getPaletteColor())
|
||||||
.start(new MaterialCab.Callback() {
|
.start(new MaterialCab.Callback() {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ import butterknife.ButterKnife;
|
||||||
import butterknife.InjectView;
|
import butterknife.InjectView;
|
||||||
|
|
||||||
public class MainActivity extends AbsFabActivity
|
public class MainActivity extends AbsFabActivity
|
||||||
implements KabViewsDisableAble, CabHolder, View.OnClickListener {
|
implements KabViewsDisableAble, CabHolder {
|
||||||
|
|
||||||
public static final String TAG = MainActivity.class.getSimpleName();
|
public static final String TAG = MainActivity.class.getSimpleName();
|
||||||
|
|
||||||
|
|
@ -256,7 +256,18 @@ public class MainActivity extends AbsFabActivity
|
||||||
if (song.id != -1) {
|
if (song.id != -1) {
|
||||||
if (navigationDrawerHeader == null) {
|
if (navigationDrawerHeader == null) {
|
||||||
navigationDrawerHeader = navigationView.inflateHeaderView(R.layout.navigation_drawer_header);
|
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_title)).setText(song.title);
|
||||||
((TextView) navigationDrawerHeader.findViewById(R.id.song_artist)).setText(song.artistName);
|
((TextView) navigationDrawerHeader.findViewById(R.id.song_artist)).setText(song.artistName);
|
||||||
|
|
@ -270,8 +281,10 @@ public class MainActivity extends AbsFabActivity
|
||||||
.build()
|
.build()
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
navigationView.removeHeaderView(navigationDrawerHeader);
|
if (navigationDrawerHeader != null) {
|
||||||
navigationDrawerHeader = null;
|
navigationView.removeHeaderView(navigationDrawerHeader);
|
||||||
|
navigationDrawerHeader = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -596,27 +609,17 @@ public class MainActivity extends AbsFabActivity
|
||||||
if (cab != null && cab.isActive()) cab.finish();
|
if (cab != null && cab.isActive()) cab.finish();
|
||||||
cab = new MaterialCab(this, R.id.cab_stub)
|
cab = new MaterialCab(this, R.id.cab_stub)
|
||||||
.setMenu(menu)
|
.setMenu(menu)
|
||||||
|
.setCloseDrawableRes(R.drawable.ic_close_white_24dp)
|
||||||
.setBackgroundColor(PreferenceUtils.getInstance(this).getThemeColorPrimary())
|
.setBackgroundColor(PreferenceUtils.getInstance(this).getThemeColorPrimary())
|
||||||
.start(callback);
|
.start(callback);
|
||||||
return cab;
|
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) {
|
public void addOnAppBarOffsetChangedListener(OnOffsetChangedListener onOffsetChangedListener) {
|
||||||
appbar.addOnOffsetChangedListener(onOffsetChangedListener);
|
appbar.addOnOffsetChangedListener(onOffsetChangedListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeOnAppBArOffsetChangedListener(OnOffsetChangedListener onOffsetChangedListener) {
|
public void removeOnAppBarOffsetChangedListener(OnOffsetChangedListener onOffsetChangedListener) {
|
||||||
appbar.removeOnOffsetChangedListener(onOffsetChangedListener);
|
appbar.removeOnOffsetChangedListener(onOffsetChangedListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -180,6 +180,7 @@ public class MusicControllerActivity extends AbsFabActivity {
|
||||||
//noinspection ConstantConditions
|
//noinspection ConstantConditions
|
||||||
getSupportActionBar().setTitle(null);
|
getSupportActionBar().setTitle(null);
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_close_white_24dp);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void animateFabCircularRevealOnEnterTransitionEnd() {
|
private void animateFabCircularRevealOnEnterTransitionEnd() {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ package com.kabouzeid.gramophone.ui.activities;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.annotation.Nullable;
|
|
||||||
import android.support.v7.widget.GridLayoutManager;
|
import android.support.v7.widget.GridLayoutManager;
|
||||||
import android.support.v7.widget.RecyclerView;
|
import android.support.v7.widget.RecyclerView;
|
||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.Toolbar;
|
||||||
|
|
@ -45,10 +44,8 @@ public class PlaylistDetailActivity extends AbsFabActivity implements CabHolder
|
||||||
@InjectView(android.R.id.empty)
|
@InjectView(android.R.id.empty)
|
||||||
TextView empty;
|
TextView empty;
|
||||||
|
|
||||||
@Nullable
|
|
||||||
private Playlist playlist;
|
private Playlist playlist;
|
||||||
private MaterialCab cab;
|
private MaterialCab cab;
|
||||||
@Nullable
|
|
||||||
private AbsPlaylistSongAdapter adapter;
|
private AbsPlaylistSongAdapter adapter;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -111,6 +108,7 @@ public class PlaylistDetailActivity extends AbsFabActivity implements CabHolder
|
||||||
} catch (ClassCastException ignored) {
|
} catch (ClassCastException ignored) {
|
||||||
}
|
}
|
||||||
if (playlist == null) {
|
if (playlist == null) {
|
||||||
|
playlist = new Playlist();
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -159,6 +157,7 @@ public class PlaylistDetailActivity extends AbsFabActivity implements CabHolder
|
||||||
if (cab != null && cab.isActive()) cab.finish();
|
if (cab != null && cab.isActive()) cab.finish();
|
||||||
cab = new MaterialCab(this, R.id.cab_stub)
|
cab = new MaterialCab(this, R.id.cab_stub)
|
||||||
.setMenu(menu)
|
.setMenu(menu)
|
||||||
|
.setCloseDrawableRes(R.drawable.ic_close_white_24dp)
|
||||||
.setBackgroundColor(PreferenceUtils.getInstance(this).getThemeColorPrimary())
|
.setBackgroundColor(PreferenceUtils.getInstance(this).getThemeColorPrimary())
|
||||||
.start(callback);
|
.start(callback);
|
||||||
return cab;
|
return cab;
|
||||||
|
|
|
||||||
|
|
@ -137,6 +137,7 @@ public abstract class AbsMainActivityRecyclerViewFragment extends AbsMainActivit
|
||||||
@Override
|
@Override
|
||||||
public void onDestroyView() {
|
public void onDestroyView() {
|
||||||
super.onDestroyView();
|
super.onDestroyView();
|
||||||
|
getMainActivity().removeOnAppBarOffsetChangedListener(this);
|
||||||
ButterKnife.reset(this);
|
ButterKnife.reset(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue