OSDN Git Service

Combine setCategories() and setSuggestions() in DashboardAdapter.
authorDoris Ling <dling@google.com>
Fri, 15 Jul 2016 18:18:23 +0000 (11:18 -0700)
committerDoris Ling <dling@google.com>
Fri, 15 Jul 2016 20:08:56 +0000 (13:08 -0700)
commit38d8582abe01ced40333f77d99c43d6111b047ed
tree66ca178644bad0dd9bbc3168e75bed8b716b84a3
parent995a5144cf1e64129530fba5c8704a0d9b57fa92
Combine setCategories() and setSuggestions() in DashboardAdapter.

In DashboardSummary.rebuildUI(), we first update the adapter with the
current categories, then run the async task to update the adapter with
the suggestions. This causes the adapter to first layout the existing
categories, and relayout when the suggestions is available. This causes
the suggestions view and categories view to overlap before the
relayout is complete.

Since categories and suggestions are borh set each time we try to
rebuild the UI, delaying the update for categories until the suggestions
are ready will avoid the unnecessary relayout of the list elements.

Ran app launch test for Settings app with the change and launch time is
between 412ms and 486ms in 10 runs, which does not show much delay in
app launch time with delaying updating the categories.

Bug: 29318104
Change-Id: I03ae2386392315f28fe2c361682f2f3252e9f827
src/com/android/settings/dashboard/DashboardAdapter.java
src/com/android/settings/dashboard/DashboardSummary.java