summaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
Diffstat (limited to 'app/src')
-rw-r--r--app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java14
-rw-r--r--app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java18
-rw-r--r--app/src/main/java/de/danoeh/antennapod/adapter/QueueRecyclerAdapter.java16
-rw-r--r--app/src/main/res/layout/feeditemlist_item.xml9
-rw-r--r--app/src/main/res/layout/new_episodes_listitem.xml14
-rw-r--r--app/src/main/res/layout/queue_listitem.xml13
6 files changed, 72 insertions, 12 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java
index bda70ba6a..6f96e2370 100644
--- a/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java
+++ b/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java
@@ -15,6 +15,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.ImageView;
+import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
@@ -54,6 +55,9 @@ public class AllEpisodesRecycleAdapter extends RecyclerView.Adapter<AllEpisodesR
private int position = -1;
+ private final int playingBackGroundColor;
+ private final int normalBackGroundColor;
+
public AllEpisodesRecycleAdapter(Context context,
MainActivity mainActivity,
ItemAccess itemAccess,
@@ -66,6 +70,9 @@ public class AllEpisodesRecycleAdapter extends RecyclerView.Adapter<AllEpisodesR
this.actionButtonUtils = new ActionButtonUtils(context);
this.actionButtonCallback = actionButtonCallback;
this.showOnlyNewEpisodes = showOnlyNewEpisodes;
+
+ playingBackGroundColor = context.getResources().getColor(R.color.blue_bg);
+ normalBackGroundColor = context.getResources().getColor(android.R.color.transparent);
}
@Override
@@ -73,6 +80,7 @@ public class AllEpisodesRecycleAdapter extends RecyclerView.Adapter<AllEpisodesR
View view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.new_episodes_listitem, parent, false);
Holder holder = new Holder(view);
+ holder.container = (LinearLayout) view.findViewById(R.id.container);
holder.placeholder = (TextView) view.findViewById(R.id.txtvPlaceholder);
holder.title = (TextView) view.findViewById(R.id.txtvTitle);
holder.pubDate = (TextView) view
@@ -158,6 +166,11 @@ public class AllEpisodesRecycleAdapter extends RecyclerView.Adapter<AllEpisodesR
holder.progress.setVisibility(View.GONE);
}
+ if(media.isCurrentlyPlaying()) {
+ holder.container.setBackgroundColor(playingBackGroundColor);
+ } else {
+ holder.container.setBackgroundColor(normalBackGroundColor);
+ }
} else {
holder.progress.setVisibility(View.GONE);
holder.txtvDuration.setVisibility(View.GONE);
@@ -253,6 +266,7 @@ public class AllEpisodesRecycleAdapter extends RecyclerView.Adapter<AllEpisodesR
implements View.OnClickListener,
View.OnCreateContextMenuListener,
ItemTouchHelperViewHolder {
+ LinearLayout container;
TextView placeholder;
TextView title;
TextView pubDate;
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 c6c158943..14660bd87 100644
--- a/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java
+++ b/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java
@@ -11,6 +11,7 @@ import android.widget.Adapter;
import android.widget.BaseAdapter;
import android.widget.ImageButton;
import android.widget.ImageView;
+import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
@@ -39,6 +40,9 @@ public class FeedItemlistAdapter extends BaseAdapter {
public static final int SELECTION_NONE = -1;
+ private final int playingBackGroundColor;
+ private final int normalBackGroundColor;
+
public FeedItemlistAdapter(Context context,
ItemAccess itemAccess,
ActionButtonCallback callback,
@@ -52,6 +56,9 @@ public class FeedItemlistAdapter extends BaseAdapter {
this.selectedItemIndex = SELECTION_NONE;
this.actionButtonUtils = new ActionButtonUtils(context);
this.makePlayedItemsTransparent = makePlayedItemsTransparent;
+
+ playingBackGroundColor = context.getResources().getColor(R.color.blue_bg);
+ normalBackGroundColor = context.getResources().getColor(android.R.color.transparent);
}
@Override
@@ -80,6 +87,8 @@ public class FeedItemlistAdapter extends BaseAdapter {
LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = inflater.inflate(R.layout.feeditemlist_item, parent, false);
+ holder.container = (LinearLayout) convertView
+ .findViewById(R.id.container);
holder.title = (TextView) convertView
.findViewById(R.id.txtvItemname);
holder.lenSize = (TextView) convertView
@@ -174,6 +183,14 @@ public class FeedItemlistAdapter extends BaseAdapter {
holder.type.setImageBitmap(null);
holder.type.setVisibility(View.GONE);
}
+
+ if(media.isCurrentlyPlaying()) {
+ if(media.isCurrentlyPlaying()) {
+ holder.container.setBackgroundColor(playingBackGroundColor);
+ } else {
+ holder.container.setBackgroundColor(normalBackGroundColor);
+ }
+ }
}
boolean isInQueue = itemAccess.isInQueue(item);
@@ -197,6 +214,7 @@ public class FeedItemlistAdapter extends BaseAdapter {
};
static class Holder {
+ LinearLayout container;
TextView title;
TextView published;
TextView lenSize;
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/QueueRecyclerAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/QueueRecyclerAdapter.java
index 3326cc859..7ec37c1c3 100644
--- a/app/src/main/java/de/danoeh/antennapod/adapter/QueueRecyclerAdapter.java
+++ b/app/src/main/java/de/danoeh/antennapod/adapter/QueueRecyclerAdapter.java
@@ -17,6 +17,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.ImageView;
+import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
@@ -59,6 +60,9 @@ public class QueueRecyclerAdapter extends RecyclerView.Adapter<QueueRecyclerAdap
private FeedItem selectedItem;
+ private final int playingBackGroundColor;
+ private final int normalBackGroundColor;
+
public QueueRecyclerAdapter(MainActivity mainActivity,
ItemAccess itemAccess,
ActionButtonCallback actionButtonCallback,
@@ -70,6 +74,9 @@ public class QueueRecyclerAdapter extends RecyclerView.Adapter<QueueRecyclerAdap
this.actionButtonCallback = actionButtonCallback;
this.itemTouchHelper = itemTouchHelper;
locked = UserPreferences.isQueueLocked();
+
+ playingBackGroundColor = mainActivity.getResources().getColor(R.color.blue_bg);
+ normalBackGroundColor = mainActivity.getResources().getColor(android.R.color.transparent);
}
public void setLocked(boolean locked) {
@@ -105,6 +112,7 @@ public class QueueRecyclerAdapter extends RecyclerView.Adapter<QueueRecyclerAdap
View.OnCreateContextMenuListener,
ItemTouchHelperViewHolder {
+ private final LinearLayout container;
private final ImageView dragHandle;
private final TextView placeholder;
private final ImageView cover;
@@ -119,6 +127,7 @@ public class QueueRecyclerAdapter extends RecyclerView.Adapter<QueueRecyclerAdap
public ViewHolder(View v) {
super(v);
+ container = (LinearLayout) v.findViewById(R.id.container);
dragHandle = (ImageView) v.findViewById(R.id.drag_handle);
placeholder = (TextView) v.findViewById(R.id.txtvPlaceholder);
cover = (ImageView) v.findViewById(R.id.imgvCover);
@@ -246,6 +255,12 @@ public class QueueRecyclerAdapter extends RecyclerView.Adapter<QueueRecyclerAdap
progressRight.setText(Converter.getDurationStringLong(media.getDuration()));
progressBar.setVisibility(View.GONE);
}
+
+ if(media.isCurrentlyPlaying()) {
+ container.setBackgroundColor(playingBackGroundColor);
+ } else {
+ container.setBackgroundColor(normalBackGroundColor);
+ }
}
actionButtonUtils.configureActionButton(butSecondary, item, true);
@@ -261,7 +276,6 @@ public class QueueRecyclerAdapter extends RecyclerView.Adapter<QueueRecyclerAdap
.into(new CoverTarget(item.getFeed().getImageUri(), placeholder, cover));
}
-
}
diff --git a/app/src/main/res/layout/feeditemlist_item.xml b/app/src/main/res/layout/feeditemlist_item.xml
index 6b7c45978..d2b85e7df 100644
--- a/app/src/main/res/layout/feeditemlist_item.xml
+++ b/app/src/main/res/layout/feeditemlist_item.xml
@@ -1,14 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="@dimen/listitem_threeline_height"
android:orientation="horizontal"
tools:background="@android:color/darker_gray">
<RelativeLayout
-
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/listitem_threeline_horizontalpadding"
@@ -103,12 +104,10 @@
android:indeterminate="false"
/>
-
-
</RelativeLayout>
<include layout="@layout/vertical_list_divider"/>
<include layout="@layout/secondary_action"/>
-</LinearLayout> \ No newline at end of file
+</LinearLayout>
diff --git a/app/src/main/res/layout/new_episodes_listitem.xml b/app/src/main/res/layout/new_episodes_listitem.xml
index 7a5652c45..e55274aca 100644
--- a/app/src/main/res/layout/new_episodes_listitem.xml
+++ b/app/src/main/res/layout/new_episodes_listitem.xml
@@ -1,11 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<FrameLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="?attr/selectableItemBackground">
+
+<LinearLayout
+ android:id="@+id/container"
+ android:layout_width="match_parent"
android:layout_height="@dimen/listitem_threeline_height"
android:orientation="horizontal"
- android:background="?attr/selectableItemBackground"
tools:background="@android:color/darker_gray">
<RelativeLayout
@@ -127,4 +133,6 @@
<include layout="@layout/secondary_action" />
-</LinearLayout> \ No newline at end of file
+</LinearLayout>
+
+</FrameLayout>
diff --git a/app/src/main/res/layout/queue_listitem.xml b/app/src/main/res/layout/queue_listitem.xml
index 8572f5e05..554b3478d 100644
--- a/app/src/main/res/layout/queue_listitem.xml
+++ b/app/src/main/res/layout/queue_listitem.xml
@@ -1,14 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout
+<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="?attr/selectableItemBackground">
+
+<LinearLayout
+ android:id="@+id/container"
+ android:layout_width="match_parent"
android:layout_height="@dimen/listitem_threeline_height"
android:orientation="horizontal"
android:paddingLeft="8dp"
android:gravity="center_vertical"
- android:background="?attr/selectableItemBackground"
tools:background="@android:color/darker_gray" >
<ImageView
@@ -135,4 +140,6 @@
<include layout="@layout/secondary_action"/>
-</LinearLayout> \ No newline at end of file
+</LinearLayout>
+
+</FrameLayout>