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

Commit a2e032bb authored by Shawn Lin's avatar Shawn Lin
Browse files

Fix lock pattern is truncated during SUW in folded state

Remove the bottom margin of the header view.

Bug: 285290323
Test: 1. Go through SUW
      2. Select lock pattern
      3. Check if UI truncated
Test: m RunSettingsRoboTests ROBOTEST_FILTER=
      com.android.settings.password.SetupChooseLockPatternTest
Change-Id: I48ac3d897e6b876bd7a1c325cc4a5e797e140da2
parent 6b01e665
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -90,6 +90,12 @@ public class SetupChooseLockPattern extends ChooseLockPattern {
            }
            // Show the skip button during SUW but not during Settings > Biometric Enrollment
            mSkipOrClearButton.setOnClickListener(this::onSkipOrClearButtonClick);

            final View headerView = view.findViewById(R.id.sud_layout_header);
            final ViewGroup.MarginLayoutParams lp =
                    (ViewGroup.MarginLayoutParams) headerView.getLayoutParams();
            lp.bottomMargin = 0;
            view.setLayoutParams(lp);
            return view;
        }

+9 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import android.content.res.Resources;
import android.os.UserHandle;
import android.util.TypedValue;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;

@@ -114,6 +115,14 @@ public class SetupChooseLockPatternTest {
        assertThat(button.getVisibility()).isEqualTo(View.VISIBLE);
    }

    @Test
    public void headerView_noBottomMargin() {
        final View header = mActivity.findViewById(R.id.sud_layout_header);
        final ViewGroup.MarginLayoutParams lp =
                (ViewGroup.MarginLayoutParams) header.getLayoutParams();
        assertThat(lp.bottomMargin).isEqualTo(0);
    }

    private void verifyScreenLockOptionsShown() {
        final Button button = mActivity.findViewById(R.id.screen_lock_options);
        assertThat(button).isNotNull();