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

Commit 8a09b619 authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Update confirm device credentials to spec, add fingerprint

- New strings in the screen.
- New layout/style.
- Clean up internal API's around it.
- Add fingerprint support if launched from externally
- Separate theme if launched from externally
- If launched from above Keyguard, use SHOW_WHEN_LOCKED flag

Change-Id: Icdf9bf9e0506841f24e8aab5f0f1d1f4b688951f
parent b5aa73f4
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1299,10 +1299,12 @@
            </intent-filter>
        </activity>

        <activity android:name="ConfirmLockPattern"/>
        <activity android:name="ConfirmLockPattern"
            android:theme="@style/Theme.ConfirmDeviceCredentials"/>

        <activity android:name="ConfirmLockPassword"
            android:windowSoftInputMode="stateVisible|adjustResize"/>
            android:windowSoftInputMode="stateVisible|adjustResize"
            android:theme="@style/Theme.ConfirmDeviceCredentials"/>

        <activity android:name="FingerprintSettings" android:exported="false"/>
        <activity android:name="FingerprintEnroll" android:exported="false"/>
+36 −0
Original line number Diff line number Diff line
<!--
  ~ Copyright (C) 2015 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="32dp"
        android:height="32dp"
        android:viewportWidth="32.0"
        android:viewportHeight="32.0">
    <path
        android:fillColor="#ffffff"
        android:pathData="M23.7,5.9c-0.1,0.0 -0.2,0.0 -0.3,-0.1C21.0,4.5 18.6,3.9 16.0,3.9c-2.5,0.0 -4.6,0.6 -6.9,1.9C8.8,6.0 8.3,5.9 8.1,5.5C7.9,5.2 8.0,4.7 8.4,4.5c2.5,-1.4 4.9,-2.1 7.7,-2.1c2.8,0.0 5.4,0.7 8.0,2.1c0.4,0.2 0.5,0.6 0.3,1.0C24.2,5.7 24.0,5.9 23.7,5.9z"/>
    <path
        android:fillColor="#ffffff"
        android:pathData="M5.3,13.2c-0.1,0.0 -0.3,0.0 -0.4,-0.1c-0.3,-0.2 -0.4,-0.7 -0.2,-1.0c1.3,-1.9 2.9,-3.4 4.9,-4.5c4.1,-2.2 9.3,-2.2 13.4,0.0c1.9,1.1 3.6,2.5 4.9,4.4c0.2,0.3 0.1,0.8 -0.2,1.0c-0.3,0.2 -0.8,0.1 -1.0,-0.2c-1.2,-1.7 -2.6,-3.0 -4.3,-4.0c-3.7,-2.0 -8.3,-2.0 -12.0,0.0c-1.7,0.9 -3.2,2.3 -4.3,4.0C5.7,13.1 5.5,13.2 5.3,13.2z"/>
    <path
        android:fillColor="#ffffff"
        android:pathData="M13.3,29.6c-0.2,0.0 -0.4,-0.1 -0.5,-0.2c-1.1,-1.2 -1.7,-2.0 -2.6,-3.6c-0.9,-1.7 -1.4,-3.7 -1.4,-5.9c0.0,-4.1 3.3,-7.4 7.4,-7.4c4.1,0.0 7.4,3.3 7.4,7.4c0.0,0.4 -0.3,0.7 -0.7,0.7s-0.7,-0.3 -0.7,-0.7c0.0,-3.3 -2.7,-5.9 -5.9,-5.9c-3.3,0.0 -5.9,2.7 -5.9,5.9c0.0,2.0 0.4,3.8 1.2,5.2c0.8,1.6 1.4,2.2 2.4,3.3c0.3,0.3 0.3,0.8 0.0,1.0C13.7,29.5 13.5,29.6 13.3,29.6z"/>
    <path
        android:fillColor="#ffffff"
        android:pathData="M22.6,27.1c-1.6,0.0 -2.9,-0.4 -4.1,-1.2c-1.9,-1.4 -3.1,-3.6 -3.1,-6.0c0.0,-0.4 0.3,-0.7 0.7,-0.7s0.7,0.3 0.7,0.7c0.0,1.9 0.9,3.7 2.5,4.8c0.9,0.6 1.9,1.0 3.2,1.0c0.3,0.0 0.8,0.0 1.3,-0.1c0.4,-0.1 0.8,0.2 0.8,0.6c0.1,0.4 -0.2,0.8 -0.6,0.8C23.4,27.1 22.8,27.1 22.6,27.1z"/>
    <path
        android:fillColor="#ffffff"
        android:pathData="M20.0,29.9c-0.1,0.0 -0.1,0.0 -0.2,0.0c-2.1,-0.6 -3.4,-1.4 -4.8,-2.9c-1.8,-1.9 -2.8,-4.4 -2.8,-7.1c0.0,-2.2 1.8,-4.1 4.1,-4.1c2.2,0.0 4.1,1.8 4.1,4.1c0.0,1.4 1.2,2.6 2.6,2.6c1.4,0.0 2.6,-1.2 2.6,-2.6c0.0,-5.1 -4.2,-9.3 -9.3,-9.3c-3.6,0.0 -6.9,2.1 -8.4,5.4C7.3,17.1 7.0,18.4 7.0,19.8c0.0,1.1 0.1,2.7 0.9,4.9c0.1,0.4 -0.1,0.8 -0.4,0.9c-0.4,0.1 -0.8,-0.1 -0.9,-0.4c-0.6,-1.8 -0.9,-3.6 -0.9,-5.4c0.0,-1.6 0.3,-3.1 0.9,-4.4c1.7,-3.8 5.6,-6.3 9.8,-6.3c5.9,0.0 10.7,4.8 10.7,10.7c0.0,2.2 -1.8,4.1 -4.1,4.1s-4.0,-1.8 -4.0,-4.1c0.0,-1.4 -1.2,-2.6 -2.6,-2.6c-1.4,0.0 -2.6,1.2 -2.6,2.6c0.0,2.3 0.9,4.5 2.4,6.1c1.2,1.3 2.4,2.0 4.2,2.5c0.4,0.1 0.6,0.5 0.5,0.9C20.6,29.7 20.3,29.9 20.0,29.9z"/>
