Revert "Smart playlist decoration (#619)"
This reverts commit e461f44ff0.
This commit is contained in:
parent
2cf8fe3d89
commit
a594551ce2
8 changed files with 15 additions and 118 deletions
|
|
@ -84,15 +84,6 @@ public class PlaylistAdapter extends AbsMultiSelectAdapter<PlaylistAdapter.ViewH
|
|||
return new ViewHolder(view, viewType);
|
||||
}
|
||||
|
||||
protected String getPlaylistTitle(Playlist playlist) {
|
||||
return playlist.name;
|
||||
}
|
||||
|
||||
protected String getPlaylistText(Playlist playlist) {
|
||||
Context context = App.getInstance().getApplicationContext();
|
||||
return playlist.getInfoString(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
final Playlist playlist = dataSet.get(position);
|
||||
|
|
@ -100,10 +91,7 @@ public class PlaylistAdapter extends AbsMultiSelectAdapter<PlaylistAdapter.ViewH
|
|||
holder.itemView.setActivated(isChecked(playlist));
|
||||
|
||||
if (holder.title != null) {
|
||||
holder.title.setText(getPlaylistTitle(playlist));
|
||||
}
|
||||
if (holder.text != null) {
|
||||
holder.text.setText(getPlaylistText(playlist));
|
||||
holder.title.setText(playlist.name);
|
||||
}
|
||||
|
||||
if (holder.getAdapterPosition() == getItemCount() - 1) {
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@ public class PlayingQueueAdapter extends SongAdapter implements DraggableItemAda
|
|||
if (holder.imageText != null) {
|
||||
holder.imageText.setText(String.valueOf(position - current));
|
||||
}
|
||||
|
||||
if (holder.getItemViewType() == HISTORY || holder.getItemViewType() == CURRENT) {
|
||||
setAlpha(holder, 0.5f);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,8 +4,6 @@ import android.content.Context;
|
|||
import android.os.Parcel;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.kabouzeid.gramophone.util.MusicUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
|
|
@ -26,16 +24,4 @@ public abstract class AbsCustomPlaylist extends Playlist {
|
|||
|
||||
@NonNull
|
||||
public abstract ArrayList<Song> getSongs(Context context);
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String getInfoString(@NonNull Context context) {
|
||||
int songCount = getSongs(context).size();
|
||||
String songCountString = MusicUtil.getSongCountString(context, songCount);
|
||||
|
||||
return MusicUtil.buildInfoString(
|
||||
songCountString,
|
||||
super.getInfoString(context)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package com.kabouzeid.gramophone.model;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import androidx.annotation.NonNull;
|
||||
|
|
@ -22,11 +21,6 @@ public class Playlist implements Parcelable {
|
|||
this.name = "";
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public String getInfoString(@NonNull Context context) {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
|
|
|
|||
|
|
@ -4,11 +4,10 @@ import android.content.Context;
|
|||
import android.os.Parcel;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.kabouzeid.gramophone.R;
|
||||
import com.kabouzeid.gramophone.loader.TopAndRecentlyPlayedTracksLoader;
|
||||
import com.kabouzeid.gramophone.model.Song;
|
||||
import com.kabouzeid.gramophone.provider.HistoryStore;
|
||||
import com.kabouzeid.gramophone.util.MusicUtil;
|
||||
import com.kabouzeid.gramophone.R;
|
||||
import com.kabouzeid.gramophone.util.PreferenceUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
|
@ -22,17 +21,6 @@ public class HistoryPlaylist extends AbsSmartPlaylist {
|
|||
super(context.getString(R.string.history), R.drawable.ic_access_time_white_24dp);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String getInfoString(@NonNull Context context) {
|
||||
String cutoff = PreferenceUtil.getInstance(context).getRecentlyPlayedCutoffText(context);
|
||||
|
||||
return MusicUtil.buildInfoString(
|
||||
cutoff,
|
||||
super.getInfoString(context)
|
||||
);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ArrayList<Song> getSongs(@NonNull Context context) {
|
||||
|
|
|
|||
|
|
@ -4,10 +4,9 @@ import android.content.Context;
|
|||
import android.os.Parcel;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.kabouzeid.gramophone.R;
|
||||
import com.kabouzeid.gramophone.loader.LastAddedLoader;
|
||||
import com.kabouzeid.gramophone.model.Song;
|
||||
import com.kabouzeid.gramophone.util.MusicUtil;
|
||||
import com.kabouzeid.gramophone.R;
|
||||
import com.kabouzeid.gramophone.util.PreferenceUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
|
@ -21,17 +20,6 @@ public class LastAddedPlaylist extends AbsSmartPlaylist {
|
|||
super(context.getString(R.string.last_added), R.drawable.ic_library_add_white_24dp);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String getInfoString(@NonNull Context context) {
|
||||
String cutoff = PreferenceUtil.getInstance(context).getLastAddedCutoffText(context);
|
||||
|
||||
return MusicUtil.buildInfoString(
|
||||
cutoff,
|
||||
super.getInfoString(context)
|
||||
);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ArrayList<Song> getSongs(@NonNull Context context) {
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import androidx.annotation.StyleRes;
|
|||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonSyntaxException;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import com.kabouzeid.gramophone.R;
|
||||
import com.kabouzeid.gramophone.helper.SortOrder;
|
||||
import com.kabouzeid.gramophone.model.CategoryInfo;
|
||||
|
|
@ -317,37 +318,6 @@ public final class PreferenceUtil {
|
|||
return (System.currentTimeMillis() - interval) / 1000;
|
||||
}
|
||||
|
||||
public String getLastAddedCutoffText(Context context) {
|
||||
return getCutoffText(LAST_ADDED_CUTOFF, context);
|
||||
}
|
||||
|
||||
public String getRecentlyPlayedCutoffText(Context context) {
|
||||
return getCutoffText(RECENTLY_PLAYED_CUTOFF, context);
|
||||
}
|
||||
|
||||
private String getCutoffText(final String cutoff, Context context) {
|
||||
switch (mPreferences.getString(cutoff, "")) {
|
||||
case "today":
|
||||
return context.getString(R.string.today);
|
||||
|
||||
case "this_week":
|
||||
return context.getString(R.string.this_week);
|
||||
|
||||
case "past_seven_days":
|
||||
return context.getString(R.string.past_seven_days);
|
||||
|
||||
case "past_three_months":
|
||||
return context.getString(R.string.past_three_months);
|
||||
|
||||
case "this_year":
|
||||
return context.getString(R.string.this_year);
|
||||
|
||||
case "this_month":
|
||||
default:
|
||||
return context.getString(R.string.this_month);
|
||||
}
|
||||
}
|
||||
|
||||
public int getLastSleepTimerValue() {
|
||||
return mPreferences.getInt(LAST_SLEEP_TIMER_VALUE, 30);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,35 +54,19 @@
|
|||
|
||||
</FrameLayout>
|
||||
|
||||
<LinearLayout
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:paddingEnd="0dp"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="0dp"
|
||||
android:paddingStart="16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="sans-serif"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="sans-serif"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
||||
android:textColor="?android:textColorSecondary" />
|
||||
|
||||
</LinearLayout>
|
||||
android:fontFamily="sans-serif"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" />
|
||||
|
||||
<com.kabouzeid.gramophone.views.IconImageView
|
||||
android:id="@+id/menu"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue