aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/fragments/SearchFragment.java4
-rw-r--r--app/src/main/java/github/daneren2005/dsub/fragments/SelectPodcastsFragment.java4
-rw-r--r--app/src/main/java/github/daneren2005/dsub/fragments/SubsonicFragment.java8
3 files changed, 8 insertions, 8 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/SearchFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/SearchFragment.java
index 5c659a6a..9a7823a5 100644
--- a/app/src/main/java/github/daneren2005/dsub/fragments/SearchFragment.java
+++ b/app/src/main/java/github/daneren2005/dsub/fragments/SearchFragment.java
@@ -108,13 +108,13 @@ public class SearchFragment extends SubsonicFragment implements SectionAdapter.O
}
@Override
- public GridLayoutManager.SpanSizeLookup getSpanSizeLookup() {
+ public GridLayoutManager.SpanSizeLookup getSpanSizeLookup(final GridLayoutManager gridLayoutManager) {
return new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
int viewType = adapter.getItemViewType(position);
if(viewType == EntryGridAdapter.VIEW_TYPE_SONG || viewType == EntryGridAdapter.VIEW_TYPE_HEADER || viewType == ArtistAdapter.VIEW_TYPE_ARTIST) {
- return getRecyclerColumnCount();
+ return gridLayoutManager.getSpanCount();
} else {
return 1;
}
diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/SelectPodcastsFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/SelectPodcastsFragment.java
index a6975725..37fc21cc 100644
--- a/app/src/main/java/github/daneren2005/dsub/fragments/SelectPodcastsFragment.java
+++ b/app/src/main/java/github/daneren2005/dsub/fragments/SelectPodcastsFragment.java
@@ -251,7 +251,7 @@ public class SelectPodcastsFragment extends SelectRecyclerFragment<Serializable>
}
@Override
- public GridLayoutManager.SpanSizeLookup getSpanSizeLookup() {
+ public GridLayoutManager.SpanSizeLookup getSpanSizeLookup(final GridLayoutManager gridLayoutManager) {
return new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
@@ -259,7 +259,7 @@ public class SelectPodcastsFragment extends SelectRecyclerFragment<Serializable>
if(adapter != null) {
int viewType = getCurrentAdapter().getItemViewType(position);
if (viewType == SectionAdapter.VIEW_TYPE_HEADER || viewType == PodcastChannelAdapter.VIEW_TYPE_PODCAST_EPISODE || viewType == PodcastChannelAdapter.VIEW_TYPE_PODCAST_LEGACY) {
- return getRecyclerColumnCount();
+ return gridLayoutManager.getSpanCount();
} else {
return 1;
}
diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/SubsonicFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/SubsonicFragment.java
index 0cb433c2..a7896763 100644
--- a/app/src/main/java/github/daneren2005/dsub/fragments/SubsonicFragment.java
+++ b/app/src/main/java/github/daneren2005/dsub/fragments/SubsonicFragment.java
@@ -662,7 +662,7 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR
final int columns = getRecyclerColumnCount();
GridLayoutManager gridLayoutManager = new GridLayoutManager(context, columns);
- GridLayoutManager.SpanSizeLookup spanSizeLookup = getSpanSizeLookup();
+ GridLayoutManager.SpanSizeLookup spanSizeLookup = getSpanSizeLookup(gridLayoutManager);
if(spanSizeLookup != null) {
gridLayoutManager.setSpanSizeLookup(spanSizeLookup);
}
@@ -677,15 +677,15 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
return layoutManager;
}
- public GridLayoutManager.SpanSizeLookup getSpanSizeLookup() {
+ public GridLayoutManager.SpanSizeLookup getSpanSizeLookup(final GridLayoutManager gridLayoutManager) {
return new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
SectionAdapter adapter = getCurrentAdapter();
if(adapter != null) {
- int viewType = getCurrentAdapter().getItemViewType(position);
+ int viewType = adapter.getItemViewType(position);
if (viewType == SectionAdapter.VIEW_TYPE_HEADER) {
- return getRecyclerColumnCount();
+ return gridLayoutManager.getSpanCount();
} else {
return 1;
}