mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 09:53:33 +00:00
Fix a bunch of lint warning
This commit is contained in:
parent
a49626aa43
commit
81ba6970f5
19 changed files with 36 additions and 256 deletions
|
|
@ -26,14 +26,10 @@ import retrofit2.Callback;
|
|||
public class AlbumCatalogueViewModel extends AndroidViewModel {
|
||||
private MutableLiveData<List<Album>> albumList = new MutableLiveData<>(new ArrayList<>());
|
||||
|
||||
private AlbumRepository albumRepository;
|
||||
private String query = "";
|
||||
private int page = 0;
|
||||
|
||||
public AlbumCatalogueViewModel(@NonNull Application application) {
|
||||
super(application);
|
||||
|
||||
albumRepository = new AlbumRepository(application);
|
||||
}
|
||||
|
||||
public LiveData<List<Album>> getAlbumList() {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ import com.cappielloantonio.play.repository.SongRepository;
|
|||
import java.util.List;
|
||||
|
||||
public class AlbumPageViewModel extends AndroidViewModel {
|
||||
private SongRepository songRepository;
|
||||
private AlbumRepository albumRepository;
|
||||
private ArtistRepository artistRepository;
|
||||
|
||||
|
|
@ -29,7 +28,6 @@ public class AlbumPageViewModel extends AndroidViewModel {
|
|||
public AlbumPageViewModel(@NonNull Application application) {
|
||||
super(application);
|
||||
|
||||
songRepository = new SongRepository(application);
|
||||
albumRepository = new AlbumRepository(application);
|
||||
artistRepository = new ArtistRepository(application);
|
||||
}
|
||||
|
|
@ -50,8 +48,4 @@ public class AlbumPageViewModel extends AndroidViewModel {
|
|||
public LiveData<Artist> getArtist() {
|
||||
return artistRepository.getArtistInfo(album.getArtistId());
|
||||
}
|
||||
|
||||
public LiveData<Album> getAlbumInfo() {
|
||||
return albumRepository.getAlbumInfo(album.getId());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import com.cappielloantonio.play.repository.ArtistRepository;
|
|||
|
||||
public class ArtistBottomSheetViewModel extends AndroidViewModel {
|
||||
private AlbumRepository albumRepository;
|
||||
private ArtistRepository artistRepository;
|
||||
|
||||
private Artist artist;
|
||||
|
||||
|
|
@ -19,7 +18,6 @@ public class ArtistBottomSheetViewModel extends AndroidViewModel {
|
|||
super(application);
|
||||
|
||||
albumRepository = new AlbumRepository(application);
|
||||
artistRepository = new ArtistRepository(application);
|
||||
}
|
||||
|
||||
public Artist getArtist() {
|
||||
|
|
|
|||
|
|
@ -26,13 +26,8 @@ import retrofit2.Callback;
|
|||
public class ArtistCatalogueViewModel extends AndroidViewModel {
|
||||
private MutableLiveData<List<Artist>> artistList = new MutableLiveData<>(new ArrayList<>());
|
||||
|
||||
private ArtistRepository artistRepository;
|
||||
private String query = "";
|
||||
|
||||
public ArtistCatalogueViewModel(@NonNull Application application) {
|
||||
super(application);
|
||||
|
||||
artistRepository = new ArtistRepository(application);
|
||||
}
|
||||
|
||||
public LiveData<List<Artist>> getArtistList() {
|
||||
|
|
|
|||
|
|
@ -18,14 +18,11 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
public class ArtistPageViewModel extends AndroidViewModel {
|
||||
private SongRepository songRepository;
|
||||
private AlbumRepository albumRepository;
|
||||
private ArtistRepository artistRepository;
|
||||
|
||||
private List<Song> randomList = new ArrayList<>();
|
||||
private LiveData<List<Song>> songList = new MutableLiveData<>();
|
||||
private LiveData<List<Album>> albumList = new MutableLiveData<>();
|
||||
private LiveData<List<Artist>> artistList = new MutableLiveData<>();
|
||||
private LiveData<Artist> artistInfo = new MutableLiveData<>();
|
||||
|
||||
private Artist artist;
|
||||
|
|
@ -33,7 +30,6 @@ public class ArtistPageViewModel extends AndroidViewModel {
|
|||
public ArtistPageViewModel(@NonNull Application application) {
|
||||
super(application);
|
||||
|
||||
songRepository = new SongRepository(application);
|
||||
albumRepository = new AlbumRepository(application);
|
||||
artistRepository = new ArtistRepository(application);
|
||||
}
|
||||
|
|
@ -48,11 +44,6 @@ public class ArtistPageViewModel extends AndroidViewModel {
|
|||
return artistInfo;
|
||||
}
|
||||
|
||||
public List<Song> getArtistRandomSongList() {
|
||||
// randomList = songRepository.getArtistListLiveRandomSong(artist.id);
|
||||
return randomList;
|
||||
}
|
||||
|
||||
public LiveData<List<Song>> getArtistTopSongList(int count) {
|
||||
songList = artistRepository.getTopSongs(artist.getName(), count);
|
||||
return songList;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ import java.util.List;
|
|||
public class FilterViewModel extends AndroidViewModel {
|
||||
private GenreRepository genreRepository;
|
||||
|
||||
private LiveData<List<Genre>> allGenres;
|
||||
private ArrayList<String> selectedFiltersID = new ArrayList<>();
|
||||
private ArrayList<String> selectedFilters = new ArrayList<>();
|
||||
|
||||
|
|
@ -26,8 +25,7 @@ public class FilterViewModel extends AndroidViewModel {
|
|||
}
|
||||
|
||||
public LiveData<List<Genre>> getGenreList() {
|
||||
allGenres = genreRepository.getGenres(false, -1);
|
||||
return allGenres;
|
||||
return genreRepository.getGenres(false, -1);
|
||||
}
|
||||
|
||||
public void addFilter(String filterID, String filterName) {
|
||||
|
|
|
|||
|
|
@ -15,8 +15,6 @@ import java.util.List;
|
|||
public class PlaylistPageViewModel extends AndroidViewModel {
|
||||
private PlaylistRepository playlistRepository;
|
||||
|
||||
private MutableLiveData<List<Song>> songLiveList = new MutableLiveData<>();
|
||||
|
||||
private Playlist playlist;
|
||||
|
||||
public PlaylistPageViewModel(@NonNull Application application) {
|
||||
|
|
@ -26,8 +24,7 @@ public class PlaylistPageViewModel extends AndroidViewModel {
|
|||
}
|
||||
|
||||
public MutableLiveData<List<Song>> getPlaylistSongLiveList() {
|
||||
songLiveList = playlistRepository.getPlaylistSongs(playlist.getId());
|
||||
return songLiveList;
|
||||
return playlistRepository.getPlaylistSongs(playlist.getId());
|
||||
}
|
||||
|
||||
public Playlist getPlaylist() {
|
||||
|
|
|
|||
|
|
@ -26,24 +26,15 @@ public class SearchViewModel extends AndroidViewModel {
|
|||
|
||||
private String query = "";
|
||||
|
||||
private SongRepository songRepository;
|
||||
private AlbumRepository albumRepository;
|
||||
private ArtistRepository artistRepository;
|
||||
private GenreRepository genreRepository;
|
||||
private SearchingRepository searchingRepository;
|
||||
|
||||
private LiveData<List<Song>> searchSong = new MutableLiveData<>(new ArrayList<>());
|
||||
private LiveData<List<Album>> searchAlbum = new MutableLiveData<>(new ArrayList<>());
|
||||
private LiveData<List<Artist>> searchArtist = new MutableLiveData<>(new ArrayList<>());
|
||||
private LiveData<List<Genre>> searchGenre = new MutableLiveData<>(new ArrayList<>());
|
||||
|
||||
public SearchViewModel(@NonNull Application application) {
|
||||
super(application);
|
||||
|
||||
songRepository = new SongRepository(application);
|
||||
albumRepository = new AlbumRepository(application);
|
||||
artistRepository = new ArtistRepository(application);
|
||||
genreRepository = new GenreRepository(application);
|
||||
searchingRepository = new SearchingRepository(application);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,8 +33,6 @@ public class SongListPageViewModel extends AndroidViewModel {
|
|||
|
||||
public int year = 0;
|
||||
|
||||
private MutableLiveData<List<Song>> songList;
|
||||
|
||||
public SongListPageViewModel(@NonNull Application application) {
|
||||
super(application);
|
||||
|
||||
|
|
@ -44,7 +42,7 @@ public class SongListPageViewModel extends AndroidViewModel {
|
|||
}
|
||||
|
||||
public LiveData<List<Song>> getSongList() {
|
||||
songList = new MutableLiveData<>(new ArrayList<>());
|
||||
MutableLiveData<List<Song>> songList = new MutableLiveData<>(new ArrayList<>());
|
||||
|
||||
switch (title) {
|
||||
case Song.RECENTLY_PLAYED:
|
||||
|
|
|
|||
|
|
@ -1,125 +0,0 @@
|
|||
package com.cappielloantonio.play.viewmodel;
|
||||
|
||||
import android.app.Application;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.AndroidViewModel;
|
||||
|
||||
import com.cappielloantonio.play.model.Playlist;
|
||||
import com.cappielloantonio.play.model.Song;
|
||||
import com.cappielloantonio.play.repository.AlbumRepository;
|
||||
import com.cappielloantonio.play.repository.ArtistRepository;
|
||||
import com.cappielloantonio.play.repository.GenreRepository;
|
||||
import com.cappielloantonio.play.repository.PlaylistRepository;
|
||||
import com.cappielloantonio.play.repository.SongRepository;
|
||||
import com.cappielloantonio.play.subsonic.models.AlbumID3;
|
||||
import com.cappielloantonio.play.subsonic.models.ArtistID3;
|
||||
import com.cappielloantonio.play.subsonic.models.Genre;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SyncViewModel extends AndroidViewModel {
|
||||
private static final String TAG = "SyncViewModel";
|
||||
|
||||
private boolean syncAlbum = false;
|
||||
private boolean syncArtist = false;
|
||||
private boolean syncGenres = false;
|
||||
private boolean syncPlaylist = false;
|
||||
private boolean syncSong = false;
|
||||
|
||||
private ArrayList<AlbumID3> albumList = new ArrayList<>();
|
||||
private ArrayList<ArtistID3> artistList = new ArrayList<>();
|
||||
private ArrayList<Genre> genreList = new ArrayList<>();
|
||||
private ArrayList<Playlist> playlistList = new ArrayList<>();
|
||||
private ArrayList<Song> songList = new ArrayList<>();
|
||||
|
||||
private final SongRepository songRepository;
|
||||
private AlbumRepository albumRepository;
|
||||
private ArtistRepository artistRepository;
|
||||
private PlaylistRepository playlistRepository;
|
||||
private GenreRepository genreRepository;
|
||||
|
||||
public SyncViewModel(@NonNull Application application) {
|
||||
super(application);
|
||||
|
||||
songRepository = new SongRepository(application);
|
||||
albumRepository = new AlbumRepository(application);
|
||||
artistRepository = new ArtistRepository(application);
|
||||
playlistRepository = new PlaylistRepository(application);
|
||||
genreRepository = new GenreRepository(application);
|
||||
}
|
||||
|
||||
public void setArguemnts(Bundle bundle) {
|
||||
syncAlbum = bundle.getBoolean("sync_album", false);
|
||||
syncArtist = bundle.getBoolean("sync_artist", false);
|
||||
syncGenres = bundle.getBoolean("sync_genres", false);
|
||||
syncPlaylist = bundle.getBoolean("sync_playlist", false);
|
||||
syncSong = bundle.getBoolean("sync_song", false);
|
||||
}
|
||||
|
||||
public boolean isSyncAlbum() {
|
||||
return syncAlbum;
|
||||
}
|
||||
|
||||
public boolean isSyncArtist() {
|
||||
return syncArtist;
|
||||
}
|
||||
|
||||
public boolean isSyncGenres() {
|
||||
return syncGenres;
|
||||
}
|
||||
|
||||
public boolean isSyncPlaylist() {
|
||||
return syncPlaylist;
|
||||
}
|
||||
|
||||
public boolean isSyncSong() {
|
||||
return syncSong;
|
||||
}
|
||||
|
||||
public ArrayList<AlbumID3> getAlbumList() {
|
||||
return albumList;
|
||||
}
|
||||
|
||||
public void addToAlbumList(List<AlbumID3> albumList) {
|
||||
this.albumList.addAll(albumList);
|
||||
}
|
||||
|
||||
public ArrayList<ArtistID3> getArtistList() {
|
||||
return artistList;
|
||||
}
|
||||
|
||||
public void setArtistList(ArrayList<ArtistID3> artistList) {
|
||||
this.artistList = artistList;
|
||||
}
|
||||
|
||||
public ArrayList<Genre> getGenreList() {
|
||||
return genreList;
|
||||
}
|
||||
|
||||
public void setGenreList(ArrayList<Genre> genreList) {
|
||||
this.genreList = genreList;
|
||||
}
|
||||
|
||||
public ArrayList<Playlist> getPlaylistList() {
|
||||
return playlistList;
|
||||
}
|
||||
|
||||
public void setPlaylistList(ArrayList<Playlist> playlistList) {
|
||||
this.playlistList = playlistList;
|
||||
}
|
||||
|
||||
public ArrayList<Song> getSongList() {
|
||||
return songList;
|
||||
}
|
||||
|
||||
public void setSongList(ArrayList<Song> songList) {
|
||||
this.songList = songList;
|
||||
}
|
||||
|
||||
public void addToSongList(ArrayList<Song> songList) {
|
||||
this.songList.addAll(songList);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue