OSDN Git Service

Elicit ItemsData class and add DiffUtil.Callback
authorjackqdyulei <jackqdyulei@google.com>
Thu, 6 Oct 2016 01:05:52 +0000 (18:05 -0700)
committerjackqdyulei <jackqdyulei@google.com>
Fri, 21 Oct 2016 18:02:29 +0000 (11:02 -0700)
commit0b818b79db3982e67f03740009d7a62a414aed25
tree62bd857eed78f529064cadffb542280a019966dc
parentc33b78df9c5b63515cfee290ddc2dd6e74140044
Elicit ItemsData class and add DiffUtil.Callback

In the previous version, when there is a minor change in data, we
will refresh the whole screen(and data) by invoking "recountItems"
and "notifyDataSetChanged", which did lots of unnecessary works.

In this new cl, I elicit ItemsData class, which encapsulates the list
data used in adapter. When data changed, I build another ItemsData and
use the DiffUtil.Callback to calculate diffs between ItemsDatas. In
this way we can only refresh the items that changed in adapter.

Since I cannot find usage of see_all.xml anymore, I delete the relevant
code as well as the resource files.

Bug: 30319913
Test: make RunSettingsRoboTests
Change-Id: I4f753a26f624affea6c6c35d49cfb9c43fb74fe6
res/layout/see_all.xml [deleted file]
res/values/strings.xml
src/com/android/settings/dashboard/DashboardAdapter.java
src/com/android/settings/dashboard/DashboardData.java [new file with mode: 0644]
tests/robotests/src/com/android/settings/dashboard/DashboardDataTest.java [new file with mode: 0644]