Commit a658d17e authored by Thomas's avatar Thomas
Browse files

Fix offset with pinned

parent 9f6ca227
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -242,6 +242,7 @@ public class PinnedTimelineHelper {
            }
        }
        List<PinnedTimeline> pinnedTimelineVisibleList = new ArrayList<>();
        List<PinnedTimeline> pinnedToRemove = new ArrayList<>();
        for (PinnedTimeline pinnedTimeline : pinned.pinnedTimelines) {
            //Default timelines are not added if we are not in the single bar mode
            if (!singleBar) {
@@ -251,6 +252,7 @@ public class PinnedTimelineHelper {
                    case PUBLIC:
                    case NOTIFICATION:
                    case DIRECT:
                        pinnedToRemove.add(pinnedTimeline);
                        continue;
                }
            }
@@ -328,7 +330,7 @@ public class PinnedTimelineHelper {
                pinnedTimelineVisibleList.add(pinnedTimeline);
            }
        }

        pinned.pinnedTimelines.removeAll(pinnedToRemove);

        Pinned finalPinned = pinned;
        int finalToRemove1 = toRemove;
+3 −2
Original line number Diff line number Diff line
@@ -45,13 +45,14 @@ public class FedilabPageAdapter extends FragmentStatePagerAdapter {
    private final BottomMenu bottomMenu;
    private final int toRemove;
    private Fragment mCurrentFragment;
    private final boolean singleBar;

    public FedilabPageAdapter(BaseMainActivity activity, FragmentManager fm, Pinned pinned, BottomMenu bottomMenu) {
        super(fm, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT);
        this.pinned = pinned;
        this.bottomMenu = bottomMenu;
        SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(activity);
        boolean singleBar = sharedpreferences.getBoolean(activity.getString(R.string.SET_USE_SINGLE_TOPBAR), false);
        singleBar = sharedpreferences.getBoolean(activity.getString(R.string.SET_USE_SINGLE_TOPBAR), false);
        if (!singleBar) {
            toRemove = PinnedTimelineHelper.itemToRemoveInBottomMenu(activity);
        } else {
@@ -87,7 +88,7 @@ public class FedilabPageAdapter extends FragmentStatePagerAdapter {
        FragmentMastodonTimeline fragment = new FragmentMastodonTimeline();
        Bundle bundle = new Bundle();
        //Position 3 is for notifications
        if (position < (BOTTOM_TIMELINE_COUNT - toRemove)) {
        if (position < (BOTTOM_TIMELINE_COUNT - toRemove) && !singleBar) {
            if (bottomMenu != null) {
                BottomMenu.ItemMenuType type = BottomMenu.getType(bottomMenu, position);
                if (type == null) {