|
|
|
@ -16,6 +16,7 @@ package app.fedilab.android.ui.pageadapter;
|
|
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
|
import android.os.Bundle;
|
|
|
|
|
import android.util.Log;
|
|
|
|
|
import android.view.ViewGroup;
|
|
|
|
|
|
|
|
|
|
import androidx.annotation.NonNull;
|
|
|
|
@ -74,10 +75,11 @@ public class FedilabPageAdapter extends FragmentStatePagerAdapter {
|
|
|
|
|
FragmentMastodonTimeline fragment = new FragmentMastodonTimeline();
|
|
|
|
|
Bundle bundle = new Bundle();
|
|
|
|
|
//Position 3 is for notifications
|
|
|
|
|
if (position < BOTTOM_TIMELINE_COUNT - toRemove) {
|
|
|
|
|
Log.v(Helper.TAG, "position: " + position + " -> " + (BOTTOM_TIMELINE_COUNT - toRemove));
|
|
|
|
|
if (position < (BOTTOM_TIMELINE_COUNT - toRemove)) {
|
|
|
|
|
if (bottomMenu != null) {
|
|
|
|
|
BottomMenu.ItemMenuType type = BottomMenu.getType(bottomMenu, position);
|
|
|
|
|
|
|
|
|
|
Log.v(Helper.TAG, "type: " + type);
|
|
|
|
|
if (type == null) {
|
|
|
|
|
return fragment;
|
|
|
|
|
}
|
|
|
|
@ -99,9 +101,10 @@ public class FedilabPageAdapter extends FragmentStatePagerAdapter {
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
int pinnedPosition = position - (BOTTOM_TIMELINE_COUNT - toRemove); //Real position has an offset.
|
|
|
|
|
Log.v(Helper.TAG, "pinnedPosition: " + pinnedPosition);
|
|
|
|
|
PinnedTimeline pinnedTimeline = pinned.pinnedTimelines.get(pinnedPosition);
|
|
|
|
|
bundle.putSerializable(Helper.ARG_TIMELINE_TYPE, pinnedTimeline.type);
|
|
|
|
|
|
|
|
|
|
Log.v(Helper.TAG, " pinnedTimeline.type: " + pinnedTimeline.type);
|
|
|
|
|
if (pinnedTimeline.type == Timeline.TimeLineEnum.LIST) {
|
|
|
|
|
bundle.putString(Helper.ARG_LIST_ID, pinnedTimeline.mastodonList.id);
|
|
|
|
|
} else if (pinnedTimeline.type == Timeline.TimeLineEnum.TAG) {
|
|
|
|
@ -119,7 +122,6 @@ public class FedilabPageAdapter extends FragmentStatePagerAdapter {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public int getCount() {
|
|
|
|
|
|
|
|
|
|
if (pinned != null && pinned.pinnedTimelines != null) {
|
|
|
|
|
return pinned.pinnedTimelines.size() + BOTTOM_TIMELINE_COUNT - toRemove;
|
|
|
|
|
} else {
|
|
|
|
|