Highlight the first result for search.

Fixes b/5614128 Email doesn't auto display first search result after result list appears

Change-Id: I1843471bc3fe018151ed2a30ceb3e19eb2af24e9
This commit is contained in:
Mindy Pereira 2011-11-14 13:00:39 -08:00
parent 30fd3107c4
commit bed1b4fa7a

View File

@ -1320,6 +1320,13 @@ public class MessageListFragment extends ListFragment
mIsRefreshable = cursor.mIsRefreshable;
mCountTotalAccounts = cursor.mCountTotalAccounts;
// If this is a search result, open the first message.
if (UiUtilities.useTwoPane(getActivity()) && mIsFirstLoad && mListContext.isSearch()
&& cursor.getCount() > 0) {
cursor.moveToFirst();
onMessageOpen(getMailboxId(), cursor.getLong(MessagesAdapter.COLUMN_ID));
}
// Suspend message notifications as long as we're resumed
adjustMessageNotification(false);