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

Commit fa402d1d authored by Alex Chau's avatar Alex Chau
Browse files

Avoid adding unnecessary topMargin to TaskThumbnails in DesktopTaskView

- TaskThumbnails in DesktopTaskView already take into account topMarign during onMeasure, we should avoid adding double margin
- mTaskThumbnailViewDeprecated's visibility is always GONE, so no need to set margin either

Fix: 336968808
Test: manual, image test to follow-up
Flag: ACONFIG com.android.window.flags.enable_desktop_windowing_mode DEVELOPMENT
Change-Id: I6a7cb128ead0b042974b95199ab720cafc3bcc18
parent de68b73d
Loading
Loading
Loading
Loading
+1 −11
Original line number Diff line number Diff line
@@ -38,7 +38,6 @@ import android.widget.FrameLayout;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.android.launcher3.DeviceProfile;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.desktop.DesktopRecentsTransitionController;
@@ -305,16 +304,7 @@ public class DesktopTaskView extends TaskView {

    @Override
    protected void setThumbnailOrientation(RecentsOrientedState orientationState) {
        DeviceProfile deviceProfile = mContainer.getDeviceProfile();
        int thumbnailTopMargin = deviceProfile.overviewTaskThumbnailTopMarginPx;

        LayoutParams snapshotParams = (LayoutParams) mTaskThumbnailViewDeprecated.getLayoutParams();
        snapshotParams.topMargin = thumbnailTopMargin;

        for (int i = 0; i < mSnapshotViewMap.size(); i++) {
            TaskThumbnailViewDeprecated thumbnailView = mSnapshotViewMap.valueAt(i);
            thumbnailView.setLayoutParams(snapshotParams);
        }
        // no-op
    }

    @Override