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

Commit 624212f4 authored by Maurice Lam's avatar Maurice Lam Committed by Android (Google) Code Review
Browse files

Merge "Add skip button to fingerprint enrolling screen" into oc-dr1-dev

parents a102714c 870b69b0
Loading
Loading
Loading
Loading
+13 −0
Original line number Original line Diff line number Diff line
@@ -49,6 +49,7 @@
                style="@style/SuwGlifIcon"
                style="@style/SuwGlifIcon"
                android:layout_width="wrap_content"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="?attr/suwGlifHeaderGravity"
                android:layout_marginStart="0dp"
                android:layout_marginStart="0dp"
                android:layout_marginEnd="0dp"
                android:layout_marginEnd="0dp"
                android:src="@drawable/ic_fingerprint_header" />
                android:src="@drawable/ic_fingerprint_header" />
@@ -82,6 +83,18 @@


            </FrameLayout>
            </FrameLayout>


            <Space
                android:layout_width="0dp"
                android:layout_height="0dp"
                android:layout_weight="1" />

            <Button
                android:id="@+id/skip_button"
                style="@style/SuwGlifButton.Secondary"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/skip_label" />

        </LinearLayout>
        </LinearLayout>


        <FrameLayout
        <FrameLayout
+4 −3
Original line number Original line Diff line number Diff line
@@ -17,10 +17,12 @@


<com.android.setupwizardlib.GlifLayout
<com.android.setupwizardlib.GlifLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/setup_wizard_layout"
    android:id="@+id/setup_wizard_layout"
    android:layout_width="match_parent"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_height="match_parent"
    style="?attr/fingerprint_layout_theme">
    style="?attr/fingerprint_layout_theme"
    app:suwFooter="@layout/fingerprint_enroll_enrolling_base_footer">


    <LinearLayout
    <LinearLayout
        style="@style/SuwContentFrame"
        style="@style/SuwContentFrame"
@@ -58,8 +60,7 @@
        <FrameLayout
        <FrameLayout
            android:layout_width="match_parent"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:layout_weight="1">
            android:paddingBottom="80dp">


            <include layout="@layout/fingerprint_enroll_enrolling_content"
            <include layout="@layout/fingerprint_enroll_enrolling_content"
                android:layout_width="@dimen/fingerprint_progress_bar_max_size"
                android:layout_width="@dimen/fingerprint_progress_bar_max_size"
+31 −0
Original line number Original line Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2017 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.
-->

<!-- TODO: Use aapt:attr when it is fixed (b/36809755) -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    style="@style/SuwGlifButtonBar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <Button
        style="@style/SuwGlifButton.Secondary"
        android:id="@+id/skip_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/skip_label" />

</LinearLayout>
+17 −0
Original line number Original line Diff line number Diff line
@@ -36,6 +36,7 @@ import android.view.MotionEvent;
import android.view.View;
import android.view.View;
import android.view.animation.AnimationUtils;
import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
import android.view.animation.Interpolator;
import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.TextView;


@@ -98,6 +99,10 @@ public class FingerprintEnrollEnrolling extends FingerprintEnrollBase
        mRepeatMessage = (TextView) findViewById(R.id.repeat_message);
        mRepeatMessage = (TextView) findViewById(R.id.repeat_message);
        mErrorText = (TextView) findViewById(R.id.error_text);
        mErrorText = (TextView) findViewById(R.id.error_text);
        mProgressBar = (ProgressBar) findViewById(R.id.fingerprint_progress_bar);
        mProgressBar = (ProgressBar) findViewById(R.id.fingerprint_progress_bar);

        Button skipButton = findViewById(R.id.skip_button);
        skipButton.setOnClickListener(this);

        final LayerDrawable fingerprintDrawable = (LayerDrawable) mProgressBar.getBackground();
        final LayerDrawable fingerprintDrawable = (LayerDrawable) mProgressBar.getBackground();
        mIconAnimationDrawable = (AnimatedVectorDrawable)
        mIconAnimationDrawable = (AnimatedVectorDrawable)
                fingerprintDrawable.findDrawableByLayerId(R.id.fingerprint_animation);
                fingerprintDrawable.findDrawableByLayerId(R.id.fingerprint_animation);
@@ -211,6 +216,18 @@ public class FingerprintEnrollEnrolling extends FingerprintEnrollBase
        super.onBackPressed();
        super.onBackPressed();
    }
    }


    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.skip_button:
                setResult(RESULT_SKIP);
                finish();
                break;
            default:
                super.onClick(v);
        }
    }

    private void animateProgress(int progress) {
    private void animateProgress(int progress) {
        if (mProgressAnim != null) {
        if (mProgressAnim != null) {
            mProgressAnim.cancel();
            mProgressAnim.cancel();