New colors
This commit is contained in:
parent
5aa4a3dcac
commit
696299b960
32 changed files with 116 additions and 164 deletions
|
|
@ -43,7 +43,7 @@ public class NavigationDrawerItemAdapter extends ArrayAdapter<NavigationDrawerIt
|
|||
icon.setImageDrawable(Util.getTintedDrawable(getContext().getResources(), item.imageRes, Util.resolveColor(getContext(), R.attr.colorAccent)));
|
||||
} else {
|
||||
title.setTextColor(Util.resolveColor(getContext(), R.attr.title_text_color));
|
||||
icon.setImageDrawable(Util.getTintedDrawable(getContext().getResources(), item.imageRes, Util.resolveColor(getContext(), R.attr.title_text_color)));
|
||||
icon.setImageDrawable(Util.getTintedDrawable(getContext().getResources(), item.imageRes, Util.resolveColor(getContext(), R.attr.themed_drawable_color)));
|
||||
}
|
||||
View container = convertView.findViewById(R.id.container);
|
||||
container.setActivated(position == currentChecked);
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.kabouzeid.gramophone.adapter.songadapter;
|
|||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Typeface;
|
||||
import android.support.v4.util.Pair;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
|
|
@ -81,6 +82,7 @@ public class SongAdapter extends RecyclerView.Adapter<SongAdapter.ViewHolder> {
|
|||
int accentColor = Util.resolveColor(activity, R.attr.colorAccent);
|
||||
holder.songTitle.setText(activity.getResources().getString(R.string.shuffle_all).toUpperCase());
|
||||
holder.songTitle.setTextColor(accentColor);
|
||||
holder.songTitle.setTypeface(Typeface.create("sans-serif-medium", Typeface.NORMAL));
|
||||
holder.songInfo.setVisibility(View.GONE);
|
||||
holder.overflowButton.setVisibility(View.GONE);
|
||||
final int padding = activity.getResources().getDimensionPixelSize(R.dimen.default_item_margin) / 2;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package com.kabouzeid.gramophone.widget;
|
||||
package com.kabouzeid.gramophone.appwidget;
|
||||
|
||||
import android.app.PendingIntent;
|
||||
import android.appwidget.AppWidgetManager;
|
||||
|
|
@ -136,7 +136,7 @@ public class PlayingNotificationHelper {
|
|||
|
||||
private void setUpCollapsedLayout(final Song song) {
|
||||
notificationLayout.setTextViewText(R.id.song_title, song.title);
|
||||
notificationLayout.setTextViewText(R.id.song_artist, song.title);
|
||||
notificationLayout.setTextViewText(R.id.song_artist, song.artistName);
|
||||
}
|
||||
|
||||
private void setUpExpandedLayout(final Song song) {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ public class UIPreferenceChangedEvent {
|
|||
public static final int COLORED_NAVIGATION_BAR_ARTIST_CHANGED = 2;
|
||||
public static final int COLORED_NAVIGATION_BAR_ALBUM_CHANGED = 3;
|
||||
public static final int PLAYBACK_CONTROLLER_CARD_CHANGED = 4;
|
||||
public static final int TOOLBAR_TRANSPARENT_CHANGED = 5;
|
||||
|
||||
private int action;
|
||||
private Object value;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,8 @@ public abstract class AbsFabActivity extends AbsBaseActivity {
|
|||
super.onPostCreate(savedInstanceState);
|
||||
try {
|
||||
App.bus.register(busEventListener);
|
||||
} catch (Exception ignored) {}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
setUpFab();
|
||||
}
|
||||
|
||||
|
|
@ -64,14 +65,6 @@ public abstract class AbsFabActivity extends AbsBaseActivity {
|
|||
}
|
||||
});
|
||||
|
||||
getFab().setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
Toast.makeText(AbsFabActivity.this, getResources().getString(R.string.hint_fling_to_open), Toast.LENGTH_SHORT).show();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
getFab().setOnTouchListener(new View.OnTouchListener() {
|
||||
@Override
|
||||
public boolean onTouch(View view, MotionEvent event) {
|
||||
|
|
@ -141,7 +134,8 @@ public abstract class AbsFabActivity extends AbsBaseActivity {
|
|||
super.onDestroy();
|
||||
try {
|
||||
App.bus.unregister(busEventListener);
|
||||
} catch (Exception ignored) {}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
public void onMusicRemoteEvent(MusicRemoteEvent event) {
|
||||
|
|
|
|||
|
|
@ -1,26 +1,22 @@
|
|||
package com.kabouzeid.gramophone.ui.fragments.mainactivityfragments;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.widget.GridLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.kabouzeid.gramophone.R;
|
||||
import com.kabouzeid.gramophone.adapter.songadapter.SongAdapter;
|
||||
|
||||
/**
|
||||
* Created by karim on 29.12.14.
|
||||
* Created by karim on 30.03.15.
|
||||
*/
|
||||
public class SongViewFragment extends AbsMainActivityFragment {
|
||||
public static final String TAG = SongViewFragment.class.getSimpleName();
|
||||
|
||||
public abstract class AbsMainActivityRecyclerViewFragment extends AbsMainActivityFragment {
|
||||
private RecyclerView recyclerView;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.fragment_songview, container, false);
|
||||
return inflater.inflate(getLayoutResId(), container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -31,9 +27,9 @@ public class SongViewFragment extends AbsMainActivityFragment {
|
|||
}
|
||||
|
||||
private void setUpRecyclerView() {
|
||||
recyclerView.setLayoutManager(new GridLayoutManager(getActivity(), 1));
|
||||
recyclerView.setLayoutManager(getLayoutManager());
|
||||
recyclerView.setPadding(0, getTopPadding(), 0, getBottomPadding());
|
||||
recyclerView.setAdapter(new SongAdapter(getActivity()));
|
||||
recyclerView.setAdapter(getAdapter());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -47,4 +43,14 @@ public class SongViewFragment extends AbsMainActivityFragment {
|
|||
super.disableViews();
|
||||
recyclerView.setEnabled(false);
|
||||
}
|
||||
|
||||
protected abstract int getLayoutResId();
|
||||
|
||||
protected abstract RecyclerView.LayoutManager getLayoutManager();
|
||||
|
||||
protected abstract RecyclerView.Adapter getAdapter();
|
||||
|
||||
public RecyclerView getRecyclerView() {
|
||||
return recyclerView;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,49 +1,29 @@
|
|||
package com.kabouzeid.gramophone.ui.fragments.mainactivityfragments;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.widget.GridLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.kabouzeid.gramophone.App;
|
||||
import com.kabouzeid.gramophone.R;
|
||||
import com.kabouzeid.gramophone.adapter.AlbumAdapter;
|
||||
import com.kabouzeid.gramophone.model.UIPreferenceChangedEvent;
|
||||
import com.squareup.otto.Subscribe;
|
||||
|
||||
/**
|
||||
* Created by karim on 22.11.14.
|
||||
*/
|
||||
public class AlbumViewFragment extends AbsMainActivityFragment {
|
||||
public class AlbumViewFragment extends AbsMainActivityRecyclerViewFragment {
|
||||
public static final String TAG = AlbumViewFragment.class.getSimpleName();
|
||||
|
||||
private RecyclerView recyclerView;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_album_view, container, false);
|
||||
recyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);
|
||||
setUpRecyclerView();
|
||||
return view;
|
||||
}
|
||||
|
||||
private void setUpRecyclerView() {
|
||||
recyclerView.setLayoutManager(new GridLayoutManager(getActivity(), 2));
|
||||
recyclerView.setPadding(0, getTopPadding(), 0, getBottomPadding());
|
||||
recyclerView.setAdapter(new AlbumAdapter(getActivity()));
|
||||
protected int getLayoutResId() {
|
||||
return R.layout.fragment_album_view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableViews() {
|
||||
super.enableViews();
|
||||
recyclerView.setEnabled(true);
|
||||
protected RecyclerView.LayoutManager getLayoutManager() {
|
||||
return new GridLayoutManager(getActivity(), 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableViews() {
|
||||
super.disableViews();
|
||||
recyclerView.setEnabled(false);
|
||||
protected RecyclerView.Adapter getAdapter() {
|
||||
return new AlbumAdapter(getActivity());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,48 +1,27 @@
|
|||
package com.kabouzeid.gramophone.ui.fragments.mainactivityfragments;
|
||||
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.widget.GridLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.kabouzeid.gramophone.R;
|
||||
import com.kabouzeid.gramophone.adapter.ArtistAdapter;
|
||||
|
||||
public class ArtistViewFragment extends AbsMainActivityFragment {
|
||||
public class ArtistViewFragment extends AbsMainActivityRecyclerViewFragment {
|
||||
public static final String TAG = ArtistViewFragment.class.getSimpleName();
|
||||
|
||||
private RecyclerView recyclerView;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.fragment_artist_view, container, false);
|
||||
protected int getLayoutResId() {
|
||||
return R.layout.fragment_artist_view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(View view, Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
recyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);
|
||||
setUpRecyclerView();
|
||||
}
|
||||
|
||||
private void setUpRecyclerView() {
|
||||
recyclerView.setLayoutManager(new GridLayoutManager(getActivity(), 1));
|
||||
recyclerView.setPadding(0, getTopPadding(), 0, getBottomPadding());
|
||||
recyclerView.setAdapter(new ArtistAdapter(getActivity()));
|
||||
protected RecyclerView.LayoutManager getLayoutManager() {
|
||||
return new GridLayoutManager(getActivity(), 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableViews() {
|
||||
super.enableViews();
|
||||
recyclerView.setEnabled(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableViews() {
|
||||
super.disableViews();
|
||||
recyclerView.setEnabled(false);
|
||||
protected RecyclerView.Adapter getAdapter() {
|
||||
return new ArtistAdapter(getActivity());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,55 +1,27 @@
|
|||
package com.kabouzeid.gramophone.ui.fragments.mainactivityfragments;
|
||||
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.widget.GridLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.kabouzeid.gramophone.R;
|
||||
import com.kabouzeid.gramophone.adapter.PlaylistAdapter;
|
||||
|
||||
public class PlaylistViewFragment extends AbsMainActivityFragment {
|
||||
public class PlaylistViewFragment extends AbsMainActivityRecyclerViewFragment {
|
||||
public static final String TAG = PlaylistViewFragment.class.getSimpleName();
|
||||
|
||||
private RecyclerView recyclerView;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.fragment_playlist_view, container, false);
|
||||
protected int getLayoutResId() {
|
||||
return R.layout.fragment_playlist_view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(View view, Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
recyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);
|
||||
setUpRecyclerView();
|
||||
}
|
||||
|
||||
private void setUpRecyclerView() {
|
||||
recyclerView.setLayoutManager(new GridLayoutManager(getActivity(), 1));
|
||||
recyclerView.setPadding(0, getTopPadding(), 0, getBottomPadding());
|
||||
setUpAdapter();
|
||||
}
|
||||
|
||||
private void setUpAdapter() {
|
||||
if (recyclerView != null) {
|
||||
PlaylistAdapter adapter = new PlaylistAdapter(getActivity());
|
||||
recyclerView.setAdapter(adapter);
|
||||
}
|
||||
protected RecyclerView.LayoutManager getLayoutManager() {
|
||||
return new GridLayoutManager(getActivity(), 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableViews() {
|
||||
super.enableViews();
|
||||
recyclerView.setEnabled(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableViews() {
|
||||
super.disableViews();
|
||||
recyclerView.setEnabled(false);
|
||||
protected RecyclerView.Adapter getAdapter() {
|
||||
return new PlaylistAdapter(getActivity());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package com.kabouzeid.gramophone.view;
|
||||
package com.kabouzeid.gramophone.ui.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
|
|
@ -58,6 +58,9 @@ public final class PreferenceUtils {
|
|||
// Key used to en or disable the colored navigation bar
|
||||
public static final String PLAYBACK_CONTROLLER_BOX = "playback_controller_card";
|
||||
|
||||
/* Saves the last page the pager was on in {@link MainActivity} */
|
||||
public static final String TRANSPARENT_TOOLBAR = "transparent_toolbar";
|
||||
|
||||
private static PreferenceUtils sInstance;
|
||||
|
||||
private final SharedPreferences mPreferences;
|
||||
|
|
@ -182,6 +185,16 @@ public final class PreferenceUtils {
|
|||
editor.apply();
|
||||
}
|
||||
|
||||
public final boolean transparentToolbar() {
|
||||
return mPreferences.getBoolean(TRANSPARENT_TOOLBAR, true);
|
||||
}
|
||||
|
||||
public void setTransparentToolbar(final boolean value) {
|
||||
final SharedPreferences.Editor editor = mPreferences.edit();
|
||||
editor.putBoolean(TRANSPARENT_TOOLBAR, value);
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
public final boolean downloadMissingArtistImages() {
|
||||
return mPreferences.getBoolean(DOWNLOAD_MISSING_ARTIST_IMAGES, true);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue