From 4077a554cd7a00b49c1ca88b3a7800222d6ebd10 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Fri, 18 Mar 2016 17:53:08 -0700 Subject: Add sectionIndex to onBindHeaderHolder --- app/src/main/java/github/daneren2005/dsub/adapter/ArtistAdapter.java | 2 +- .../main/java/github/daneren2005/dsub/adapter/EntryGridAdapter.java | 4 +--- app/src/main/java/github/daneren2005/dsub/adapter/MainAdapter.java | 2 +- .../java/github/daneren2005/dsub/adapter/PodcastChannelAdapter.java | 5 ++--- .../main/java/github/daneren2005/dsub/adapter/SectionAdapter.java | 4 ++-- .../main/java/github/daneren2005/dsub/adapter/SettingsAdapter.java | 5 +---- 6 files changed, 8 insertions(+), 14 deletions(-) (limited to 'app') diff --git a/app/src/main/java/github/daneren2005/dsub/adapter/ArtistAdapter.java b/app/src/main/java/github/daneren2005/dsub/adapter/ArtistAdapter.java index 5feaa482..207dc0b2 100644 --- a/app/src/main/java/github/daneren2005/dsub/adapter/ArtistAdapter.java +++ b/app/src/main/java/github/daneren2005/dsub/adapter/ArtistAdapter.java @@ -92,7 +92,7 @@ public class ArtistAdapter extends SectionAdapter implements FastScrolle return new UpdateView.UpdateViewHolder(header, false); } @Override - public void onBindHeaderHolder(UpdateView.UpdateViewHolder holder, String header) { + public void onBindHeaderHolder(UpdateView.UpdateViewHolder holder, String header, int sectionIndex) { TextView folderName = (TextView) holder.getView().findViewById(R.id.select_artist_folder_2); String musicFolderId = Util.getSelectedMusicFolderId(context); diff --git a/app/src/main/java/github/daneren2005/dsub/adapter/EntryGridAdapter.java b/app/src/main/java/github/daneren2005/dsub/adapter/EntryGridAdapter.java index 71e78e4b..b07d4731 100644 --- a/app/src/main/java/github/daneren2005/dsub/adapter/EntryGridAdapter.java +++ b/app/src/main/java/github/daneren2005/dsub/adapter/EntryGridAdapter.java @@ -16,14 +16,12 @@ package github.daneren2005.dsub.adapter; import android.content.Context; -import android.util.Log; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; -import java.util.ArrayList; import java.util.List; import github.daneren2005.dsub.R; @@ -96,7 +94,7 @@ public class EntryGridAdapter extends SectionAdapter { public UpdateViewHolder onCreateHeaderHolder(ViewGroup parent) { return new UpdateViewHolder(header, false); } - public void onBindHeaderHolder(UpdateViewHolder holder, String header) { + public void onBindHeaderHolder(UpdateViewHolder holder, String header, int sectionIndex) { } diff --git a/app/src/main/java/github/daneren2005/dsub/adapter/MainAdapter.java b/app/src/main/java/github/daneren2005/dsub/adapter/MainAdapter.java index 473366fe..dd70aa99 100644 --- a/app/src/main/java/github/daneren2005/dsub/adapter/MainAdapter.java +++ b/app/src/main/java/github/daneren2005/dsub/adapter/MainAdapter.java @@ -77,7 +77,7 @@ public class MainAdapter extends SectionAdapter { return new UpdateView.UpdateViewHolder(new BasicHeaderView(context, R.layout.album_list_header)); } @Override - public void onBindHeaderHolder(UpdateView.UpdateViewHolder holder, String header) { + public void onBindHeaderHolder(UpdateView.UpdateViewHolder holder, String header, int sectionIndex) { UpdateView view = holder.getUpdateView(); CheckBox checkBox = (CheckBox) view.findViewById(R.id.item_checkbox); diff --git a/app/src/main/java/github/daneren2005/dsub/adapter/PodcastChannelAdapter.java b/app/src/main/java/github/daneren2005/dsub/adapter/PodcastChannelAdapter.java index aeb98a6b..97d29407 100644 --- a/app/src/main/java/github/daneren2005/dsub/adapter/PodcastChannelAdapter.java +++ b/app/src/main/java/github/daneren2005/dsub/adapter/PodcastChannelAdapter.java @@ -131,11 +131,11 @@ public class PodcastChannelAdapter extends SectionAdapter implemen @Override public UpdateView.UpdateViewHolder onCreateHeaderHolder(ViewGroup parent) { - return new UpdateView.UpdateViewHolder(new BasicHeaderView(context, R.layout.newest_episode_header)); + return new UpdateView.UpdateViewHolder(new BasicHeaderView(context, R.layout.expandable_header)); } @Override - public void onBindHeaderHolder(UpdateView.UpdateViewHolder holder, String header) { + public void onBindHeaderHolder(UpdateView.UpdateViewHolder holder, String header, int sectionIndex) { UpdateView view = holder.getUpdateView(); ImageView toggleSelectionView = (ImageView) view.findViewById(R.id.item_select); @@ -164,7 +164,6 @@ public class PodcastChannelAdapter extends SectionAdapter implemen } ((ImageView) v).setImageResource(DrawableTint.getDrawableRes(context, selectToggleAttr)); - } }); toggleSelectionView.setImageResource(DrawableTint.getDrawableRes(context, selectToggleAttr)); diff --git a/app/src/main/java/github/daneren2005/dsub/adapter/SectionAdapter.java b/app/src/main/java/github/daneren2005/dsub/adapter/SectionAdapter.java index fbed4d7a..33bbb384 100644 --- a/app/src/main/java/github/daneren2005/dsub/adapter/SectionAdapter.java +++ b/app/src/main/java/github/daneren2005/dsub/adapter/SectionAdapter.java @@ -194,7 +194,7 @@ public abstract class SectionAdapter extends RecyclerView.Adapter section: sections) { boolean validHeader = headers.get(subHeader) != null; if(position == subPosition && validHeader) { - onBindHeaderHolder(holder, headers.get(subHeader)); + onBindHeaderHolder(holder, headers.get(subHeader), subHeader); return; } @@ -289,7 +289,7 @@ public abstract class SectionAdapter extends RecyclerView.Adapter { View header = LayoutInflater.from(context).inflate(R.layout.user_header, parent, false); return new UpdateView.UpdateViewHolder(header, false); } - public void onBindHeaderHolder(UpdateView.UpdateViewHolder holder, String description) { + public void onBindHeaderHolder(UpdateView.UpdateViewHolder holder, String description, int sectionIndex) { View header = holder.getView(); RecyclingImageView coverArtView = (RecyclingImageView) header.findViewById(R.id.user_avatar); -- cgit v1.2.3