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

am: 624212f43c

Change-Id: I90b4d7d57a7dc3bca86f46b34b0f9af2b78ea574
This commit is contained in:
Maurice Lam
2017-06-27 01:16:46 +00:00
committed by android-build-merger
4 changed files with 65 additions and 3 deletions

View File

@@ -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

View File

@@ -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"

View File

@@ -0,0 +1,31 @@
<?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>

View File

@@ -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();