</vector>
+30 −0
Original line number Diff line number Diff line
<!--
  ~ Copyright (C) 2015 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="32dp"
        android:height="32dp"
        android:viewportWidth="32.0"
        android:viewportHeight="32.0">
    <path
        android:fillColor="@color/warning"
        android:pathData="M15.99,2.5C8.53,2.5 2.5,8.54 2.5,16.0s6.03,13.5 13.49,13.5S29.5,23.46 29.5,16.0S23.45,2.5 15.99,2.5zM16.0,26.8c-5.97,0.0 -10.8,-4.83 -10.8,-10.8S10.03,5.2 16.0,5.2S26.8,10.03 26.8,16.0S21.97,26.8 16.0,26.8z"/>
    <path
        android:fillColor="@color/warning"
        android:pathData="M14.65,20.05l2.7,0.0l0.0,2.7l-2.7,0.0z"/>
    <path
        android:fillColor="@color/warning"
        android:pathData="M14.65,9.25l2.7,0.0l0.0,8.1l-2.7,0.0z"/>
</vector>
+72 −84
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
**
** Copyright 2008, 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.
*/
<!-- Copyright (C) 2015 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.
-->
<!-- This is basically the same layout as choose_lock_password. -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/topLayout"
    android:orientation="vertical"
    android:gravity="center_horizontal">
    android:layout_width="wrap_content"
    android:layout_height="match_parent">

    <LinearLayout
        android:layout_width="match_parent"
    <TextView
        style="@android:style/TextAppearance.Material.Title"
        android:id="@+id/headerText"
        android:layout_marginStart="24dp"
        android:layout_marginEnd="24dp"
        android:layout_marginTop="12dp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal">
        <!-- "Enter PIN(Password) to unlock" -->
        <TextView android:id="@+id/headerText"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:orientation="horizontal"
            android:layout_marginEnd="6dip"
            android:layout_marginStart="6dip"
            android:layout_marginTop="10dip"
            android:layout_marginBottom="10dip"
            android:gravity="start"
            android:ellipsize="marquee"
            android:textAppearance="?android:attr/textAppearanceMedium"
        />
        android:textColor="?android:attr/colorAccent"/>

        <!-- Password entry field -->
        <EditText android:id="@+id/password_entry"
            android:layout_width="0dip"
    <TextView
        style="@android:style/TextAppearance.Material.Body1"
        android:id="@+id/detailsText"
        android:layout_marginStart="24dp"
        android:layout_marginEnd="24dp"
        android:layout_marginTop="8dp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
            android:layout_marginTop="5dip"
            android:layout_marginBottom="5dip"
            android:layout_gravity="center"
            android:layout_weight="1"
            android:inputType="textPassword"
            android:imeOptions="actionNext"
            android:gravity="center"
            android:textSize="24sp"
            style="@style/TextAppearance.PasswordEntry"
        />
    </LinearLayout>

    <!-- Spacer between password entry and keyboard -->
    <View
        android:layout_width="match_parent"
        android:layout_height="0dip"
        android:layout_height="0dp"
        android:layout_weight="1"/>

    <!-- Alphanumeric keyboard -->
    <com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard"
        android:layout_alignParentBottom="true"
        android:layout_width="match_parent"
    <FrameLayout
        android:layout_height="wrap_content"
        android:background="#00000000"
        android:keyBackground="@*android:drawable/btn_keyboard_key_fulltrans"
        android:visibility="gone"
    />
        android:layout_width="match_parent"
        android:orientation="horizontal">

    <RelativeLayout
        <Button
            style="@android:style/Widget.Material.Button.Borderless"
            android:id="@+id/cancelButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:background="@android:drawable/bottom_bar"
        android:visibility="gone">
            android:layout_gravity="start|bottom"
            android:text="@string/cancel"
            android:layout_marginStart="8dp"
            android:layout_marginEnd="8dp"
            android:layout_marginBottom="14dp"/>

        <Button android:id="@+id/cancel_button"
            android:layout_width="150dip"
        <EditText android:id="@+id/password_entry"
            android:layout_width="208dp"
            android:layout_height="wrap_content"
            android:layout_margin="5dip"
            android:layout_alignParentStart="true"
            android:text="@string/lockpassword_cancel_label"
        />
            android:layout_gravity="center_horizontal|bottom"
            android:layout_marginBottom="26dp"
            android:inputType="textPassword"
            android:imeOptions="actionNext|flagNoFullscreen"
            android:gravity="center"
            android:textSize="16sp"
            style="@style/TextAppearance.PasswordEntry"/>

        <Button android:id="@+id/next_button"
            android:layout_width="150dip"
        <TextView style="@style/TextAppearance.ConfirmDeviceCredentialsErrorText"
            android:id="@+id/errorText"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_margin="5dip"
            android:layout_alignParentEnd="true"
            android:drawableEnd="@drawable/ic_btn_next"
            android:drawablePadding="10dip"
            android:text="@string/lockpassword_continue_label"
        />
            android:layout_gravity="center_horizontal|bottom"
            android:layout_marginBottom="10dp"/>

    </RelativeLayout>
        <ImageView
            android:id="@+id/fingerprintIcon"
            android:layout_gravity="end|bottom"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginBottom="28dp"
            android:layout_marginEnd="20dp"
            android:visibility="gone"/>
    </FrameLayout>

