use of com.sdsmdg.harjot.MusicDNA.fragments.LocalMusicFragments.ArtistFragment in project MusicDNA by harjot-oberai.
the class HomeActivity method updateArtistList.
private void updateArtistList(String query) {
finalArtists.clear();
for (int i = 0; i < artists.size(); i++) {
Artist artist = artists.get(i);
String tmp1 = artist.getName().toLowerCase();
String tmp2 = query.toLowerCase();
if (tmp1.contains(tmp2)) {
finalArtists.add(artist);
}
}
LocalMusicViewPagerFragment flmFrag = (LocalMusicViewPagerFragment) fragMan.findFragmentByTag("local");
if (flmFrag != null) {
ArtistFragment aFrag = (ArtistFragment) flmFrag.getFragmentByPosition(2);
if (aFrag != null) {
aFrag.updateAdapter();
}
}
}
use of com.sdsmdg.harjot.MusicDNA.fragments.LocalMusicFragments.ArtistFragment in project MusicDNA by harjot-oberai.
the class HomeActivity method onEditSongSave.
////////////////////////////////////////////////////////////////////////////////////////////////
/*
* EditSongFragment callbacks START
* onEditSongSave() -> called when save is clicked to store edited fields.
* deleteMediaStoreCache() -> used to delete the media store cache so that it is rebuilt and new album art is cached.
* getNewBitmap() -> called to statr the image picker intent for album art.
*/
@Override
public void onEditSongSave(boolean wasSaveSuccessful) {
hideFragment("Edit");
if (!wasSaveSuccessful) {
Toast.makeText(this, "Error occured while editing", Toast.LENGTH_SHORT).show();
return;
}
MediaCacheUtils.updateMediaCache(editSong.getTitle(), editSong.getArtist(), editSong.getAlbum(), editSong.getId(), this);
refreshAlbumAndArtists();
if (isAlbumVisible) {
hideFragment("viewAlbum");
} else if (isArtistVisible) {
hideFragment("viewArtist");
}
LocalMusicViewPagerFragment flmFrag = (LocalMusicViewPagerFragment) fragMan.findFragmentByTag("local");
LocalMusicFragment lFrag = null;
if (flmFrag != null) {
lFrag = (LocalMusicFragment) flmFrag.getFragmentByPosition(0);
}
if (lFrag != null) {
lFrag.updateAdapter();
}
ArtistFragment artFrag = null;
if (flmFrag != null) {
artFrag = (ArtistFragment) flmFrag.getFragmentByPosition(2);
}
if (artFrag != null) {
artFrag.updateAdapter();
}
AlbumFragment albFrag = null;
if (flmFrag != null) {
albFrag = (AlbumFragment) flmFrag.getFragmentByPosition(1);
}
if (albFrag != null) {
albFrag.updateAdapter();
}
}
Aggregations