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

Commit 66b2aa07 authored by Schneider Victor-tulias's avatar Schneider Victor-tulias Committed by Automerger Merge Worker
Browse files

Update the hotseat edu layout for foldable devices. am: 9188b6b9 am: 494de979

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/16125840

Change-Id: I3c022d1727679b23d80eb5e158b65b0d900538fe
parents 90db092f 494de979
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@
                launcher:containerType="hotseat" />

            <LinearLayout
                android:id="@+id/button_container"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:paddingLeft="@dimen/bottom_sheet_edu_padding"
+14 −1
Original line number Diff line number Diff line
@@ -28,17 +28,20 @@ import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.CellLayout;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Insettable;
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.Launcher;
import com.android.launcher3.R;
import com.android.launcher3.anim.Interpolators;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.uioverrides.ApiWrapper;
import com.android.launcher3.uioverrides.PredictedAppIcon;
import com.android.launcher3.views.AbstractSlideInView;

@@ -89,8 +92,9 @@ public class HotseatEduDialog extends AbstractSlideInView<Launcher> implements I
        mHotseatWrapper = findViewById(R.id.hotseat_wrapper);
        mSampleHotseat = findViewById(R.id.sample_prediction);

        Context context = getContext();
        DeviceProfile grid = mActivityContext.getDeviceProfile();
        Rect padding = grid.getHotseatLayoutPadding(getContext());
        Rect padding = grid.getHotseatLayoutPadding(context);

        mSampleHotseat.getLayoutParams().height = grid.cellHeightPx;
        mSampleHotseat.setGridSize(grid.numShownHotseatIcons, 1);
@@ -102,6 +106,15 @@ public class HotseatEduDialog extends AbstractSlideInView<Launcher> implements I
        mDismissBtn = findViewById(R.id.no_thanks);
        mDismissBtn.setOnClickListener(this::onDismiss);

        LinearLayout buttonContainer = findViewById(R.id.button_container);
        int adjustedMarginEnd = ApiWrapper.getHotseatEndOffset(context)
                - buttonContainer.getPaddingEnd();
        if (InvariantDeviceProfile.INSTANCE.get(context)
                .getDeviceProfile(context).isTaskbarPresent && adjustedMarginEnd > 0) {
            ((LinearLayout.LayoutParams) buttonContainer.getLayoutParams()).setMarginEnd(
                    adjustedMarginEnd);
        }

        // update ui to reflect which migration method is going to be used
        if (FeatureFlags.HOTSEAT_MIGRATE_TO_FOLDER.get()) {
            ((TextView) findViewById(R.id.hotseat_edu_content)).setText(