Rewriting classes in kotlin

This commit is contained in:
antonio 2023-03-02 10:48:30 +01:00
parent 74ec37cb5e
commit 103cd308de
43 changed files with 818 additions and 2325 deletions

View file

@ -90,20 +90,11 @@ public class ArtistAdapter extends RecyclerView.Adapter<ArtistAdapter.ViewHolder
}
private void setArtistCover(Artist artist, ImageView cover) {
ArtistRepository artistRepository = new ArtistRepository(App.getInstance());
LiveData<Artist> livedata = artistRepository.getArtistFullInfo(artist.getId());
livedata.observeForever(new Observer<Artist>() {
@Override
public void onChanged(Artist artist) {
CustomGlideRequest.Builder
.from(context, artist.getId(), CustomGlideRequest.ARTIST_PIC, artist.getImageUrl())
.build()
.transform(new CenterCrop(), new RoundedCorners(CustomGlideRequest.CORNER_RADIUS))
.into(cover);
livedata.removeObserver(this);
}
});
CustomGlideRequest.Builder
.from(context, artist.getPrimary(), CustomGlideRequest.ARTIST_PIC, null)
.build()
.transform(new CenterCrop(), new RoundedCorners(CustomGlideRequest.CORNER_RADIUS))
.into(cover);
}
public class ViewHolder extends RecyclerView.ViewHolder {