File tree 2 files changed +31
-1
lines changed
app/src/main/java/fr/free/nrw/commons/upload
2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -198,6 +198,22 @@ public void setCategories(List<CategoryItem> categories) {
198
198
} else {
199
199
adapter .setItems (categories );
200
200
}
201
+ adapter .notifyDataSetChanged ();
202
+
203
+ // Nested waiting for search result data to load into the category
204
+ // list and smoothly scroll to the top of the search result list.
205
+ rvCategories .post (new Runnable () {
206
+ @ Override
207
+ public void run () {
208
+ rvCategories .smoothScrollToPosition (0 );
209
+ rvCategories .post (new Runnable () {
210
+ @ Override
211
+ public void run () {
212
+ rvCategories .smoothScrollToPosition (0 );
213
+ }
214
+ });
215
+ }
216
+ });
201
217
}
202
218
203
219
@ Override
Original file line number Diff line number Diff line change @@ -246,7 +246,21 @@ public void setDepictsList(List<DepictedItem> depictedItemList) {
246
246
adapter .setItems (depictedItemList );
247
247
}
248
248
}
249
- depictsRecyclerView .smoothScrollToPosition (0 );
249
+
250
+ // Nested waiting for search result data to load into the depicted item
251
+ // list and smoothly scroll to the top of the search result list.
252
+ depictsRecyclerView .post (new Runnable () {
253
+ @ Override
254
+ public void run () {
255
+ depictsRecyclerView .smoothScrollToPosition (0 );
256
+ depictsRecyclerView .post (new Runnable () {
257
+ @ Override
258
+ public void run () {
259
+ depictsRecyclerView .smoothScrollToPosition (0 );
260
+ }
261
+ });
262
+ }
263
+ });
250
264
}
251
265
252
266
/**
You can’t perform that action at this time.
0 commit comments