fixed results being duplicated when reopening the app
This commit is contained in:
parent
5d99255ef7
commit
b83c73048b
2 changed files with 4 additions and 3 deletions
|
|
@ -121,8 +121,8 @@ public class DownloadsFragment extends Fragment implements DownloadsRecyclerView
|
|||
databaseManager = new DatabaseManager(context);
|
||||
databaseManager.clearHistoryItem(v, false);
|
||||
int position = downloadsObjects.indexOf(v);
|
||||
downloadsObjects.remove(v);
|
||||
downloadsRecyclerViewAdapter.notifyItemRemoved(position);
|
||||
downloadsObjects.remove(v);
|
||||
|
||||
if (downloadsObjects.isEmpty()) initCards();
|
||||
downloading = false;
|
||||
|
|
|
|||
|
|
@ -297,7 +297,6 @@ public class HomeFragment extends Fragment implements HomeRecyclerViewAdapter.On
|
|||
Thread thread = new Thread(() -> {
|
||||
databaseManager = new DatabaseManager(context);
|
||||
resultObjects = databaseManager.getResults();
|
||||
Log.e(TAG, resultObjects.toString());
|
||||
String playlistTitle = "";
|
||||
try {
|
||||
playlistTitle = resultObjects.get(0).getPlaylistTitle();
|
||||
|
|
@ -329,7 +328,9 @@ public class HomeFragment extends Fragment implements HomeRecyclerViewAdapter.On
|
|||
}
|
||||
|
||||
uiHandler.post(() -> {
|
||||
homeRecyclerViewAdapter.add(resultObjects);
|
||||
if (homeRecyclerViewAdapter.getItemCount() != resultObjects.size()){
|
||||
homeRecyclerViewAdapter.add(resultObjects);
|
||||
}
|
||||
shimmerCards.stopShimmer();
|
||||
shimmerCards.setVisibility(View.GONE);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue