diff options
author | H. Lehmann <ByteHamster@users.noreply.github.com> | 2019-09-10 23:57:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-10 23:57:53 +0200 |
commit | eedd3ce7550fc6bae78a56dc1aa2e86e3ab4ddd3 (patch) | |
tree | a0826b85dfe73cd618f1262ae733d2c7fc4e5b1e | |
parent | 16c97535abb9baff1fde0be94e7910c559ce0d0a (diff) | |
parent | bb72636c6838e2415af4458b8932a899a1197a59 (diff) | |
download | AntennaPod-eedd3ce7550fc6bae78a56dc1aa2e86e3ab4ddd3.zip |
Merge pull request #3399 from ByteHamster/remove-unused-color
Removed unused color resource
4 files changed, 1 insertions, 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 static final String TAG = "ThemeUtils"; + private 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 @@ <color name="image_readability_tint">#80000000</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 --> <color name="primary_light">#FFFFFF</color> <color name="primary_darktheme">#212121</color> |