Commit 41dfe8f1 authored by Mathias Carlen's avatar Mathias Carlen Committed by Commit Bot

[Autofill Assistant] Terms and service checkbox update.

This patch implements the terms and services according to the current UI
spec. It introduces a new, light blue to use for the box around the
checkbox. Further, we want to highlight the domain, which is
accomplished via Html.fromHtml and wrapping the domain in bold tags.

Screenshot: https://screenshot.googleplex.com/H5PLFhvuUgK.png
Bug: 806868
Change-Id: I362ab9f76ebdefbf485f0e3389188a2d8e18710f
Reviewed-on: https://chromium-review.googlesource.com/c/1333817
Commit-Queue: Mathias Carlen <mcarlen@chromium.org>
Reviewed-by: default avatarTheresa <twellington@chromium.org>
Reviewed-by: default avatarGanggui Tang <gogerald@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608115}
parent 03b05d64
<!-- Copyright 2018 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners
android:radius="4dp" />
<solid
android:color="@color/autofill_assistant_light_blue" />
</shape>
......@@ -34,13 +34,38 @@
</org.chromium.chrome.browser.widget.FadingEdgeScrollView>
<CheckBox
android:id="@+id/terms_checkbox"
android:layout_width="match_parent"
<!--
Padding on the checkbox does not affect the padding to the left of the
checkbox field, so we wrap it in a FrameLayout and control the margins and
padding there.
-->
<FrameLayout
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:padding="2dp"
android:text="@string/autofill_assistant_terms" />
android:layout_width="match_parent"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="28dp"
android:layout_marginBottom="20dp"
android:paddingTop="9dp"
android:paddingBottom="9dp"
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:background="@drawable/autofill_assistant_checkbox_bg" >
<!--
TODO(crbug.com/806868): Remove the tint and text color to be compliant
with Chrome style.
-->
<android.support.v7.widget.AppCompatCheckBox
android:id="@+id/terms_checkbox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="0dp"
android:padding="0dp"
android:paddingStart="12dp"
android:text="@string/autofill_assistant_terms" />
</FrameLayout>
<include layout="@layout/autofill_assistant_payment_request_bottom_bar" />
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2014 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<resources>
<!--
TODO(crbuc.com/806868): Use a Chrome approved color and remove this.
Please see src/ui/android/java/res/values/colors.xml for the shared common colors.
-->
<color name="autofill_assistant_light_blue">#e9f0fd</color>
</resources>
......@@ -23,7 +23,8 @@
<style
name="TextAppearance.AutofillAssistantFilledButton"
parent="RobotoMediumStyle">
<item name="android:textColor">@color/modern_grey_50</item>
<item name="android:textColor">@color/modern_grey_50</item>
<item name="android:textSize">@dimen/text_size_medium</item>
</style>
</resources>
......@@ -20,6 +20,7 @@ import android.support.v4.view.animation.LinearOutSlowInInterpolator;
import android.text.SpannableString;
import android.text.TextUtils;
import android.text.method.LinkMovementMethod;
import android.text.style.StyleSpan;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
......@@ -319,6 +320,10 @@ public class PaymentRequestUI implements DialogInterface.OnDismissListener, View
// Terms and services accepted checkbox. The state is passively propagated along to the
// client when the pay/continue button is clicked.
mTermsCheckBox = (CheckBox) mRequestView.findViewById(R.id.terms_checkbox);
StyleSpan boldSpan = new StyleSpan(android.graphics.Typeface.BOLD);
String termsString = context.getString(R.string.autofill_assistant_terms, origin);
mTermsCheckBox.setText(
SpanApplier.applySpans(termsString, new SpanInfo("<b>", "</b>", boldSpan)));
// Create all the possible sections.
mSectionSeparators = new ArrayList<>();
......
......@@ -17,7 +17,7 @@
Confirm
</message>
<message name="IDS_AUTOFILL_ASSISTANT_TERMS" desc="The text for the terms and service acceptance checkbox. Sentence-cased." formatter_data="android_java">
I know the terms and conditions and accept them (leave unclicked to read the terms and conditions from the website).
I know the terms and conditions, privacy policy and right of withdrawal of <ph name="BEGIN_BOLD">&lt;b&gt;</ph><ph name="ORIGIN">%1$s<ex>google.com</ex></ph><ph name="END_BOLD">&lt;/b&gt;</ph> (leave unchecked to read).
</message>
</if>
</grit-part>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment