Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Verified Commit c3bff429 authored by Saalim Quadri's avatar Saalim Quadri
Browse files

(fix): Simplify scrolling state check with early return

parent 83a46171
Loading
Loading
Loading
Loading
Loading
+12 −10
Original line number Diff line number Diff line
@@ -348,8 +348,11 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
        boolean wasScrolling = mShouldEnableScrolling;
        updateScrollingBehavior();

        // If scrolling state changed, we need to re-layout the icons
        if (wasScrolling != mShouldEnableScrolling) {
        // If scrolling state did not change, no need to re-layout the icons
        if (wasScrolling == mShouldEnableScrolling) {
            return;
        }

        // Request layout to handle the scrolling state change
        post(() -> {
            requestLayout();
@@ -358,7 +361,6 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
            }
        });
    }
    }

    private void updateScrollingBehavior() {
        boolean shouldEnableScrolling = shouldEnableIconScrolling();