Commit c9e732f0 authored by newt's avatar newt Committed by Commit bot

Fix divider after switch on Save Passwords screen.

BUG=455047

Review URL: https://codereview.chromium.org/970023003

Cr-Commit-Position: refs/heads/master@{#319184}
parent 20e82420
...@@ -272,7 +272,8 @@ public class ManageSavedPasswordsPreferences extends PreferenceFragment ...@@ -272,7 +272,8 @@ public class ManageSavedPasswordsPreferences extends PreferenceFragment
} }
private void displayManageAccountLink() { private void displayManageAccountLink() {
if (PasswordUIView.shouldDisplayManageAccountLink() boolean shouldDisplayLink = PasswordUIView.shouldDisplayManageAccountLink();
if (shouldDisplayLink
&& getPreferenceScreen().findPreference(PREF_MANAGE_ACCOUNT_LINK) == null) { && getPreferenceScreen().findPreference(PREF_MANAGE_ACCOUNT_LINK) == null) {
if (mLinkPref == null) { if (mLinkPref == null) {
ForegroundColorSpan colorSpan = new ForegroundColorSpan( ForegroundColorSpan colorSpan = new ForegroundColorSpan(
...@@ -287,10 +288,9 @@ public class ManageSavedPasswordsPreferences extends PreferenceFragment ...@@ -287,10 +288,9 @@ public class ManageSavedPasswordsPreferences extends PreferenceFragment
mLinkPref.setOrder(ORDER_MANAGE_ACCOUNT_LINK); mLinkPref.setOrder(ORDER_MANAGE_ACCOUNT_LINK);
} }
getPreferenceScreen().addPreference(mLinkPref); getPreferenceScreen().addPreference(mLinkPref);
} else { }
// Draw a divider only if the preference after mSavePasswordsSwitch is not selectable, // Draw a divider only if the preference after mSavePasswordsSwitch is not selectable,
// in which case the ListView itself doesn't draw a divider. // in which case the ListView itself doesn't draw a divider.
mSavePasswordsSwitch.setDrawDivider(true); mSavePasswordsSwitch.setDrawDivider(!shouldDisplayLink);
}
} }
} }
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