use of com.sdsmdg.harjot.MusicDNA.fragments.LocalMusicFragments.AlbumFragment in project MusicDNA by harjot-oberai.
the class HomeActivity method updateAlbumList.
private void updateAlbumList(String query) {
finalAlbums.clear();
for (int i = 0; i < albums.size(); i++) {
Album album = albums.get(i);
String tmp1 = album.getName().toLowerCase();
String tmp2 = query.toLowerCase();
if (tmp1.contains(tmp2)) {
finalAlbums.add(album);
}
}
LocalMusicViewPagerFragment flmFrag = (LocalMusicViewPagerFragment) fragMan.findFragmentByTag("local");
if (flmFrag != null) {
AlbumFragment aFrag = (AlbumFragment) flmFrag.getFragmentByPosition(1);
if (aFrag != null) {
aFrag.updateAdapter();
}
}
}
use of com.sdsmdg.harjot.MusicDNA.fragments.LocalMusicFragments.AlbumFragment 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