From bb72636c6838e2415af4458b8932a899a1197a59 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Mon, 9 Sep 2019 19:31:28 +0200 Subject: [PATCH] Removed unused color resource --- .../adapter/DownloadlistAdapter.java | 13 ------------ .../adapter/FeedItemlistAdapter.java | 11 ---------- .../antennapod/core/util/ThemeUtils.java | 21 +------------------ core/src/main/res/values/colors.xml | 4 ---- 4 files changed, 1 insertion(+), 48 deletions(-) diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/DownloadlistAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/DownloadlistAdapter.java index b85d1d35d..b0ee87b7e 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/DownloadlistAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/DownloadlistAdapter.java @@ -1,7 +1,6 @@ package de.danoeh.antennapod.adapter; import android.content.Context; -import android.support.v4.content.ContextCompat; import android.view.LayoutInflater; import android.view.View; 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.Downloader; import de.danoeh.antennapod.core.util.Converter; -import de.danoeh.antennapod.core.util.ThemeUtils; public class DownloadlistAdapter extends BaseAdapter { - private static final int SELECTION_NONE = -1; - - private int selectedItemIndex; private final ItemAccess itemAccess; private final Context context; public DownloadlistAdapter(Context context, ItemAccess itemAccess) { super(); - this.selectedItemIndex = SELECTION_NONE; this.context = context; this.itemAccess = itemAccess; } @@ -74,13 +68,6 @@ public class DownloadlistAdapter extends BaseAdapter { 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.progbar.setIndeterminate(request.getSoFar() <= 0); diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java index a365b1b2e..d090bc4b1 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java @@ -34,12 +34,8 @@ public class FeedItemlistAdapter extends BaseAdapter { private final ItemAccess itemAccess; private final Context context; private final boolean showFeedtitle; - private final int selectedItemIndex; /** true if played items should be made partially transparent */ private final boolean makePlayedItemsTransparent; - - private static final int SELECTION_NONE = -1; - private final int playingBackGroundColor; private final int normalBackGroundColor; @@ -51,7 +47,6 @@ public class FeedItemlistAdapter extends BaseAdapter { this.context = context; this.itemAccess = itemAccess; this.showFeedtitle = showFeedtitle; - this.selectedItemIndex = SELECTION_NONE; this.makePlayedItemsTransparent = makePlayedItemsTransparent; 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)) { 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()); if (showFeedtitle) { diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/ThemeUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/ThemeUtils.java index 14f091249..1da7a5c50 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/ThemeUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/ThemeUtils.java @@ -3,30 +3,11 @@ package de.danoeh.antennapod.core.util; import android.content.Context; import android.support.annotation.AttrRes; import android.support.annotation.ColorInt; -import android.util.Log; import android.util.TypedValue; -import de.danoeh.antennapod.core.R; -import de.danoeh.antennapod.core.preferences.UserPreferences; - 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) { diff --git a/core/src/main/res/values/colors.xml b/core/src/main/res/values/colors.xml index 5d820f3cf..0e4533977 100644 --- a/core/src/main/res/values/colors.xml +++ b/core/src/main/res/values/colors.xml @@ -22,10 +22,6 @@ #80000000 #50000000 - #286E8A - #286E8A - #81CFEA - #FFFFFF #212121