use of com.sdsmdg.harjot.MusicDNA.fragments.LocalMusicFragments.LocalMusicViewPagerFragment in project MusicDNA by harjot-oberai.
the class HomeActivity method updateLocalList.
private void updateLocalList(String query) {
LocalMusicViewPagerFragment flmFrag = (LocalMusicViewPagerFragment) fragMan.findFragmentByTag("local");
LocalMusicFragment lFrag = null;
if (flmFrag != null)
lFrag = (LocalMusicFragment) flmFrag.getFragmentByPosition(0);
if (lFrag != null)
lFrag.hideShuffleFab();
if (!isLocalVisible)
localRecyclerContainer.setVisibility(View.VISIBLE);
finalLocalSearchResultList.clear();
for (int i = 0; i < localTrackList.size(); i++) {
LocalTrack lt = localTrackList.get(i);
String tmp1 = lt.getTitle().toLowerCase();
String tmp2 = query.toLowerCase();
if (tmp1.contains(tmp2)) {
finalLocalSearchResultList.add(lt);
}
}
if (!isLocalVisible && localsongsRecyclerView != null) {
if (finalLocalSearchResultList.size() == 0) {
localsongsRecyclerView.setVisibility(GONE);
localNothingText.setVisibility(View.VISIBLE);
} else {
localsongsRecyclerView.setVisibility(View.VISIBLE);
localNothingText.setVisibility(View.INVISIBLE);
}
(localsongsRecyclerView.getAdapter()).notifyDataSetChanged();
}
if (lFrag != null)
lFrag.updateAdapter();
if (query.equals("")) {
localRecyclerContainer.setVisibility(GONE);
}
if (query.equals("") && isLocalVisible) {
if (lFrag != null)
lFrag.showShuffleFab();
}
}
Aggregations