Merge pull request #1889 from mfietz/issue/1886-indicate-played

All Episodes/Favorites: Indicate played episodes
This commit is contained in:
Tom Hennen 2016-04-25 08:47:52 -04:00
commit c3808e2c24
2 changed files with 9 additions and 0 deletions

View File

@ -15,6 +15,7 @@ import android.view.ViewGroup;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import android.widget.ImageButton; import android.widget.ImageButton;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar; import android.widget.ProgressBar;
import android.widget.TextView; import android.widget.TextView;
@ -81,6 +82,7 @@ public class AllEpisodesRecycleAdapter extends RecyclerView.Adapter<AllEpisodesR
.inflate(R.layout.new_episodes_listitem, parent, false); .inflate(R.layout.new_episodes_listitem, parent, false);
Holder holder = new Holder(view); Holder holder = new Holder(view);
holder.container = (FrameLayout) view.findViewById(R.id.container); holder.container = (FrameLayout) view.findViewById(R.id.container);
holder.content = (LinearLayout) view.findViewById(R.id.content);
holder.placeholder = (TextView) view.findViewById(R.id.txtvPlaceholder); holder.placeholder = (TextView) view.findViewById(R.id.txtvPlaceholder);
holder.title = (TextView) view.findViewById(R.id.txtvTitle); holder.title = (TextView) view.findViewById(R.id.txtvTitle);
if(Build.VERSION.SDK_INT >= 23) { if(Build.VERSION.SDK_INT >= 23) {
@ -126,6 +128,11 @@ public class AllEpisodesRecycleAdapter extends RecyclerView.Adapter<AllEpisodesR
} else { } else {
holder.statusUnread.setVisibility(View.VISIBLE); holder.statusUnread.setVisibility(View.VISIBLE);
} }
if(item.isPlayed()) {
ViewHelper.setAlpha(holder.content, 0.5f);
} else {
ViewHelper.setAlpha(holder.content, 1.0f);
}
FeedMedia media = item.getMedia(); FeedMedia media = item.getMedia();
if (media != null) { if (media != null) {
@ -233,6 +240,7 @@ public class AllEpisodesRecycleAdapter extends RecyclerView.Adapter<AllEpisodesR
implements View.OnClickListener, implements View.OnClickListener,
View.OnCreateContextMenuListener, View.OnCreateContextMenuListener,
ItemTouchHelperViewHolder { ItemTouchHelperViewHolder {
LinearLayout content;
FrameLayout container; FrameLayout container;
TextView placeholder; TextView placeholder;
TextView title; TextView title;

View File

@ -8,6 +8,7 @@
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<LinearLayout <LinearLayout
android:id="@+id/content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/listitem_threeline_height" android:layout_height="@dimen/listitem_threeline_height"
android:background="?attr/selectableItemBackground" android:background="?attr/selectableItemBackground"