Merge "Polish FingerprintDialog" into pi-dev
This commit is contained in:
26
packages/SystemUI/res/drawable/fingerprint_dialog_bg.xml
Normal file
26
packages/SystemUI/res/drawable/fingerprint_dialog_bg.xml
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
~ Copyright (C) 2018 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
|
||||||
|
-->
|
||||||
|
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<solid android:color="@color/fingerprint_dialog_bg_color" />
|
||||||
|
<corners android:radius="1dp"
|
||||||
|
android:topLeftRadius="@dimen/fingerprint_dialog_corner_size"
|
||||||
|
android:topRightRadius="@dimen/fingerprint_dialog_corner_size"
|
||||||
|
android:bottomLeftRadius="0dp"
|
||||||
|
android:bottomRightRadius="0dp"/>
|
||||||
|
</shape>
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:elevation="2dp"
|
android:elevation="2dp"
|
||||||
android:background="@color/fingerprint_dialog_bg_color">
|
android:background="@drawable/fingerprint_dialog_bg">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/title"
|
android:id="@+id/title"
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
android:layout_marginEnd="24dp"
|
android:layout_marginEnd="24dp"
|
||||||
android:layout_marginStart="24dp"
|
android:layout_marginStart="24dp"
|
||||||
android:layout_marginTop="24dp"
|
android:layout_marginTop="24dp"
|
||||||
android:gravity="center"
|
android:gravity="@integer/fingerprint_dialog_text_gravity"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
@@ -57,16 +57,16 @@
|
|||||||
android:id="@+id/subtitle"
|
android:id="@+id/subtitle"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="12dp"
|
android:layout_marginTop="8dp"
|
||||||
android:layout_marginStart="24dp"
|
android:layout_marginStart="24dp"
|
||||||
android:layout_marginEnd="24dp"
|
android:layout_marginEnd="24dp"
|
||||||
android:gravity="center_horizontal"
|
android:gravity="@integer/fingerprint_dialog_text_gravity"
|
||||||
android:textSize="14sp"
|
android:textSize="16sp"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:ellipsize="marquee"
|
android:ellipsize="marquee"
|
||||||
android:marqueeRepeatLimit="marquee_forever"
|
android:marqueeRepeatLimit="marquee_forever"
|
||||||
android:textColor="@color/fingerprint_dialog_text_light_color"/>
|
android:textColor="@color/fingerprint_dialog_text_dark_color"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/description"
|
android:id="@+id/description"
|
||||||
@@ -74,7 +74,8 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="24dp"
|
android:layout_marginEnd="24dp"
|
||||||
android:layout_marginStart="24dp"
|
android:layout_marginStart="24dp"
|
||||||
android:paddingTop="24dp"
|
android:gravity="@integer/fingerprint_dialog_text_gravity"
|
||||||
|
android:paddingTop="8dp"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
android:maxLines="4"
|
android:maxLines="4"
|
||||||
android:textColor="@color/fingerprint_dialog_text_dark_color"/>
|
android:textColor="@color/fingerprint_dialog_text_dark_color"/>
|
||||||
@@ -84,7 +85,7 @@
|
|||||||
android:layout_width="@dimen/fingerprint_dialog_fp_icon_size"
|
android:layout_width="@dimen/fingerprint_dialog_fp_icon_size"
|
||||||
android:layout_height="@dimen/fingerprint_dialog_fp_icon_size"
|
android:layout_height="@dimen/fingerprint_dialog_fp_icon_size"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:layout_marginTop="32dp"
|
android:layout_marginTop="48dp"
|
||||||
android:scaleType="fitXY"
|
android:scaleType="fitXY"
|
||||||
android:contentDescription="@string/accessibility_fingerprint_dialog_fingerprint_icon" />
|
android:contentDescription="@string/accessibility_fingerprint_dialog_fingerprint_icon" />
|
||||||
|
|
||||||
@@ -106,7 +107,7 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="72dip"
|
android:layout_height="72dip"
|
||||||
android:paddingTop="16dp"
|
android:paddingTop="24dp"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
style="?android:attr/buttonBarStyle"
|
style="?android:attr/buttonBarStyle"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
|
|||||||
@@ -160,12 +160,12 @@
|
|||||||
<color name="smart_reply_button_background">#fff2f2f2</color>
|
<color name="smart_reply_button_background">#fff2f2f2</color>
|
||||||
|
|
||||||
<!-- Fingerprint dialog colors -->
|
<!-- Fingerprint dialog colors -->
|
||||||
<color name="fingerprint_dialog_bg_color">#f4ffffff</color> <!-- 96% white -->
|
<color name="fingerprint_dialog_bg_color">#ffffffff</color> <!-- 100% white -->
|
||||||
<color name="fingerprint_dialog_text_dark_color">#ff212121</color>
|
<color name="fingerprint_dialog_text_dark_color">#dd000000</color> <!-- 87% black -->
|
||||||
<color name="fingerprint_dialog_text_light_color">#ff757575</color>
|
<color name="fingerprint_dialog_text_light_color">#89000000</color> <!-- 54% black -->
|
||||||
<color name="fingerprint_dialog_dim_color">#80000000</color> <!-- 50% black -->
|
<color name="fingerprint_dialog_dim_color">#80000000</color> <!-- 50% black -->
|
||||||
<color name="fingerprint_dialog_error_message_color">#ffff5722</color>
|
<color name="fingerprint_dialog_error_message_color">#ffd93025</color> <!-- google red 600 -->
|
||||||
<color name="fingerprint_dialog_fingerprint_color">#ff009688</color>
|
<color name="fingerprint_dialog_fingerprint_color">#ff008577</color> <!-- google blue 600 -->
|
||||||
|
|
||||||
<!-- Logout button -->
|
<!-- Logout button -->
|
||||||
<color name="logout_button_bg_color">#ccffffff</color>
|
<color name="logout_button_bg_color">#ccffffff</color>
|
||||||
|
|||||||
@@ -906,8 +906,9 @@
|
|||||||
<dimen name="smart_reply_button_line_spacing_extra">6sp</dimen> <!-- Total line height 20sp. -->
|
<dimen name="smart_reply_button_line_spacing_extra">6sp</dimen> <!-- Total line height 20sp. -->
|
||||||
|
|
||||||
<!-- Fingerprint Dialog values -->
|
<!-- Fingerprint Dialog values -->
|
||||||
<dimen name="fingerprint_dialog_fp_icon_size">60dp</dimen>
|
<dimen name="fingerprint_dialog_fp_icon_size">64dp</dimen>
|
||||||
<dimen name="fingerprint_dialog_animation_translation_offset">350dp</dimen>
|
<dimen name="fingerprint_dialog_animation_translation_offset">350dp</dimen>
|
||||||
|
<dimen name="fingerprint_dialog_corner_size">2dp</dimen>
|
||||||
|
|
||||||
<!-- Wireless Charging Animation values -->
|
<!-- Wireless Charging Animation values -->
|
||||||
<dimen name="wireless_charging_dots_radius_start">0dp</dimen>
|
<dimen name="wireless_charging_dots_radius_start">0dp</dimen>
|
||||||
|
|||||||
19
packages/SystemUI/res/values/integers.xml
Normal file
19
packages/SystemUI/res/values/integers.xml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
~ Copyright (C) 2018 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
|
||||||
|
-->
|
||||||
|
<resources>
|
||||||
|
<integer name="fingerprint_dialog_text_gravity">8388611</integer> <!-- gravity start -->
|
||||||
|
</resources>
|
||||||
@@ -180,8 +180,8 @@ public class FingerprintDialogImpl extends SystemUI implements CommandQueue.Call
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
mReceiver = null;
|
mReceiver = null;
|
||||||
mWindowManager.removeView(mDialogView);
|
|
||||||
mDialogShowing = false;
|
mDialogShowing = false;
|
||||||
|
mDialogView.startDismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleButtonNegative() {
|
private void handleButtonNegative() {
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ public class FingerprintDialogView extends LinearLayout {
|
|||||||
|
|
||||||
private final IBinder mWindowToken = new Binder();
|
private final IBinder mWindowToken = new Binder();
|
||||||
private final Interpolator mLinearOutSlowIn;
|
private final Interpolator mLinearOutSlowIn;
|
||||||
private final Interpolator mFastOutLinearIn;
|
private final WindowManager mWindowManager;
|
||||||
private final float mAnimationTranslationOffset;
|
private final float mAnimationTranslationOffset;
|
||||||
private final int mErrorTextColor;
|
private final int mErrorTextColor;
|
||||||
private final int mTextColor;
|
private final int mTextColor;
|
||||||
@@ -78,7 +78,7 @@ public class FingerprintDialogView extends LinearLayout {
|
|||||||
super(context);
|
super(context);
|
||||||
mHandler = handler;
|
mHandler = handler;
|
||||||
mLinearOutSlowIn = Interpolators.LINEAR_OUT_SLOW_IN;
|
mLinearOutSlowIn = Interpolators.LINEAR_OUT_SLOW_IN;
|
||||||
mFastOutLinearIn = Interpolators.FAST_OUT_LINEAR_IN;
|
mWindowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
|
||||||
mAnimationTranslationOffset = getResources()
|
mAnimationTranslationOffset = getResources()
|
||||||
.getDimension(R.dimen.fingerprint_dialog_animation_translation_offset);
|
.getDimension(R.dimen.fingerprint_dialog_animation_translation_offset);
|
||||||
mErrorTextColor = Color.parseColor(
|
mErrorTextColor = Color.parseColor(
|
||||||
@@ -189,6 +189,34 @@ public class FingerprintDialogView extends LinearLayout {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void startDismiss() {
|
||||||
|
final Runnable endActionRunnable = new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
mWindowManager.removeView(FingerprintDialogView.this);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
postOnAnimation(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
mLayout.animate()
|
||||||
|
.alpha(0f)
|
||||||
|
.setDuration(ANIMATION_DURATION)
|
||||||
|
.setInterpolator(mLinearOutSlowIn)
|
||||||
|
.withLayer()
|
||||||
|
.start();
|
||||||
|
mDialog.animate()
|
||||||
|
.translationY(mAnimationTranslationOffset)
|
||||||
|
.setDuration(ANIMATION_DURATION)
|
||||||
|
.setInterpolator(mLinearOutSlowIn)
|
||||||
|
.withLayer()
|
||||||
|
.withEndAction(endActionRunnable)
|
||||||
|
.start();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public void setBundle(Bundle bundle) {
|
public void setBundle(Bundle bundle) {
|
||||||
mBundle = bundle;
|
mBundle = bundle;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user