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

Commit 0bbcdccd authored by Tony Mak's avatar Tony Mak
Browse files

Visualize password requirements and their fulfillment

1. Aggregate policies and generate the requirements
2. When user modifies the password, check is each requirement fulfilled
   Update the view accordingly.

Change-Id: I962ed3b81ce844006be1024a493e94ce52a3fdec
Fix: 24900754
parent 9a8e5a7f
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
<!-- Copyright (C) 2016 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="24dp"
        android:height="24dp"
        android:viewportWidth="24.0"
        android:viewportHeight="24.0">
    <path
        android:pathData="M9,16.17L4.83,12l-1.42,1.41L9,19 21,7l-1.41,-1.41z"
        android:fillColor="#0F9D58"/>
</vector>
+24 −0
Original line number Diff line number Diff line
<!-- Copyright (C) 2016 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="24dp"
        android:height="24dp"
        android:viewportWidth="24.0"
        android:viewportHeight="24.0">
    <path
        android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"
        android:fillColor="#757575"/>
</vector>
+39 −27
Original line number Diff line number Diff line
@@ -14,7 +14,6 @@
    See the License for the specific language governing permissions and
    limitations under the License.
-->

<com.android.setupwizardlib.GlifLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:settings="http://schemas.android.com/apk/res-auto"
@@ -31,9 +30,11 @@
        android:orientation="vertical">

        <!-- header text ('Enter Pin') -->
        <TextView android:id="@+id/headerText"
        <TextView
            android:id="@+id/headerText"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:accessibilityLiveRegion="polite"
            android:gravity="center"
            android:lines="2"
            android:textAppearance="?android:attr/textAppearanceMedium"/>
@@ -49,6 +50,17 @@
            android:textSize="24sp"
            style="@style/TextAppearance.PasswordEntry"/>

        <LinearLayout
                android:id="@+id/bottom_container"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical">

            <android.support.v7.widget.RecyclerView
                    android:id="@+id/password_requirements_view"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"/>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
@@ -75,7 +87,7 @@
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/lockpassword_continue_label" />

            </LinearLayout>
        </LinearLayout>

        <!-- Spacer between password entry and keyboard -->
+22 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2016 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/description_text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingStart="4dp"
        android:textSize="14sp"/>
 No newline at end of file
+5 −0
Original line number Diff line number Diff line
@@ -305,4 +305,9 @@
    <dimen name="support_tile_min_height">48dp</dimen>
    <!-- support spacer layout height -->
    <dimen name="support_spacer_height">8dp</dimen>

    <dimen name="password_requirement_textsize">14sp</dimen>
    <!-- Visible vertical space we want to show below password edittext field when ime is shown.
         The unit is sp as it is related to the text size of password requirement item. -->
    <dimen name="visible_vertical_space_below_password">20sp</dimen>
</resources>
Loading