| 130 | } |
| 131 | |
| 132 | @Override |
| 133 | protected void onExecuted(Bundle args, List<EntityLog> items) { |
| 134 | DiffUtil.DiffResult diff = DiffUtil.calculateDiff(new DiffCallback(selected, items), false); |
| 135 | |
| 136 | selected = items; |
| 137 | |
| 138 | diff.dispatchUpdatesTo(new ListUpdateCallback() { |
| 139 | @Override |
| 140 | public void onInserted(int position, int count) { |
| 141 | Log.d("Inserted @" + position + " #" + count); |
| 142 | } |
| 143 | |
| 144 | @Override |
| 145 | public void onRemoved(int position, int count) { |
| 146 | Log.d("Removed @" + position + " #" + count); |
| 147 | } |
| 148 | |
| 149 | @Override |
| 150 | public void onMoved(int fromPosition, int toPosition) { |
| 151 | Log.d("Moved " + fromPosition + ">" + toPosition); |
| 152 | } |
| 153 | |
| 154 | @Override |
| 155 | public void onChanged(int position, int count, Object payload) { |
| 156 | Log.d("Changed @" + position + " #" + count); |
| 157 | } |
| 158 | }); |
| 159 | |
| 160 | try { |
| 161 | diff.dispatchUpdatesTo(AdapterLog.this); |
| 162 | if (callback != null) |
| 163 | callback.run(); |
| 164 | } catch (Throwable ex) { |
| 165 | Log.e(ex); |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | @Override |
| 170 | protected void onException(Bundle args, Throwable ex) { |