Commit 6ff3114a authored by Alice Wang's avatar Alice Wang Committed by Commit Bot

[Android][WebSignin] Set the selected account before collapsing the sheet

This CL sets the selected account before collapsing the bottom sheet.
It is a minor improvement to avoid showing empty collapsed account list.

Bug: 1124737
Change-Id: I5f69cfe2a209ed0ef7bb9c17078b84452e743078
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2400279Reviewed-by: default avatarTanmoy Mollik <triploblastic@chromium.org>
Commit-Queue: Alice Wang <aliceywang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805307}
parent 05198712
...@@ -143,9 +143,9 @@ class AccountPickerBottomSheetMediator implements AccountPickerCoordinator.Liste ...@@ -143,9 +143,9 @@ class AccountPickerBottomSheetMediator implements AccountPickerCoordinator.Liste
// When a non-empty account list appears while it is currently zero-account screen, // When a non-empty account list appears while it is currently zero-account screen,
// we should change the screen to collapsed account list and set the selected account // we should change the screen to collapsed account list and set the selected account
// to the first account of the account list // to the first account of the account list
setSelectedAccountName(accounts.get(0).name);
mModel.set(AccountPickerBottomSheetProperties.VIEW_STATE, mModel.set(AccountPickerBottomSheetProperties.VIEW_STATE,
ViewState.COLLAPSED_ACCOUNT_LIST); ViewState.COLLAPSED_ACCOUNT_LIST);
setSelectedAccountName(accounts.get(0).name);
} else if (viewState == ViewState.COLLAPSED_ACCOUNT_LIST } else if (viewState == ViewState.COLLAPSED_ACCOUNT_LIST
&& AccountUtils.findAccountByName(accounts, mSelectedAccountName) == null) { && AccountUtils.findAccountByName(accounts, mSelectedAccountName) == null) {
// When it is already collapsed account list, we update the selected account only // When it is already collapsed account list, we update the selected account only
......
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