Removed unused color resource
This commit is contained in:
parent
a6e131a542
commit
bb72636c68
|
@ -1,7 +1,6 @@
|
||||||
package de.danoeh.antennapod.adapter;
|
package de.danoeh.antennapod.adapter;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.support.v4.content.ContextCompat;
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
@ -15,20 +14,15 @@ import de.danoeh.antennapod.core.service.download.DownloadRequest;
|
||||||
import de.danoeh.antennapod.core.service.download.DownloadStatus;
|
import de.danoeh.antennapod.core.service.download.DownloadStatus;
|
||||||
import de.danoeh.antennapod.core.service.download.Downloader;
|
import de.danoeh.antennapod.core.service.download.Downloader;
|
||||||
import de.danoeh.antennapod.core.util.Converter;
|
import de.danoeh.antennapod.core.util.Converter;
|
||||||
import de.danoeh.antennapod.core.util.ThemeUtils;
|
|
||||||
|
|
||||||
public class DownloadlistAdapter extends BaseAdapter {
|
public class DownloadlistAdapter extends BaseAdapter {
|
||||||
|
|
||||||
private static final int SELECTION_NONE = -1;
|
|
||||||
|
|
||||||
private int selectedItemIndex;
|
|
||||||
private final ItemAccess itemAccess;
|
private final ItemAccess itemAccess;
|
||||||
private final Context context;
|
private final Context context;
|
||||||
|
|
||||||
public DownloadlistAdapter(Context context,
|
public DownloadlistAdapter(Context context,
|
||||||
ItemAccess itemAccess) {
|
ItemAccess itemAccess) {
|
||||||
super();
|
super();
|
||||||
this.selectedItemIndex = SELECTION_NONE;
|
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.itemAccess = itemAccess;
|
this.itemAccess = itemAccess;
|
||||||
}
|
}
|
||||||
|
@ -74,13 +68,6 @@ public class DownloadlistAdapter extends BaseAdapter {
|
||||||
holder = (Holder) convertView.getTag();
|
holder = (Holder) convertView.getTag();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (position == selectedItemIndex) {
|
|
||||||
convertView.setBackgroundColor(ContextCompat.getColor(convertView.getContext(),
|
|
||||||
ThemeUtils.getSelectionBackgroundColor()));
|
|
||||||
} else {
|
|
||||||
convertView.setBackgroundResource(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
holder.title.setText(request.getTitle());
|
holder.title.setText(request.getTitle());
|
||||||
|
|
||||||
holder.progbar.setIndeterminate(request.getSoFar() <= 0);
|
holder.progbar.setIndeterminate(request.getSoFar() <= 0);
|
||||||
|
|
|
@ -34,12 +34,8 @@ public class FeedItemlistAdapter extends BaseAdapter {
|
||||||
private final ItemAccess itemAccess;
|
private final ItemAccess itemAccess;
|
||||||
private final Context context;
|
private final Context context;
|
||||||
private final boolean showFeedtitle;
|
private final boolean showFeedtitle;
|
||||||
private final int selectedItemIndex;
|
|
||||||
/** true if played items should be made partially transparent */
|
/** true if played items should be made partially transparent */
|
||||||
private final boolean makePlayedItemsTransparent;
|
private final boolean makePlayedItemsTransparent;
|
||||||
|
|
||||||
private static final int SELECTION_NONE = -1;
|
|
||||||
|
|
||||||
private final int playingBackGroundColor;
|
private final int playingBackGroundColor;
|
||||||
private final int normalBackGroundColor;
|
private final int normalBackGroundColor;
|
||||||
|
|
||||||
|
@ -51,7 +47,6 @@ public class FeedItemlistAdapter extends BaseAdapter {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.itemAccess = itemAccess;
|
this.itemAccess = itemAccess;
|
||||||
this.showFeedtitle = showFeedtitle;
|
this.showFeedtitle = showFeedtitle;
|
||||||
this.selectedItemIndex = SELECTION_NONE;
|
|
||||||
this.makePlayedItemsTransparent = makePlayedItemsTransparent;
|
this.makePlayedItemsTransparent = makePlayedItemsTransparent;
|
||||||
|
|
||||||
playingBackGroundColor = ThemeUtils.getColorFromAttr(context, R.attr.currently_playing_background);
|
playingBackGroundColor = ThemeUtils.getColorFromAttr(context, R.attr.currently_playing_background);
|
||||||
|
@ -112,12 +107,6 @@ public class FeedItemlistAdapter extends BaseAdapter {
|
||||||
|
|
||||||
if (!(getItemViewType(position) == Adapter.IGNORE_ITEM_VIEW_TYPE)) {
|
if (!(getItemViewType(position) == Adapter.IGNORE_ITEM_VIEW_TYPE)) {
|
||||||
convertView.setVisibility(View.VISIBLE);
|
convertView.setVisibility(View.VISIBLE);
|
||||||
if (position == selectedItemIndex) {
|
|
||||||
convertView.setBackgroundColor(ContextCompat.getColor(convertView.getContext(),
|
|
||||||
ThemeUtils.getSelectionBackgroundColor()));
|
|
||||||
} else {
|
|
||||||
convertView.setBackgroundResource(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
StringBuilder buffer = new StringBuilder(item.getTitle());
|
StringBuilder buffer = new StringBuilder(item.getTitle());
|
||||||
if (showFeedtitle) {
|
if (showFeedtitle) {
|
||||||
|
|
|
@ -3,30 +3,11 @@ package de.danoeh.antennapod.core.util;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.support.annotation.AttrRes;
|
import android.support.annotation.AttrRes;
|
||||||
import android.support.annotation.ColorInt;
|
import android.support.annotation.ColorInt;
|
||||||
import android.util.Log;
|
|
||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
|
|
||||||
import de.danoeh.antennapod.core.R;
|
|
||||||
import de.danoeh.antennapod.core.preferences.UserPreferences;
|
|
||||||
|
|
||||||
public class ThemeUtils {
|
public class ThemeUtils {
|
||||||
private ThemeUtils(){}
|
private ThemeUtils() {
|
||||||
|
|
||||||
private static final String TAG = "ThemeUtils";
|
|
||||||
|
|
||||||
public static int getSelectionBackgroundColor() {
|
|
||||||
int theme = UserPreferences.getTheme();
|
|
||||||
if (theme == R.style.Theme_AntennaPod_Dark) {
|
|
||||||
return R.color.selection_background_color_dark;
|
|
||||||
} else if (theme == R.style.Theme_AntennaPod_TrueBlack){
|
|
||||||
return R.color.selection_background_color_trueblack;
|
|
||||||
} else if (theme == R.style.Theme_AntennaPod_Light) {
|
|
||||||
return R.color.selection_background_color_light;
|
|
||||||
} else {
|
|
||||||
Log.e(TAG,
|
|
||||||
"getSelectionBackgroundColor could not match the current theme to any color!");
|
|
||||||
return R.color.selection_background_color_light;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static @ColorInt int getColorFromAttr(Context context, @AttrRes int attr) {
|
public static @ColorInt int getColorFromAttr(Context context, @AttrRes int attr) {
|
||||||
|
|
|
@ -22,10 +22,6 @@
|
||||||
<color name="image_readability_tint">#80000000</color>
|
<color name="image_readability_tint">#80000000</color>
|
||||||
<color name="feed_image_bg">#50000000</color>
|
<color name="feed_image_bg">#50000000</color>
|
||||||
|
|
||||||
<color name="selection_background_color_trueblack">#286E8A</color>
|
|
||||||
<color name="selection_background_color_dark">#286E8A</color>
|
|
||||||
<color name="selection_background_color_light">#81CFEA</color>
|
|
||||||
|
|
||||||
<!-- Theme colors -->
|
<!-- Theme colors -->
|
||||||
<color name="primary_light">#FFFFFF</color>
|
<color name="primary_light">#FFFFFF</color>
|
||||||
<color name="primary_darktheme">#212121</color>
|
<color name="primary_darktheme">#212121</color>
|
||||||
|
|
Loading…
Reference in New Issue