</LinearLayout>
 No newline at end of file
+86 −40
Original line number Diff line number Diff line
@@ -13,56 +13,102 @@
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/topLayout"
    android:orientation="horizontal"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    android:layout_height="match_parent"
    android:clipChildren="false"
    android:clipToPadding="false">

    <!-- left side: instructions and messages -->
    <LinearLayout
            android:orientation="vertical"
            android:layout_width="0dip"
            android:layout_height="match_parent"
            android:layout_weight="1.0"
            >
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:layout_weight="1"
        android:orientation="vertical">

        <!-- header message -->
        <TextView android:id="@+id/headerText"
                  android:layout_width="match_parent"
        <TextView
            style="@android:style/TextAppearance.Material.Headline"
            android:id="@+id/headerText"
            android:layout_marginStart="32dp"
            android:layout_marginEnd="32dp"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
                  android:layout_marginTop="16dp"
                  android:gravity="center"
                  android:textSize="18sp"/>
            android:textColor="?android:attr/colorAccent"/>

        <!-- fill space between header and button below -->
        <View
            android:layout_weight="1.0"
            android:layout_width="match_parent"
            android:layout_height="0dip"
            />
        <TextView
            style="@android:style/TextAppearance.Material.Body1"
            android:id="@+id/detailsText"
            android:layout_marginStart="32dp"
            android:layout_marginEnd="32dp"
            android:layout_marginTop="12dp"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>

        <!-- footer message -->
        <TextView android:id="@+id/footerText"
                  android:layout_width="match_parent"
        <Button
            style="@android:style/Widget.Material.Button.Borderless"
            android:id="@+id/cancelButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
                  android:gravity="center"
                  android:textSize="14sp"/>
            android:text="@string/cancel"
            android:layout_marginStart="16dp"
            android:layout_marginEnd="16dp"
            android:layout_marginTop="16dp"/>
    </LinearLayout>

    <LinearLayout
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:orientation="horizontal"
        android:clipChildren="false"
        android:clipToPadding="false">

        <View
         android:background="@*android:drawable/code_lock_left"
         android:layout_width="2dip"
         android:layout_height="match_parent" />
            android:id="@+id/leftSpacer"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="0.4"/>

    <!-- right side: lock pattern -->
    <com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
         android:layout_width="match_parent"
        <FrameLayout
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
         android:background="@color/lock_pattern_background" />
            android:clipChildren="false"
            android:clipToPadding="false">

            <com.android.internal.widget.LockPatternView
                android:id="@+id/lockPattern"
                android:layout_width="288dp"
                android:layout_height="288dp"
                android:layout_marginStart="-42dp"
                android:layout_marginEnd="-42dp"
                android:layout_gravity="center_vertical"/>

            <TextView
                style="@style/TextAppearance.ConfirmDeviceCredentialsErrorText"
                android:id="@+id/errorText"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="bottom|center_horizontal"
                android:layout_marginBottom="24dp"/>
        </FrameLayout>

        <View
            android:id="@+id/rightSpacer"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"/>

        <ImageView
            android:id="@+id/fingerprintIcon"
            android:layout_gravity="center_vertical"
            android:layout_width="0dp"
            android:layout_weight="1"
            android:layout_height="wrap_content"
            android:visibility="gone"/>
    </LinearLayout>

</com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient>
Loading