mirror of
https://github.com/CappielloAntonio/tempo.git
synced 2026-01-30 06:12:07 +00:00
style: code cleanup
This commit is contained in:
@@ -51,7 +51,7 @@ public class AlbumCatalogueAdapter extends RecyclerView.Adapter<AlbumCatalogueAd
|
||||
|
||||
@Override
|
||||
protected void publishResults(CharSequence constraint, FilterResults results) {
|
||||
albums = (List) results.values;
|
||||
albums = (List<AlbumID3>) results.values;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
};
|
||||
@@ -165,4 +165,4 @@ public class AlbumCatalogueAdapter extends RecyclerView.Adapter<AlbumCatalogueAd
|
||||
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.cappielloantonio.tempo.viewmodel;
|
||||
|
||||
import android.app.Application;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.AndroidViewModel;
|
||||
@@ -34,9 +33,8 @@ public class AlbumCatalogueViewModel extends AndroidViewModel {
|
||||
}
|
||||
|
||||
public void loadAlbums() {
|
||||
page = 0;
|
||||
albumList.setValue(new ArrayList<>());
|
||||
status = Status.RUNNING;
|
||||
albumList.setValue(new ArrayList<>());
|
||||
loadAlbums(500);
|
||||
}
|
||||
|
||||
@@ -63,6 +61,8 @@ public class AlbumCatalogueViewModel extends AndroidViewModel {
|
||||
|
||||
if (media.size() == size) {
|
||||
loadAlbums(size);
|
||||
} else {
|
||||
status = Status.STOPPED;
|
||||
}
|
||||
}
|
||||
}, size, size * page++);
|
||||
@@ -93,4 +93,4 @@ public class AlbumCatalogueViewModel extends AndroidViewModel {
|
||||
RUNNING,
|
||||
STOPPED
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user