mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 01:53:31 +00:00
Removed NestedScrollView where possible to speed-up scrolling performance
This commit is contained in:
parent
8d637c9452
commit
68bec3d6ec
11 changed files with 125 additions and 173 deletions
|
|
@ -19,7 +19,8 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class ArtistCatalogueAdapter extends RecyclerView.Adapter<ArtistCatalogueAdapter.ViewHolder> {
|
||||
public class ArtistCatalogueAdapter extends
|
||||
RecyclerView.Adapter<ArtistCatalogueAdapter.ViewHolder> {
|
||||
private static final String TAG = "ArtistCatalogueAdapter";
|
||||
|
||||
private List<Artist> artists;
|
||||
|
|
|
|||
|
|
@ -179,9 +179,7 @@ public class MainActivity extends BaseActivity {
|
|||
break;
|
||||
case BottomSheetBehavior.STATE_HIDDEN:
|
||||
MusicPlayerRemote.quitPlaying();
|
||||
mainViewModel.deleteQueue();
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -58,7 +58,6 @@ public class AlbumCatalogueFragment extends Fragment {
|
|||
bind.albumCatalogueRecyclerView.setAdapter(albumAdapter);
|
||||
albumCatalogueViewModel.getAlbumList().observe(requireActivity(), albums -> {
|
||||
bind.loadingProgressBar.setVisibility(View.GONE);
|
||||
bind.albumCatalogueContainer.setVisibility(View.VISIBLE);
|
||||
albumAdapter.setItems(albums);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.cappielloantonio.play.ui.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
|
@ -56,10 +57,9 @@ public class ArtistCatalogueFragment extends Fragment {
|
|||
|
||||
artistAdapter = new ArtistCatalogueAdapter(requireContext());
|
||||
bind.artistCatalogueRecyclerView.setAdapter(artistAdapter);
|
||||
artistCatalogueViewModel.getArtistList().observe(requireActivity(), artists -> {
|
||||
artistCatalogueViewModel.getArtistList().observe(requireActivity(), artistList -> {
|
||||
bind.loadingProgressBar.setVisibility(View.GONE);
|
||||
bind.artistCatalogueContainer.setVisibility(View.VISIBLE);
|
||||
artistAdapter.setItems(artists);
|
||||
artistAdapter.setItems(artistList);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -138,14 +138,14 @@ public class SearchFragment extends Fragment {
|
|||
}
|
||||
|
||||
public void search(String query) {
|
||||
if (!query.trim().equals("") && query.trim().length() > 1) {
|
||||
if (!query.trim().equals("") && query.trim().length() > 2) {
|
||||
searchViewModel.insertNewSearch(query);
|
||||
bind.persistentSearchView.collapse();
|
||||
|
||||
bind.persistentSearchView.setInputQuery(query);
|
||||
performSearch(query.trim());
|
||||
} else {
|
||||
Toast.makeText(requireContext(), "Enter at least two characters", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(requireContext(), "Enter at least three characters", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue