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

Commit 07b149ec authored by lbill's avatar lbill
Browse files

Fix incorrect SetupChooseLockPattern layout

Root cause:
- The new added description TextView is too large
- sud_layout_description was add in sud_layout_content
  instead of sud_layout_header.

Solution:
- Set string lockpassword_choose_your_pattern_description
  to GlifLayout as it's description.(Header description)

Bug: 233666752
Fixes 239892091
Test: manual in setup flow, check choose lock pattern layouts
showing expectedly on both phone & tablet
Test: make RunSettingsRoboTests

Change-Id: Iabe503066434f8983dffb88d1c93f2bbf773b860
parent 037cf476
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -36,16 +36,6 @@
        android:paddingLeft="0dp"
        android:paddingRight="0dp">

        <TextView
            android:id="@+id/sud_layout_description"
            android:text="@string/lockpassword_choose_your_pattern_description"
            style="@style/SudDescription.Glif"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:minLines="4"
            android:paddingStart="?attr/sudMarginStart"
            android:paddingEnd="?attr/sudMarginEnd"/>

        <TextView
            android:id="@+id/headerText"
            style="@style/SudDescription.Glif"
+2 −1
Original line number Diff line number Diff line
@@ -143,7 +143,8 @@ public class SetupChooseLockPattern extends ChooseLockPattern {
            }

            final GlifLayout layout = getActivity().findViewById(R.id.setup_wizard_layout);
            layout.setDescriptionText("");
            layout.setDescriptionText(
                    getString(R.string.lockpassword_choose_your_pattern_description));
        }

        @Override
+13 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import android.content.pm.PackageManager;
import android.os.UserHandle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.FragmentActivity;
@@ -192,6 +193,18 @@ public class SetupChooseLockPatternTest {
                .isEqualTo(application.getString(R.string.lockpattern_retry_button_text));
    }

    @Test
    public void createActivity_patternDescription_shouldBeShown() {
        PartnerCustomizationLayout layout = mActivity.findViewById(R.id.setup_wizard_layout);

        final TextView patternDescription =
                layout.findViewById(R.id.sud_layout_subtitle);

        assertThat(patternDescription.getVisibility()).isEqualTo(View.VISIBLE);
        assertThat(patternDescription.getText()).isEqualTo(
                application.getString(R.string.lockpassword_choose_your_pattern_description));
    }

    private ChooseLockPatternFragment findFragment(FragmentActivity activity) {
        return (ChooseLockPatternFragment)
                activity.getSupportFragmentManager().findFragmentById(R.id.main_content);