Commit 66daa4eb authored by Alice Wang's avatar Alice Wang Committed by Commit Bot

[Android][Signin] Move add account icon to xml

This CL moves the add account icon from code to xml file to make it
easier to reuse the xml file in other places.

Bug: 1107423
Change-Id: Id77a69d982b97088e58a7b357993587f05e6025e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2377937Reviewed-by: default avatarBoris Sazonov <bsazonov@chromium.org>
Reviewed-by: default avatarTanmoy Mollik <triploblastic@chromium.org>
Commit-Queue: Alice Wang <aliceywang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805211}
parent 57da5904
......@@ -5,6 +5,7 @@
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawablePadding="22dp"
......@@ -14,4 +15,5 @@
android:paddingBottom="8dp"
android:gravity="center_vertical"
android:text="@string/signin_add_account_to_device"
android:textAppearance="@style/TextAppearance.TextLarge.Primary" />
android:textAppearance="@style/TextAppearance.TextLarge.Primary"
app:drawableStartCompat="@drawable/ic_person_add_24dp" />
......@@ -34,16 +34,17 @@ class AddAccountRowViewBinder {
}
static void bindView(PropertyModel model, View view, PropertyKey propertyKey) {
TextView textView = (TextView) view;
int drawableRes = ChromeFeatureList.isEnabled(ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY)
? R.drawable.ic_person_add_24dp
: R.drawable.ic_add_circle_40dp;
// Set the vector drawable programmatically because app:drawableStartCompat is
// only available after AndroidX appcompat library.
// TODO(https://crbug.com/948367): Use app:drawableStartCompat.
textView.setCompoundDrawablesRelativeWithIntrinsicBounds(
AppCompatResources.getDrawable(view.getContext(), drawableRes), null, null, null);
if (!ChromeFeatureList.isEnabled(ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY)) {
// Set the vector drawable programmatically because app:drawableStartCompat is
// only available after AndroidX appcompat library.
// TODO(https://crbug.com/948367): Use app:drawableStartCompat.
TextView textView = (TextView) view;
textView.setCompoundDrawablesRelativeWithIntrinsicBounds(
AppCompatResources.getDrawable(
view.getContext(), R.drawable.ic_add_circle_40dp),
null, null, null);
}
if (propertyKey == AddAccountRowProperties.ON_CLICK_LISTENER) {
view.setOnClickListener(model.get(AddAccountRowProperties.ON_CLICK_LISTENER));
} else {
......
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