Search in sources :

Example 6 with LocalMusicViewPagerFragment

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();
    }
}
Also used : LocalMusicViewPagerFragment(com.sdsmdg.harjot.MusicDNA.fragments.LocalMusicFragments.LocalMusicViewPagerFragment) LocalMusicFragment(com.sdsmdg.harjot.MusicDNA.fragments.LocalMusicFragments.LocalMusicFragment) LocalTrack(com.sdsmdg.harjot.MusicDNA.models.LocalTrack) TextPaint(android.text.TextPaint)

Aggregations

LocalMusicViewPagerFragment (com.sdsmdg.harjot.MusicDNA.fragments.LocalMusicFragments.LocalMusicViewPagerFragment)6 TextPaint (android.text.TextPaint)3 LocalMusicFragment (com.sdsmdg.harjot.MusicDNA.fragments.LocalMusicFragments.LocalMusicFragment)3 ViewAlbumFragment (com.sdsmdg.harjot.MusicDNA.fragments.ViewAlbumFragment.ViewAlbumFragment)3 ViewArtistFragment (com.sdsmdg.harjot.MusicDNA.fragments.ViewArtistFragment.ViewArtistFragment)3 EqualizerFragment (com.sdsmdg.harjot.MusicDNA.fragments.EqualizerFragment.EqualizerFragment)2 AlbumFragment (com.sdsmdg.harjot.MusicDNA.fragments.LocalMusicFragments.AlbumFragment)2 ArtistFragment (com.sdsmdg.harjot.MusicDNA.fragments.LocalMusicFragments.ArtistFragment)2 QueueFragment (com.sdsmdg.harjot.MusicDNA.fragments.QueueFragment.QueueFragment)2 ViewSavedDNA (com.sdsmdg.harjot.MusicDNA.fragments.ViewSavedDNAsFragment.ViewSavedDNA)2 Intent (android.content.Intent)1 DrawerLayout (android.support.v4.widget.DrawerLayout)1 InputMethodManager (android.view.inputmethod.InputMethodManager)1 AboutFragment (com.sdsmdg.harjot.MusicDNA.fragments.AboutFragment.AboutFragment)1 FolderFragment (com.sdsmdg.harjot.MusicDNA.fragments.AllFoldersFragment.FolderFragment)1 AllPlaylistsFragment (com.sdsmdg.harjot.MusicDNA.fragments.AllPlaylistsFragment.AllPlaylistsFragment)1 EditLocalSongFragment (com.sdsmdg.harjot.MusicDNA.fragments.EditSongFragment.EditLocalSongFragment)1 FavouritesFragment (com.sdsmdg.harjot.MusicDNA.fragments.FavouritesFragment.FavouritesFragment)1 FolderContentFragment (com.sdsmdg.harjot.MusicDNA.fragments.FolderContentFragment.FolderContentFragment)1 NewPlaylistFragment (com.sdsmdg.harjot.MusicDNA.fragments.NewPlaylistFragment.NewPlaylistFragment)1