Merge "Update margins to match specs" into nyc-mr1-dev
This commit is contained in:
@@ -50,7 +50,7 @@
|
||||
style="@style/TextAppearance.FingerprintMessage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/suw_description_margin_top"
|
||||
android:layout_marginTop="@dimen/suw_description_glif_margin_top"
|
||||
android:text="@string/setup_fingerprint_enroll_finish_message_secondary"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:visibility="gone" />
|
||||
|
@@ -35,7 +35,7 @@
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/suw_description_margin_top">
|
||||
android:layout_marginTop="@dimen/suw_description_glif_margin_top">
|
||||
|
||||
<TextView
|
||||
style="@style/TextAppearance.FingerprintMessage"
|
||||
|
@@ -47,7 +47,7 @@
|
||||
style="@style/TextAppearance.FingerprintMessage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/suw_description_margin_top"
|
||||
android:layout_marginTop="@dimen/suw_description_glif_margin_top"
|
||||
android:text="@string/security_settings_fingerprint_enroll_find_sensor_message"/>
|
||||
|
||||
<View
|
||||
|
@@ -35,7 +35,7 @@
|
||||
style="@style/TextAppearance.FingerprintMessage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/suw_description_margin_top"
|
||||
android:layout_marginTop="@dimen/suw_description_glif_margin_top"
|
||||
android:text="@string/security_settings_fingerprint_enroll_finish_message"/>
|
||||
|
||||
<TextView
|
||||
@@ -43,7 +43,7 @@
|
||||
style="@style/TextAppearance.FingerprintMessage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/suw_description_margin_top"
|
||||
android:layout_marginTop="@dimen/suw_description_glif_margin_top"
|
||||
android:text="@string/setup_fingerprint_enroll_finish_message_secondary"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:visibility="gone" />
|
||||
|
@@ -20,10 +20,10 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="56dp"
|
||||
android:paddingBottom="@dimen/suw_description_margin_bottom_lists"
|
||||
android:paddingBottom="@dimen/suw_description_glif_margin_bottom_lists"
|
||||
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
|
||||
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
|
||||
android:paddingTop="@dimen/suw_description_margin_top"
|
||||
android:paddingTop="@dimen/suw_description_glif_margin_top"
|
||||
android:text="@string/setup_lock_settings_picker_fingerprint_message"
|
||||
android:lineSpacingExtra="@dimen/suw_description_line_spacing_extra"
|
||||
android:textAppearance="?android:attr/textAppearanceListItem" />
|
||||
|
@@ -20,10 +20,10 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="56dp"
|
||||
android:paddingBottom="@dimen/suw_description_margin_bottom_lists"
|
||||
android:paddingBottom="@dimen/suw_description_glif_margin_bottom_lists"
|
||||
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
|
||||
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
|
||||
android:paddingTop="@dimen/suw_description_margin_top"
|
||||
android:paddingTop="@dimen/suw_description_glif_margin_top"
|
||||
android:text="@string/setup_lock_settings_picker_message"
|
||||
android:lineSpacingExtra="@dimen/suw_description_line_spacing_extra"
|
||||
android:textAppearance="?android:attr/textAppearanceListItem" />
|
||||
|
@@ -20,9 +20,9 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="56dp"
|
||||
android:paddingBottom="@dimen/suw_description_margin_bottom_lists"
|
||||
android:paddingBottom="@dimen/suw_description_glif_margin_bottom_lists"
|
||||
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
|
||||
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
|
||||
android:paddingTop="@dimen/suw_description_margin_top"
|
||||
android:paddingTop="@dimen/suw_description_glif_margin_top"
|
||||
android:lineSpacingExtra="@dimen/suw_description_line_spacing_extra"
|
||||
android:textAppearance="?android:attr/textAppearanceListItem" />
|
||||
|
@@ -47,7 +47,7 @@
|
||||
style="@style/TextAppearance.FingerprintMessage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/suw_description_margin_top"
|
||||
android:layout_marginTop="@dimen/suw_description_glif_margin_top"
|
||||
android:text="@string/security_settings_fingerprint_enroll_find_sensor_message"/>
|
||||
|
||||
<View
|
||||
|
@@ -31,7 +31,7 @@
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
style="@style/SuwDescription"
|
||||
style="@style/SuwDescription.Glif"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/lock_screen_notifications_interstitial_message" />
|
||||
|
@@ -1,71 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright (C) 2016 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.
|
||||
-->
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
style="@style/SuwItemContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="@dimen/suw_description_margin_top"
|
||||
android:paddingBottom="@dimen/suw_description_margin_bottom_lists">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/suw_items_icon_container"
|
||||
android:layout_width="@dimen/suw_items_icon_container_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="start">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/suw_items_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.android.settings.widget.LinkTextView
|
||||
android:id="@+id/suw_items_title"
|
||||
style="@style/SuwItemTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="start"
|
||||
android:lineSpacingExtra="@dimen/suw_description_line_spacing_extra"
|
||||
android:textAlignment="viewStart"
|
||||
android:textAppearance="@style/TextAppearance.SuwDescription"
|
||||
tools:ignore="UnusedAttribute" />
|
||||
|
||||
<com.android.settings.widget.LinkTextView
|
||||
android:id="@+id/suw_items_summary"
|
||||
style="@style/SuwItemSummary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="start"
|
||||
android:textAlignment="viewStart"
|
||||
android:visibility="gone"
|
||||
tools:ignore="UnusedAttribute" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
@@ -741,7 +741,7 @@
|
||||
<!-- Introduction title shown in fingerprint enrollment to introduce the fingerprint feature[CHAR LIMIT=29] -->
|
||||
<string name="security_settings_fingerprint_enroll_introduction_title">Unlock with fingerprint</string>
|
||||
<!-- Introduction detail message shown in fingerprint enrollment dialog [CHAR LIMIT=NONE]-->
|
||||
<string name="security_settings_fingerprint_enroll_introduction_message">Just touch the fingerprint sensor to unlock your phone, authorize purchases, or sign in to apps. Be careful whose fingerprints you add. Even one added print can do any of these things.\n\nNote: Your fingerprint may be less secure than a strong pattern or PIN. <annotation id="url">Learn more</annotation></string>
|
||||
<string name="security_settings_fingerprint_enroll_introduction_message">Just touch the fingerprint sensor to unlock your phone, authorize purchases, or sign in to apps. Be careful whose fingerprints you add. Even one added print can do any of these things.\n\nNote: Your fingerprint may be less secure than a strong pattern or PIN.</string>
|
||||
<!-- Button text to cancel enrollment from the introduction [CHAR LIMIT=22] -->
|
||||
<string name="security_settings_fingerprint_enroll_introduction_cancel">Cancel</string>
|
||||
<!-- Button text to continue to the next screen from the introduction [CHAR LIMIT=22] -->
|
||||
|
@@ -20,7 +20,7 @@
|
||||
<Item
|
||||
android:enabled="false"
|
||||
android:id="@+id/fingerprint_introduction_message"
|
||||
android:layout="@layout/suw_item_link_description"/>
|
||||
android:layout="@layout/suw_items_description" />
|
||||
|
||||
<Item
|
||||
android:id="@+id/next_button"
|
||||
|
@@ -18,20 +18,12 @@ package com.android.settings.fingerprint;
|
||||
|
||||
import android.app.admin.DevicePolicyManager;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Typeface;
|
||||
import android.hardware.fingerprint.FingerprintManager;
|
||||
import android.os.Bundle;
|
||||
import android.os.UserHandle;
|
||||
import android.os.UserManager;
|
||||
import android.text.Annotation;
|
||||
import android.text.SpannableString;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.TextPaint;
|
||||
import android.text.style.URLSpan;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
import com.android.internal.logging.MetricsProto.MetricsEvent;
|
||||
import com.android.settings.ChooseLockGeneric;
|
||||
@@ -42,12 +34,15 @@ import com.android.setupwizardlib.GlifRecyclerLayout;
|
||||
import com.android.setupwizardlib.items.IItem;
|
||||
import com.android.setupwizardlib.items.Item;
|
||||
import com.android.setupwizardlib.items.RecyclerItemAdapter;
|
||||
import com.android.setupwizardlib.span.LinkSpan;
|
||||
|
||||
/**
|
||||
* Onboarding activity for fingerprint enrollment.
|
||||
*/
|
||||
public class FingerprintEnrollIntroduction extends FingerprintEnrollBase
|
||||
implements RecyclerItemAdapter.OnItemSelectedListener {
|
||||
implements RecyclerItemAdapter.OnItemSelectedListener, LinkSpan.OnClickListener {
|
||||
|
||||
private static final String TAG = "FingerprintIntro";
|
||||
|
||||
protected static final int CHOOSE_LOCK_GENERIC_REQUEST = 1;
|
||||
protected static final int FINGERPRINT_FIND_SENSOR_REQUEST = 2;
|
||||
@@ -66,13 +61,7 @@ public class FingerprintEnrollIntroduction extends FingerprintEnrollBase
|
||||
final RecyclerItemAdapter adapter = (RecyclerItemAdapter) layout.getAdapter();
|
||||
adapter.setOnItemSelectedListener(this);
|
||||
Item item = (Item) adapter.findItemById(R.id.fingerprint_introduction_message);
|
||||
item.setTitle(LearnMoreSpan.linkify(
|
||||
getText(R.string.security_settings_fingerprint_enroll_introduction_message),
|
||||
getString(R.string.help_url_fingerprint)));
|
||||
// setupwizard library automatically sets the divider inset to
|
||||
// R.dimen.suw_items_icon_divider_inset. We adjust this back to 0 as we do not want
|
||||
// an inset within settings.
|
||||
layout.setDividerInset(0);
|
||||
item.setTitle(getText(R.string.security_settings_fingerprint_enroll_introduction_message));
|
||||
updatePasswordQuality();
|
||||
}
|
||||
|
||||
@@ -145,6 +134,8 @@ public class FingerprintEnrollIntroduction extends FingerprintEnrollBase
|
||||
launchFindSensor(token);
|
||||
return;
|
||||
}
|
||||
} else if (requestCode == LEARN_MORE_REQUEST) {
|
||||
overridePendingTransition(R.anim.suw_slide_back_in, R.anim.suw_slide_back_out);
|
||||
}
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
@@ -170,51 +161,22 @@ public class FingerprintEnrollIntroduction extends FingerprintEnrollBase
|
||||
finish();
|
||||
}
|
||||
|
||||
private static class LearnMoreSpan extends URLSpan {
|
||||
private static final String TAG = "LearnMoreSpan";
|
||||
private static final Typeface TYPEFACE_MEDIUM =
|
||||
Typeface.create("sans-serif-medium", Typeface.NORMAL);
|
||||
|
||||
private LearnMoreSpan(String url) {
|
||||
super(url);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View widget) {
|
||||
Context ctx = widget.getContext();
|
||||
Intent intent = HelpUtils.getHelpIntent(ctx, getURL(), ctx.getClass().getName());
|
||||
@Override
|
||||
public void onClick(LinkSpan span) {
|
||||
if ("url".equals(span.getId())) {
|
||||
String url = getString(R.string.help_url_fingerprint);
|
||||
Intent intent = HelpUtils.getHelpIntent(this, url, getClass().getName());
|
||||
if (intent == null) {
|
||||
Log.w(LearnMoreSpan.TAG, "Null help intent.");
|
||||
Log.w(TAG, "Null help intent.");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
// This needs to be startActivityForResult even though we do not care about the
|
||||
// actual result because the help app needs to know about who invoked it.
|
||||
widget.startActivityForResult(intent, LEARN_MORE_REQUEST);
|
||||
startActivityForResult(intent, LEARN_MORE_REQUEST);
|
||||
} catch (ActivityNotFoundException e) {
|
||||
Log.w(LearnMoreSpan.TAG,
|
||||
"Actvity was not found for intent, " + intent.toString());
|
||||
Log.w(TAG, "Activity was not found for intent, " + e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDrawState(TextPaint ds) {
|
||||
super.updateDrawState(ds);
|
||||
ds.setUnderlineText(false);
|
||||
ds.setTypeface(TYPEFACE_MEDIUM);
|
||||
}
|
||||
|
||||
public static CharSequence linkify(CharSequence rawText, String uri) {
|
||||
SpannableString msg = new SpannableString(rawText);
|
||||
Annotation[] spans = msg.getSpans(0, msg.length(), Annotation.class);
|
||||
SpannableStringBuilder builder = new SpannableStringBuilder(msg);
|
||||
for (Annotation annotation : spans) {
|
||||
int start = msg.getSpanStart(annotation);
|
||||
int end = msg.getSpanEnd(annotation);
|
||||
LearnMoreSpan link = new LearnMoreSpan(uri);
|
||||
builder.setSpan(link, start, end, msg.getSpanFlags(link));
|
||||
}
|
||||
return builder;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -62,9 +62,6 @@ public class SetupFingerprintEnrollIntroduction extends FingerprintEnrollIntrodu
|
||||
final Item cancelItem = (Item) adapter.findItemById(R.id.cancel_button);
|
||||
cancelItem.setTitle(
|
||||
getText(R.string.security_settings_fingerprint_enroll_introduction_cancel_setup));
|
||||
|
||||
layout.setDividerInset(getResources().getDimensionPixelSize(
|
||||
R.dimen.suw_items_glif_icon_divider_inset));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user