Commit ef74bd21 authored by Boris Sazonov's avatar Boris Sazonov Committed by Commit Bot

[Android] Fix parent_accounts alignment in AccountManagementFragment

This CL reimplements parent_accounts preference row in
AccountManagementFragment to fix alignment issues on older Android
versions. Instead of providing custom preference layout via aapt:attr,
TextMessagePreference is used. This CL also specifies child_content
selectability in XML file.

Bug: 877136
Change-Id: I2428c693d3f688b33b6c727df0210465f1ab37d7
Reviewed-on: https://chromium-review.googlesource.com/1187153Reviewed-by: default avatarTheresa <twellington@chromium.org>
Commit-Queue: Boris Sazonov <bsazonov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585767}
parent 46d832cc
......@@ -5,8 +5,7 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:aapt="http://schemas.android.com/aapt">
xmlns:tools="http://schemas.android.com/tools">
<PreferenceCategory
android:key="accounts_category"
......@@ -19,37 +18,13 @@
android:key="parental_settings"
android:title="@string/account_management_parental_settings"/>
<Preference
android:key="parent_accounts">
<aapt:attr name="android:layout">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingTop="8dp"
android:paddingBottom="8dp">
<TextView android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"/>
<TextView android:id="@android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/BlackBody"/>
<LinearLayout android:id="@android:id/widget_frame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"/>
</LinearLayout>
</aapt:attr>
</Preference>
<org.chromium.chrome.browser.preferences.TextMessagePreference
android:key="parent_accounts"
tools:summary="@string/account_management_two_parent_names"/>
<Preference
android:key="child_content"
android:selectable="false"
android:title="@string/account_management_child_content_title"/>
<Preference
......
......@@ -326,7 +326,6 @@ public class AccountManagementFragment extends PreferenceFragment
parentText = res.getString(R.string.account_management_no_parental_data);
}
parentAccounts.setSummary(parentText);
parentAccounts.setSelectable(false);
final int childContentSummary;
int defaultBehavior = prefService.getDefaultSupervisedUserFilteringBehavior();
......@@ -338,7 +337,6 @@ public class AccountManagementFragment extends PreferenceFragment
childContentSummary = R.string.account_management_child_content_all;
}
childContent.setSummary(childContentSummary);
childContent.setSelectable(false);
Drawable newIcon = ApiCompatibilityUtils.getDrawable(
getResources(), R.drawable.ic_drive_site_white_24dp);
......
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