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

Commit 8d06a444 authored by d34d's avatar d34d Committed by Bruno Martins
Browse files

fingerprint: Allow devices to configure sensor location

This is a squash of the following changes:

Author: d34d <clark@cyngn.com>
Date:   2016-06-23 11:21:45 -0700

    fingerprint: Allow devices to configure sensor location

    The text for enrolling a fingerprint always assumes the sensor is
    located on the back.  This patch adds a config integer that defines
    where the sensor is located on the device.
      0 = back
      1 = front
      2 = left side
      3 = right side

    This patch also adds a new drawable that shows the front of the device
    when applicable.

    Change-Id: Ia8f5f8ff4ba4d13d35aed3052f60ff665dd4f294
    TICKET: CYNGNOS-3089

Author: Paul Keith <javelinanddart@gmail.com>
Date:   2018-01-26 22:23:03 +0100

    FingerprintEnrollFindSensor: Don't overlay front for side sensors

    * Both the base image and the base image + overlay are equally nonsense
      for devices with a side fingerprint scanner, but for those that overlay
      a custom fingerprint enrollment graphic, this image overlay wreaks havoc
    * Only set this overlay to be visible if the sensor is on the front, to
      allow devices with side sensors to only overlay the base image

    Change-Id: I7cbcea4830d4526cf9f7d139e7f84f21117fa9c4

Author: Michael W <baddaemon87@gmail.com>
Date:   Thu Jan 17 21:44:28 2019 +0100

    Settings: Make find fingerprint look great again

    * The current logic places the animation based on the size of
      the whole overlay instead of the image, which is a fixed-size png
    * Get the size of the image instead and place the dot relative to it
    * Also use "wrap_content" and add a padding to the top so the
      distance to the text is a fixed thing, not depending on how
      much space relative to the wanted space it actually takes

    * Preview: https://imgur.com/a/XanJ2aP

    Change-Id: I2bd08cee1abd1c6bad78ca1efc2189e573ded3cc

Change-Id: Ia8f5f8ff4ba4d13d35aed3052f60ff665dd4f294
parent 329aa31c
Loading
Loading
Loading
Loading
+2.64 KiB
Loading image diff...
+1 −0
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@

                    <TextView
                        style="@style/SuwDescription.Glif"
                        android:id="@+id/find_sensor_message"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:text="@string/security_settings_fingerprint_enroll_find_sensor_message"/>
+1 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@

            <TextView
                style="@style/SuwDescription.Glif"
                android:id="@+id/find_sensor_message"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/suw_description_glif_margin_top"
+13 −3
Original line number Diff line number Diff line
@@ -17,17 +17,27 @@

<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="@dimen/fingerprint_find_sensor_graphic_size"
    android:layout_height="@dimen/fingerprint_find_sensor_graphic_size">
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:paddingTop="@dimen/fingerprint_find_sensor_padding_top">

    <ImageView
        android:id="@+id/fingerprint_sensor_location"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_height="wrap_content"
        android:contentDescription="@string/security_settings_fingerprint_enroll_find_sensor_content_description"
        android:src="@drawable/fingerprint_sensor_location"
        android:scaleType="centerInside"/>

    <ImageView
        android:id="@+id/fingerprint_sensor_location_front_overlay"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:contentDescription="@string/security_settings_fingerprint_enroll_find_sensor_content_description"
        android:src="@drawable/fingerprint_sensor_location_front_overlay"
        android:scaleType="centerInside"
        android:visibility="gone"/>

    <com.android.settings.fingerprint.FingerprintLocationAnimationView
        android:id="@+id/fingerprint_sensor_location_animation"
        android:layout_width="match_parent"
+26 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2016 The CyanogenMod 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.
-->
<resources>
    <!-- Fingerprint sensor locations.  Devices should configure their sensor location using
         config_fingerprintSensorLocation -->
    <string-array name="security_settings_fingerprint_sensor_locations" translatable="false">
        <item>@string/security_settings_fingerprint_sensor_location_back</item>
        <item>@string/security_settings_fingerprint_sensor_location_front</item>
        <item>@string/security_settings_fingerprint_sensor_location_left</item>
        <item>@string/security_settings_fingerprint_sensor_location_right</item>
    </string-array>
</resources>
Loading