Add favorite view

This commit is contained in:
Antonio Cappiello 2020-11-30 20:54:05 +01:00
parent ae23d268cd
commit 01bdbf49b2
52 changed files with 1064 additions and 317 deletions

View file

@ -6,7 +6,6 @@
<uses-permission <uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:name="android.permission.WRITE_EXTERNAL_STORAGE"
tools:ignore="ScopedStorage" /> tools:ignore="ScopedStorage" />
<uses-permission android:name="android.permission.INTERNET" />
<application <application
android:allowBackup="true" android:allowBackup="true"

View file

@ -13,6 +13,7 @@ import com.cappielloantonio.play.R;
import com.cappielloantonio.play.glide.CustomGlideRequest; import com.cappielloantonio.play.glide.CustomGlideRequest;
import com.cappielloantonio.play.model.Album; import com.cappielloantonio.play.model.Album;
import java.util.ArrayList;
import java.util.List; import java.util.List;
public class AlbumAdapter extends RecyclerView.Adapter<AlbumAdapter.ViewHolder> { public class AlbumAdapter extends RecyclerView.Adapter<AlbumAdapter.ViewHolder> {
@ -26,6 +27,7 @@ public class AlbumAdapter extends RecyclerView.Adapter<AlbumAdapter.ViewHolder>
public AlbumAdapter(Context context) { public AlbumAdapter(Context context) {
this.context = context; this.context = context;
this.inflater = LayoutInflater.from(context); this.inflater = LayoutInflater.from(context);
this.albums = new ArrayList<>();
} }
@Override @Override

View file

@ -13,6 +13,7 @@ import com.cappielloantonio.play.R;
import com.cappielloantonio.play.glide.CustomGlideRequest; import com.cappielloantonio.play.glide.CustomGlideRequest;
import com.cappielloantonio.play.model.Album; import com.cappielloantonio.play.model.Album;
import java.util.ArrayList;
import java.util.List; import java.util.List;
public class AlbumArtistPageAdapter extends RecyclerView.Adapter<AlbumArtistPageAdapter.ViewHolder> { public class AlbumArtistPageAdapter extends RecyclerView.Adapter<AlbumArtistPageAdapter.ViewHolder> {
@ -26,6 +27,7 @@ public class AlbumArtistPageAdapter extends RecyclerView.Adapter<AlbumArtistPage
public AlbumArtistPageAdapter(Context context) { public AlbumArtistPageAdapter(Context context) {
this.context = context; this.context = context;
this.inflater = LayoutInflater.from(context); this.inflater = LayoutInflater.from(context);
this.albums = new ArrayList<>();
} }
@Override @Override

View file

@ -13,6 +13,7 @@ import com.cappielloantonio.play.R;
import com.cappielloantonio.play.glide.CustomGlideRequest; import com.cappielloantonio.play.glide.CustomGlideRequest;
import com.cappielloantonio.play.model.Album; import com.cappielloantonio.play.model.Album;
import java.util.ArrayList;
import java.util.List; import java.util.List;
public class AlbumCatalogueAdapter extends RecyclerView.Adapter<AlbumCatalogueAdapter.ViewHolder> { public class AlbumCatalogueAdapter extends RecyclerView.Adapter<AlbumCatalogueAdapter.ViewHolder> {
@ -26,6 +27,7 @@ public class AlbumCatalogueAdapter extends RecyclerView.Adapter<AlbumCatalogueAd
public AlbumCatalogueAdapter(Context context) { public AlbumCatalogueAdapter(Context context) {
this.context = context; this.context = context;
this.inflater = LayoutInflater.from(context); this.inflater = LayoutInflater.from(context);
this.albums = new ArrayList<>();
} }
@Override @Override

View file

@ -13,6 +13,7 @@ import com.cappielloantonio.play.R;
import com.cappielloantonio.play.glide.CustomGlideRequest; import com.cappielloantonio.play.glide.CustomGlideRequest;
import com.cappielloantonio.play.model.Artist; import com.cappielloantonio.play.model.Artist;
import java.util.ArrayList;
import java.util.List; import java.util.List;
public class ArtistAdapter extends RecyclerView.Adapter<ArtistAdapter.ViewHolder> { public class ArtistAdapter extends RecyclerView.Adapter<ArtistAdapter.ViewHolder> {
@ -26,6 +27,7 @@ public class ArtistAdapter extends RecyclerView.Adapter<ArtistAdapter.ViewHolder
public ArtistAdapter(Context context) { public ArtistAdapter(Context context) {
this.context = context; this.context = context;
this.inflater = LayoutInflater.from(context); this.inflater = LayoutInflater.from(context);
this.artists = new ArrayList<>();
} }
@Override @Override

View file

@ -13,6 +13,7 @@ import com.cappielloantonio.play.R;
import com.cappielloantonio.play.glide.CustomGlideRequest; import com.cappielloantonio.play.glide.CustomGlideRequest;
import com.cappielloantonio.play.model.Artist; import com.cappielloantonio.play.model.Artist;
import java.util.ArrayList;
import java.util.List; import java.util.List;
public class ArtistCatalogueAdapter extends RecyclerView.Adapter<ArtistCatalogueAdapter.ViewHolder> { public class ArtistCatalogueAdapter extends RecyclerView.Adapter<ArtistCatalogueAdapter.ViewHolder> {
@ -26,6 +27,7 @@ public class ArtistCatalogueAdapter extends RecyclerView.Adapter<ArtistCatalogue
public ArtistCatalogueAdapter(Context context) { public ArtistCatalogueAdapter(Context context) {
this.context = context; this.context = context;
this.inflater = LayoutInflater.from(context); this.inflater = LayoutInflater.from(context);
this.artists = new ArrayList<>();
} }
@Override @Override

View file

@ -72,7 +72,7 @@ public class DiscoverSongAdapter extends RecyclerView.Adapter<DiscoverSongAdapte
@Override @Override
public void onClick(View view) { public void onClick(View view) {
SongRepository songRepository = new SongRepository(App.getInstance()); SongRepository songRepository = new SongRepository(App.getInstance());
songRepository.update(songs.get(getAdapterPosition())); songRepository.increasePlayCount(songs.get(getAdapterPosition()));
} }
} }

View file

@ -11,6 +11,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.cappielloantonio.play.R; import com.cappielloantonio.play.R;
import com.cappielloantonio.play.model.Genre; import com.cappielloantonio.play.model.Genre;
import java.util.ArrayList;
import java.util.List; import java.util.List;
public class GenreAdapter extends RecyclerView.Adapter<GenreAdapter.ViewHolder> { public class GenreAdapter extends RecyclerView.Adapter<GenreAdapter.ViewHolder> {
@ -24,6 +25,7 @@ public class GenreAdapter extends RecyclerView.Adapter<GenreAdapter.ViewHolder>
public GenreAdapter(Context context) { public GenreAdapter(Context context) {
this.context = context; this.context = context;
this.mInflater = LayoutInflater.from(context); this.mInflater = LayoutInflater.from(context);
this.genres = new ArrayList<>();
} }
@Override @Override

View file

@ -11,6 +11,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.cappielloantonio.play.R; import com.cappielloantonio.play.R;
import com.cappielloantonio.play.model.Genre; import com.cappielloantonio.play.model.Genre;
import java.util.ArrayList;
import java.util.List; import java.util.List;
public class GenreCatalogueAdapter extends RecyclerView.Adapter<GenreCatalogueAdapter.ViewHolder> { public class GenreCatalogueAdapter extends RecyclerView.Adapter<GenreCatalogueAdapter.ViewHolder> {
@ -24,6 +25,7 @@ public class GenreCatalogueAdapter extends RecyclerView.Adapter<GenreCatalogueAd
public GenreCatalogueAdapter(Context context) { public GenreCatalogueAdapter(Context context) {
this.context = context; this.context = context;
this.mInflater = LayoutInflater.from(context); this.mInflater = LayoutInflater.from(context);
this.genres = new ArrayList<>();
} }
// inflates the row layout from xml when needed // inflates the row layout from xml when needed

View file

@ -11,6 +11,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.cappielloantonio.play.R; import com.cappielloantonio.play.R;
import com.cappielloantonio.play.model.Playlist; import com.cappielloantonio.play.model.Playlist;
import java.util.ArrayList;
import java.util.List; import java.util.List;
public class PlaylistAdapter extends RecyclerView.Adapter<PlaylistAdapter.ViewHolder> { public class PlaylistAdapter extends RecyclerView.Adapter<PlaylistAdapter.ViewHolder> {
@ -24,6 +25,7 @@ public class PlaylistAdapter extends RecyclerView.Adapter<PlaylistAdapter.ViewHo
public PlaylistAdapter(Context context) { public PlaylistAdapter(Context context) {
this.context = context; this.context = context;
this.mInflater = LayoutInflater.from(context); this.mInflater = LayoutInflater.from(context);
this.playlists = new ArrayList<>();
} }
@Override @Override

View file

@ -15,6 +15,7 @@ import com.cappielloantonio.play.glide.CustomGlideRequest;
import com.cappielloantonio.play.model.Song; import com.cappielloantonio.play.model.Song;
import com.cappielloantonio.play.repository.SongRepository; import com.cappielloantonio.play.repository.SongRepository;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@ -30,6 +31,7 @@ public class RecentMusicAdapter extends RecyclerView.Adapter<RecentMusicAdapter.
public RecentMusicAdapter(Context context) { public RecentMusicAdapter(Context context) {
this.context = context; this.context = context;
this.mInflater = LayoutInflater.from(context); this.mInflater = LayoutInflater.from(context);
this.songs = new ArrayList<>();
} }
@Override @Override
@ -74,7 +76,7 @@ public class RecentMusicAdapter extends RecyclerView.Adapter<RecentMusicAdapter.
@Override @Override
public void onClick(View view) { public void onClick(View view) {
SongRepository songRepository = new SongRepository(App.getInstance()); SongRepository songRepository = new SongRepository(App.getInstance());
songRepository.update(songs.get(getAdapterPosition())); songRepository.increasePlayCount(songs.get(getAdapterPosition()));
} }
} }

View file

@ -11,6 +11,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.cappielloantonio.play.R; import com.cappielloantonio.play.R;
import com.cappielloantonio.play.model.RecentSearch; import com.cappielloantonio.play.model.RecentSearch;
import java.util.ArrayList;
import java.util.List; import java.util.List;
public class RecentSearchAdapter extends RecyclerView.Adapter<RecentSearchAdapter.ViewHolder> { public class RecentSearchAdapter extends RecyclerView.Adapter<RecentSearchAdapter.ViewHolder> {
@ -24,6 +25,7 @@ public class RecentSearchAdapter extends RecyclerView.Adapter<RecentSearchAdapte
public RecentSearchAdapter(Context context) { public RecentSearchAdapter(Context context) {
this.context = context; this.context = context;
this.mInflater = LayoutInflater.from(context); this.mInflater = LayoutInflater.from(context);
this.searches = new ArrayList<>();
} }
@Override @Override

View file

@ -7,6 +7,7 @@ import android.view.ViewGroup;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import androidx.fragment.app.FragmentManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.cappielloantonio.play.App; import com.cappielloantonio.play.App;
@ -14,8 +15,10 @@ import com.cappielloantonio.play.R;
import com.cappielloantonio.play.glide.CustomGlideRequest; import com.cappielloantonio.play.glide.CustomGlideRequest;
import com.cappielloantonio.play.model.Song; import com.cappielloantonio.play.model.Song;
import com.cappielloantonio.play.repository.SongRepository; import com.cappielloantonio.play.repository.SongRepository;
import com.cappielloantonio.play.ui.fragment.bottomsheetdialog.SongBottomSheetDialog;
import com.cappielloantonio.play.util.Util; import com.cappielloantonio.play.util.Util;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@ -27,10 +30,13 @@ public class SongResultSearchAdapter extends RecyclerView.Adapter<SongResultSear
private List<Song> songs; private List<Song> songs;
private LayoutInflater mInflater; private LayoutInflater mInflater;
private Context context; private Context context;
private FragmentManager fragmentManager;
public SongResultSearchAdapter(Context context) { public SongResultSearchAdapter(Context context, FragmentManager fragmentManager) {
this.context = context; this.context = context;
this.fragmentManager = fragmentManager;
this.mInflater = LayoutInflater.from(context); this.mInflater = LayoutInflater.from(context);
this.songs = new ArrayList<>();
} }
@Override @Override
@ -58,7 +64,7 @@ public class SongResultSearchAdapter extends RecyclerView.Adapter<SongResultSear
return songs.size(); return songs.size();
} }
public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener, View.OnLongClickListener {
TextView songTitle; TextView songTitle;
TextView songArtist; TextView songArtist;
TextView songDuration; TextView songDuration;
@ -73,12 +79,20 @@ public class SongResultSearchAdapter extends RecyclerView.Adapter<SongResultSear
cover = itemView.findViewById(R.id.song_cover_image_view); cover = itemView.findViewById(R.id.song_cover_image_view);
itemView.setOnClickListener(this); itemView.setOnClickListener(this);
itemView.setOnLongClickListener(this);
} }
@Override @Override
public void onClick(View view) { public void onClick(View view) {
SongRepository songRepository = new SongRepository(App.getInstance()); SongRepository songRepository = new SongRepository(App.getInstance());
songRepository.update(songs.get(getAdapterPosition())); songRepository.increasePlayCount(songs.get(getAdapterPosition()));
}
@Override
public boolean onLongClick(View v) {
SongBottomSheetDialog songBottomSheetDialog = new SongBottomSheetDialog(songs.get(getAdapterPosition()));
songBottomSheetDialog.show(fragmentManager, null);
return true;
} }
} }
@ -90,4 +104,5 @@ public class SongResultSearchAdapter extends RecyclerView.Adapter<SongResultSear
public Song getItem(int id) { public Song getItem(int id) {
return songs.get(id); return songs.get(id);
} }
} }

View file

@ -0,0 +1,30 @@
package com.cappielloantonio.play.broadcast.receiver;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.view.View;
import com.cappielloantonio.play.ui.activities.MainActivity;
public class ConnectivityStatusBroadcastReceiver extends BroadcastReceiver {
private MainActivity activity;
public ConnectivityStatusBroadcastReceiver(MainActivity activity) {
this.activity = activity;
}
@Override
public void onReceive(Context context, Intent intent) {
if (ConnectivityManager.CONNECTIVITY_ACTION.equals(intent.getAction())) {
boolean noConnectivity = intent.getBooleanExtra(ConnectivityManager.EXTRA_NO_CONNECTIVITY, false);
if (noConnectivity) {
activity.activityMainBinding.offlineModeLinearLayout.setVisibility(View.VISIBLE);
} else {
activity.activityMainBinding.offlineModeLinearLayout.setVisibility(View.GONE);
}
}
}
}

View file

@ -18,6 +18,9 @@ public interface SongDao {
@Query("SELECT * FROM song") @Query("SELECT * FROM song")
LiveData<List<Song>> getAll(); LiveData<List<Song>> getAll();
@Query("SELECT * FROM song WHERE id = :id")
LiveData<Song> getOne(String id);
@Query("SELECT * FROM song") @Query("SELECT * FROM song")
List<Song> getAllList(); List<Song> getAllList();
@ -33,7 +36,7 @@ public interface SongDao {
@Query("SELECT * FROM song WHERE play_count != 0 ORDER BY play_count DESC LIMIT :number") @Query("SELECT * FROM song WHERE play_count != 0 ORDER BY play_count DESC LIMIT :number")
LiveData<List<Song>> getMostPlayedSample(int number); LiveData<List<Song>> getMostPlayedSample(int number);
@Query("SELECT * FROM song WHERE play_count != 0 AND artistId = :artistID ORDER BY play_count DESC LIMIT :number") @Query("SELECT * FROM song WHERE artistId = :artistID ORDER BY play_count DESC LIMIT :number")
LiveData<List<Song>> getArtistTopSongsSample(String artistID, int number); LiveData<List<Song>> getArtistTopSongsSample(String artistID, int number);
@Query("SELECT * FROM song WHERE artistId = :artistID ORDER BY play_count DESC") @Query("SELECT * FROM song WHERE artistId = :artistID ORDER BY play_count DESC")
@ -48,6 +51,12 @@ public interface SongDao {
@Query("SELECT * FROM song INNER Join song_genre_cross ON song.id = song_genre_cross.song_id AND song_genre_cross.genre_id IN (:filters) GROUP BY song.id") @Query("SELECT * FROM song INNER Join song_genre_cross ON song.id = song_genre_cross.song_id AND song_genre_cross.genre_id IN (:filters) GROUP BY song.id")
LiveData<List<Song>> getFilteredSong(ArrayList<String> filters); LiveData<List<Song>> getFilteredSong(ArrayList<String> filters);
@Query("SELECT * FROM song WHERE favorite = 1 ORDER BY play_count DESC LIMIT :number")
LiveData<List<Song>> getFavoriteSongSample(int number);
@Query("SELECT * FROM song WHERE favorite = 1 ORDER BY play_count DESC")
LiveData<List<Song>> getFavoriteSong();
@Query("SELECT EXISTS(SELECT * FROM song WHERE id = :id)") @Query("SELECT EXISTS(SELECT * FROM song WHERE id = :id)")
boolean exist(String id); boolean exist(String id);

View file

@ -40,6 +40,9 @@ public class Song implements Parcelable {
@Ignore @Ignore
public static final String BY_YEAR = "BY_YEAR"; public static final String BY_YEAR = "BY_YEAR";
@Ignore
public static final String IS_FAVORITE = "IS_FAVORITE";
@NonNull @NonNull
@PrimaryKey @PrimaryKey
@ColumnInfo(name = "id") @ColumnInfo(name = "id")

View file

@ -17,6 +17,7 @@ public class SongRepository {
private SongDao songDao; private SongDao songDao;
private SongGenreCrossDao songGenreCrossDao; private SongGenreCrossDao songGenreCrossDao;
private LiveData<List<Song>> searchListLiveSongs; private LiveData<List<Song>> searchListLiveSongs;
private LiveData<Song> liveDataSong;
private LiveData<List<Song>> listLiveSampleRecentlyAddedSongs; private LiveData<List<Song>> listLiveSampleRecentlyAddedSongs;
private LiveData<List<Song>> listLiveSampleRecentlyPlayedSongs; private LiveData<List<Song>> listLiveSampleRecentlyPlayedSongs;
private LiveData<List<Song>> listLiveSampleMostPlayedSongs; private LiveData<List<Song>> listLiveSampleMostPlayedSongs;
@ -25,6 +26,8 @@ public class SongRepository {
private LiveData<List<Song>> listLiveSongByGenre; private LiveData<List<Song>> listLiveSongByGenre;
private LiveData<List<Song>> listLiveFilteredSongs; private LiveData<List<Song>> listLiveFilteredSongs;
private LiveData<List<Song>> listLiveSongByYear; private LiveData<List<Song>> listLiveSongByYear;
private LiveData<List<Song>> listLiveSampleFavoritesSong;
private LiveData<List<Song>> listLiveFavoritesSong;
public SongRepository(Application application) { public SongRepository(Application application) {
@ -38,6 +41,11 @@ public class SongRepository {
return searchListLiveSongs; return searchListLiveSongs;
} }
public LiveData<Song> getLiveDataSong(String id) {
liveDataSong = songDao.getOne(id);
return liveDataSong;
}
public LiveData<List<Song>> getListLiveRecentlyAddedSampleSong(int number) { public LiveData<List<Song>> getListLiveRecentlyAddedSampleSong(int number) {
listLiveSampleRecentlyAddedSongs = songDao.getRecentlyAddedSample(number); listLiveSampleRecentlyAddedSongs = songDao.getRecentlyAddedSample(number);
return listLiveSampleRecentlyAddedSongs; return listLiveSampleRecentlyAddedSongs;
@ -138,6 +146,16 @@ public class SongRepository {
return listLiveSongByYear; return listLiveSongByYear;
} }
public LiveData<List<Song>> getListLiveFavoritesSampleSong(int number) {
listLiveSampleFavoritesSong = songDao.getFavoriteSongSample(number);
return listLiveSampleFavoritesSong;
}
public LiveData<List<Song>> getListLiveFavoritesSong() {
listLiveFavoritesSong = songDao.getFavoriteSong();
return listLiveFavoritesSong;
}
public boolean exist(Song song) { public boolean exist(Song song) {
boolean exist = false; boolean exist = false;
@ -173,7 +191,7 @@ public class SongRepository {
thread.start(); thread.start();
} }
public void update(Song song) { public void increasePlayCount(Song song) {
song.nowPlaying(); song.nowPlaying();
UpdateThreadSafe update = new UpdateThreadSafe(songDao, song); UpdateThreadSafe update = new UpdateThreadSafe(songDao, song);
@ -181,6 +199,12 @@ public class SongRepository {
thread.start(); thread.start();
} }
public void setFavoriteStatus(Song song) {
UpdateThreadSafe update = new UpdateThreadSafe(songDao, song);
Thread thread = new Thread(update);
thread.start();
}
public void getAll() { public void getAll() {
GetCatalogueThreadSafe catalogue = new GetCatalogueThreadSafe(songDao); GetCatalogueThreadSafe catalogue = new GetCatalogueThreadSafe(songDao);
Thread thread = new Thread(catalogue); Thread thread = new Thread(catalogue);

View file

@ -1,5 +1,7 @@
package com.cappielloantonio.play.ui.activities; package com.cappielloantonio.play.ui.activities;
import android.content.IntentFilter;
import android.net.ConnectivityManager;
import android.os.Bundle; import android.os.Bundle;
import android.view.View; import android.view.View;
@ -10,6 +12,7 @@ import androidx.navigation.ui.NavigationUI;
import com.cappielloantonio.play.App; import com.cappielloantonio.play.App;
import com.cappielloantonio.play.R; import com.cappielloantonio.play.R;
import com.cappielloantonio.play.broadcast.receiver.ConnectivityStatusBroadcastReceiver;
import com.cappielloantonio.play.databinding.ActivityMainBinding; import com.cappielloantonio.play.databinding.ActivityMainBinding;
import com.cappielloantonio.play.ui.activities.base.BaseActivity; import com.cappielloantonio.play.ui.activities.base.BaseActivity;
import com.cappielloantonio.play.util.PreferenceUtil; import com.cappielloantonio.play.util.PreferenceUtil;
@ -26,23 +29,33 @@ import java.util.Objects;
public class MainActivity extends BaseActivity { public class MainActivity extends BaseActivity {
private static final String TAG = "MainActivity"; private static final String TAG = "MainActivity";
private ActivityMainBinding activityMainBinding; public ActivityMainBinding activityMainBinding;
private FragmentManager fragmentManager; private FragmentManager fragmentManager;
private NavHostFragment navHostFragment; private NavHostFragment navHostFragment;
private BottomNavigationView bottomNavigationView; private BottomNavigationView bottomNavigationView;
public NavController navController; public NavController navController;
ConnectivityStatusBroadcastReceiver connectivityStatusBroadcastReceiver;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
activityMainBinding = ActivityMainBinding.inflate(getLayoutInflater()); activityMainBinding = ActivityMainBinding.inflate(getLayoutInflater());
View view = activityMainBinding.getRoot(); View view = activityMainBinding.getRoot();
setContentView(view); setContentView(view);
connectivityStatusBroadcastReceiver = new ConnectivityStatusBroadcastReceiver(this);
connectivityStatusReceiverManager(true);
init(); init();
} }
@Override
protected void onDestroy() {
super.onDestroy();
connectivityStatusReceiverManager(false);
}
public void init() { public void init() {
fragmentManager = getSupportFragmentManager(); fragmentManager = getSupportFragmentManager();
bottomNavigationView = findViewById(R.id.bottom_navigation); bottomNavigationView = findViewById(R.id.bottom_navigation);
@ -76,7 +89,7 @@ public class MainActivity extends BaseActivity {
@Override @Override
public void onError(Exception exception) { public void onError(Exception exception) {
goToLogin(); goFromLogin();
} }
}); });
} }
@ -130,4 +143,14 @@ public class MainActivity extends BaseActivity {
goToSync(); goToSync();
} }
} }
private void connectivityStatusReceiverManager(boolean isActive) {
if(isActive) {
IntentFilter filter = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION);
registerReceiver(connectivityStatusBroadcastReceiver, filter);
}
else {
unregisterReceiver(connectivityStatusBroadcastReceiver);
}
}
} }

View file

@ -38,6 +38,12 @@ public class AlbumCatalogueFragment extends Fragment {
return view; return view;
} }
@Override
public void onStart() {
super.onStart();
activity.setBottomNavigationBarVisibility(false);
}
@Override @Override
public void onDestroyView() { public void onDestroyView() {
super.onDestroyView(); super.onDestroyView();

View file

@ -13,10 +13,9 @@ import com.cappielloantonio.play.adapter.SongResultSearchAdapter;
import com.cappielloantonio.play.databinding.FragmentAlbumPageBinding; import com.cappielloantonio.play.databinding.FragmentAlbumPageBinding;
import com.cappielloantonio.play.glide.CustomGlideRequest; import com.cappielloantonio.play.glide.CustomGlideRequest;
import com.cappielloantonio.play.ui.activities.MainActivity; import com.cappielloantonio.play.ui.activities.MainActivity;
import com.cappielloantonio.play.ui.fragment.bottomsheetdialog.AlbumBottomSheetDialog;
import com.cappielloantonio.play.viewmodel.AlbumPageViewModel; import com.cappielloantonio.play.viewmodel.AlbumPageViewModel;
import java.util.ArrayList;
public class AlbumPageFragment extends Fragment { public class AlbumPageFragment extends Fragment {
private FragmentAlbumPageBinding bind; private FragmentAlbumPageBinding bind;
@ -26,7 +25,7 @@ public class AlbumPageFragment extends Fragment {
private SongResultSearchAdapter songResultSearchAdapter; private SongResultSearchAdapter songResultSearchAdapter;
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
activity = (MainActivity) getActivity(); activity = (MainActivity) getActivity();
bind = FragmentAlbumPageBinding.inflate(inflater, container, false); bind = FragmentAlbumPageBinding.inflate(inflater, container, false);
@ -34,12 +33,19 @@ public class AlbumPageFragment extends Fragment {
albumPageViewModel = new ViewModelProvider(requireActivity()).get(AlbumPageViewModel.class); albumPageViewModel = new ViewModelProvider(requireActivity()).get(AlbumPageViewModel.class);
init(); init();
initBottomSheetDialog();
initBackCover(); initBackCover();
initSongsView(); initSongsView();
return view; return view;
} }
@Override
public void onStart() {
super.onStart();
activity.setBottomNavigationBarVisibility(false);
}
@Override @Override
public void onDestroyView() { public void onDestroyView() {
super.onDestroyView(); super.onDestroyView();
@ -59,11 +65,18 @@ public class AlbumPageFragment extends Fragment {
bind.albumTitleLabel.setText(albumPageViewModel.getAlbum().getTitle()); bind.albumTitleLabel.setText(albumPageViewModel.getAlbum().getTitle());
} }
private void initBottomSheetDialog() {
bind.albumSettingsImageButton.setOnClickListener(v -> {
AlbumBottomSheetDialog albumBottomSheetDialog = new AlbumBottomSheetDialog(albumPageViewModel.getAlbum());
albumBottomSheetDialog.show(this.getChildFragmentManager(), null);
});
}
private void initSongsView() { private void initSongsView() {
bind.songRecyclerView.setLayoutManager(new LinearLayoutManager(requireContext())); bind.songRecyclerView.setLayoutManager(new LinearLayoutManager(requireContext()));
bind.songRecyclerView.setHasFixedSize(true); bind.songRecyclerView.setHasFixedSize(true);
songResultSearchAdapter = new SongResultSearchAdapter(requireContext(), new ArrayList<>()); songResultSearchAdapter = new SongResultSearchAdapter(requireContext(), getChildFragmentManager());
bind.songRecyclerView.setAdapter(songResultSearchAdapter); bind.songRecyclerView.setAdapter(songResultSearchAdapter);
albumPageViewModel.getAlbumSongList().observe(requireActivity(), songs -> songResultSearchAdapter.setItems(songs)); albumPageViewModel.getAlbumSongList().observe(requireActivity(), songs -> songResultSearchAdapter.setItems(songs));
} }

View file

@ -38,6 +38,12 @@ public class ArtistCatalogueFragment extends Fragment {
return view; return view;
} }
@Override
public void onStart() {
super.onStart();
activity.setBottomNavigationBarVisibility(false);
}
@Override @Override
public void onDestroyView() { public void onDestroyView() {
super.onDestroyView(); super.onDestroyView();

View file

@ -18,8 +18,6 @@ import com.cappielloantonio.play.model.Song;
import com.cappielloantonio.play.ui.activities.MainActivity; import com.cappielloantonio.play.ui.activities.MainActivity;
import com.cappielloantonio.play.viewmodel.ArtistPageViewModel; import com.cappielloantonio.play.viewmodel.ArtistPageViewModel;
import java.util.ArrayList;
public class ArtistPageFragment extends Fragment { public class ArtistPageFragment extends Fragment {
private FragmentArtistPageBinding bind; private FragmentArtistPageBinding bind;
@ -45,6 +43,13 @@ public class ArtistPageFragment extends Fragment {
return view; return view;
} }
@Override
public void onStart() {
super.onStart();
activity.setBottomNavigationBarVisibility(false);
}
@Override @Override
public void onDestroyView() { public void onDestroyView() {
super.onDestroyView(); super.onDestroyView();
@ -74,7 +79,7 @@ public class ArtistPageFragment extends Fragment {
bind.mostStreamedSongRecyclerView.setLayoutManager(new LinearLayoutManager(requireContext())); bind.mostStreamedSongRecyclerView.setLayoutManager(new LinearLayoutManager(requireContext()));
bind.mostStreamedSongRecyclerView.setHasFixedSize(true); bind.mostStreamedSongRecyclerView.setHasFixedSize(true);
songResultSearchAdapter = new SongResultSearchAdapter(requireContext(), new ArrayList<>()); songResultSearchAdapter = new SongResultSearchAdapter(requireContext(), getChildFragmentManager());
bind.mostStreamedSongRecyclerView.setAdapter(songResultSearchAdapter); bind.mostStreamedSongRecyclerView.setAdapter(songResultSearchAdapter);
artistPageViewModel.getArtistTopSongList().observe(requireActivity(), songs -> songResultSearchAdapter.setItems(songs)); artistPageViewModel.getArtistTopSongList().observe(requireActivity(), songs -> songResultSearchAdapter.setItems(songs));
} }

View file

@ -4,7 +4,6 @@ import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.CompoundButton;
import android.widget.Toast; import android.widget.Toast;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
@ -41,6 +40,12 @@ public class FilterFragment extends Fragment {
return view; return view;
} }
@Override
public void onStart() {
super.onStart();
activity.setBottomNavigationBarVisibility(false);
}
@Override @Override
public void onDestroyView() { public void onDestroyView() {
super.onDestroyView(); super.onDestroyView();

View file

@ -40,6 +40,12 @@ public class GenreCatalogueFragment extends Fragment {
return view; return view;
} }
@Override
public void onStart() {
super.onStart();
activity.setBottomNavigationBarVisibility(false);
}
@Override @Override
public void onDestroyView() { public void onDestroyView() {
super.onDestroyView(); super.onDestroyView();

View file

@ -7,15 +7,18 @@ import android.view.ViewGroup;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.core.view.ViewCompat; import androidx.core.view.ViewCompat;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.viewpager2.widget.ViewPager2; import androidx.viewpager2.widget.ViewPager2;
import com.cappielloantonio.play.R; import com.cappielloantonio.play.R;
import com.cappielloantonio.play.adapter.DiscoverSongAdapter; import com.cappielloantonio.play.adapter.DiscoverSongAdapter;
import com.cappielloantonio.play.adapter.RecentMusicAdapter; import com.cappielloantonio.play.adapter.RecentMusicAdapter;
import com.cappielloantonio.play.adapter.SongResultSearchAdapter;
import com.cappielloantonio.play.adapter.YearAdapter; import com.cappielloantonio.play.adapter.YearAdapter;
import com.cappielloantonio.play.databinding.FragmentHomeBinding; import com.cappielloantonio.play.databinding.FragmentHomeBinding;
import com.cappielloantonio.play.model.Song; import com.cappielloantonio.play.model.Song;
@ -33,6 +36,7 @@ public class HomeFragment extends Fragment {
private DiscoverSongAdapter discoverSongAdapter; private DiscoverSongAdapter discoverSongAdapter;
private RecentMusicAdapter recentlyAddedMusicAdapter; private RecentMusicAdapter recentlyAddedMusicAdapter;
private YearAdapter yearAdapter; private YearAdapter yearAdapter;
private SongResultSearchAdapter favoriteSongAdapter;
private RecentMusicAdapter recentlyPlayedMusicAdapter; private RecentMusicAdapter recentlyPlayedMusicAdapter;
private RecentMusicAdapter mostPlayedMusicAdapter; private RecentMusicAdapter mostPlayedMusicAdapter;
@ -46,15 +50,23 @@ public class HomeFragment extends Fragment {
homeViewModel = new ViewModelProvider(requireActivity()).get(HomeViewModel.class); homeViewModel = new ViewModelProvider(requireActivity()).get(HomeViewModel.class);
init(); init();
initSwipeToRefresh();
initDiscoverSongSlideView(); initDiscoverSongSlideView();
initRecentAddedSongView(); initRecentAddedSongView();
initFavoritesSongView();
initYearSongView(); initYearSongView();
initRecentPlayedSongView();
initMostPlayedSongView(); initMostPlayedSongView();
initRecentPlayedSongView();
return view; return view;
} }
@Override
public void onStart() {
super.onStart();
activity.setBottomNavigationBarVisibility(true);
}
@Override @Override
public void onDestroyView() { public void onDestroyView() {
super.onDestroyView(); super.onDestroyView();
@ -62,12 +74,6 @@ public class HomeFragment extends Fragment {
} }
private void init() { private void init() {
bind.resyncButton.setOnClickListener(v -> {
PreferenceUtil.getInstance(requireContext()).setSync(false);
PreferenceUtil.getInstance(requireContext()).setSongGenreSync(false);
activity.goToSync();
});
bind.recentlyAddedTracksTextViewClickable.setOnClickListener(v -> { bind.recentlyAddedTracksTextViewClickable.setOnClickListener(v -> {
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putString(Song.RECENTLY_ADDED, Song.RECENTLY_ADDED); bundle.putString(Song.RECENTLY_ADDED, Song.RECENTLY_ADDED);
@ -85,6 +91,29 @@ public class HomeFragment extends Fragment {
bundle.putString(Song.MOST_PLAYED, Song.MOST_PLAYED); bundle.putString(Song.MOST_PLAYED, Song.MOST_PLAYED);
activity.navController.navigate(R.id.action_homeFragment_to_songListPageFragment, bundle); activity.navController.navigate(R.id.action_homeFragment_to_songListPageFragment, bundle);
}); });
bind.favoritesTracksTextViewClickable.setOnClickListener(v -> {
Bundle bundle = new Bundle();
bundle.putString(Song.IS_FAVORITE, Song.IS_FAVORITE);
activity.navController.navigate(R.id.action_homeFragment_to_songListPageFragment, bundle);
});
}
private void initSwipeToRefresh() {
bind.pullToRefreshLayout.setOnRefreshListener(() -> {
AlertDialog.Builder builder = new AlertDialog.Builder(requireContext());
builder.setMessage("Force reload your entire music library")
.setTitle("Force sync")
.setNegativeButton(R.string.ignore, null)
.setPositiveButton("Sync", (dialog, id) -> {
PreferenceUtil.getInstance(requireContext()).setSync(false);
PreferenceUtil.getInstance(requireContext()).setSongGenreSync(false);
activity.goToSync();
})
.show();
bind.pullToRefreshLayout.setRefreshing(false);
});
} }
private void initDiscoverSongSlideView() { private void initDiscoverSongSlideView() {
@ -119,13 +148,13 @@ public class HomeFragment extends Fragment {
bind.yearsRecyclerView.setAdapter(yearAdapter); bind.yearsRecyclerView.setAdapter(yearAdapter);
} }
private void initRecentPlayedSongView() { private void initFavoritesSongView() {
bind.recentlyPlayedTracksRecyclerView.setLayoutManager(new LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)); bind.favoritesTracksRecyclerView.setLayoutManager(new GridLayoutManager(requireContext(), 3, GridLayoutManager.HORIZONTAL, false));
bind.recentlyPlayedTracksRecyclerView.setHasFixedSize(true); bind.favoritesTracksRecyclerView.setHasFixedSize(true);
recentlyPlayedMusicAdapter = new RecentMusicAdapter(requireContext()); favoriteSongAdapter = new SongResultSearchAdapter(requireContext(), getChildFragmentManager());
bind.recentlyPlayedTracksRecyclerView.setAdapter(recentlyPlayedMusicAdapter); bind.favoritesTracksRecyclerView.setAdapter(favoriteSongAdapter);
homeViewModel.getRecentlyPlayedSongList().observe(requireActivity(), songs -> recentlyPlayedMusicAdapter.setItems(songs)); homeViewModel.getFavorites().observe(requireActivity(), songs -> favoriteSongAdapter.setItems(songs));
} }
private void initMostPlayedSongView() { private void initMostPlayedSongView() {
@ -137,6 +166,15 @@ public class HomeFragment extends Fragment {
homeViewModel.getMostPlayedSongList().observe(requireActivity(), songs -> mostPlayedMusicAdapter.setItems(songs)); homeViewModel.getMostPlayedSongList().observe(requireActivity(), songs -> mostPlayedMusicAdapter.setItems(songs));
} }
private void initRecentPlayedSongView() {
bind.recentlyPlayedTracksRecyclerView.setLayoutManager(new LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false));
bind.recentlyPlayedTracksRecyclerView.setHasFixedSize(true);
recentlyPlayedMusicAdapter = new RecentMusicAdapter(requireContext());
bind.recentlyPlayedTracksRecyclerView.setAdapter(recentlyPlayedMusicAdapter);
homeViewModel.getRecentlyPlayedSongList().observe(requireActivity(), songs -> recentlyPlayedMusicAdapter.setItems(songs));
}
private void settDiscoverSongSlideViewOffset(float pageOffset, float pageMargin) { private void settDiscoverSongSlideViewOffset(float pageOffset, float pageMargin) {
bind.discoverSongViewPager.setPageTransformer((page, position) -> { bind.discoverSongViewPager.setPageTransformer((page, position) -> {
float myOffset = position * -(2 * pageOffset + pageMargin); float myOffset = position * -(2 * pageOffset + pageMargin);

View file

@ -56,6 +56,12 @@ public class LibraryFragment extends Fragment {
return view; return view;
} }
@Override
public void onStart() {
super.onStart();
activity.setBottomNavigationBarVisibility(true);
}
@Override @Override
public void onDestroyView() { public void onDestroyView() {
super.onDestroyView(); super.onDestroyView();
@ -66,7 +72,6 @@ public class LibraryFragment extends Fragment {
bind.albumCatalogueTextViewClickable.setOnClickListener(v -> activity.navController.navigate(R.id.action_libraryFragment_to_albumCatalogueFragment)); bind.albumCatalogueTextViewClickable.setOnClickListener(v -> activity.navController.navigate(R.id.action_libraryFragment_to_albumCatalogueFragment));
bind.artistCatalogueTextViewClickable.setOnClickListener(v -> activity.navController.navigate(R.id.action_libraryFragment_to_artistCatalogueFragment)); bind.artistCatalogueTextViewClickable.setOnClickListener(v -> activity.navController.navigate(R.id.action_libraryFragment_to_artistCatalogueFragment));
bind.genreCatalogueTextViewClickable.setOnClickListener(v -> activity.navController.navigate(R.id.action_libraryFragment_to_genreCatalogueFragment)); bind.genreCatalogueTextViewClickable.setOnClickListener(v -> activity.navController.navigate(R.id.action_libraryFragment_to_genreCatalogueFragment));
bind.syncGenreButton.setOnClickListener(v -> syncSongsPerGenre());
} }
private void initAlbumView() { private void initAlbumView() {

View file

@ -58,6 +58,12 @@ public class SearchFragment extends Fragment {
return view; return view;
} }
@Override
public void onStart() {
super.onStart();
activity.setBottomNavigationBarVisibility(true);
}
@Override @Override
public void onDestroyView() { public void onDestroyView() {
super.onDestroyView(); super.onDestroyView();
@ -87,7 +93,7 @@ public class SearchFragment extends Fragment {
bind.searchResultTracksRecyclerView.setLayoutManager(new LinearLayoutManager(requireContext())); bind.searchResultTracksRecyclerView.setLayoutManager(new LinearLayoutManager(requireContext()));
bind.searchResultTracksRecyclerView.setHasFixedSize(true); bind.searchResultTracksRecyclerView.setHasFixedSize(true);
songResultSearchAdapter = new SongResultSearchAdapter(requireContext(), new ArrayList<>()); songResultSearchAdapter = new SongResultSearchAdapter(requireContext(), getChildFragmentManager());
bind.searchResultTracksRecyclerView.setAdapter(songResultSearchAdapter); bind.searchResultTracksRecyclerView.setAdapter(songResultSearchAdapter);
// Albums // Albums

View file

@ -15,8 +15,6 @@ import com.cappielloantonio.play.model.Song;
import com.cappielloantonio.play.ui.activities.MainActivity; import com.cappielloantonio.play.ui.activities.MainActivity;
import com.cappielloantonio.play.viewmodel.SongListPageViewModel; import com.cappielloantonio.play.viewmodel.SongListPageViewModel;
import java.util.ArrayList;
public class SongListPageFragment extends Fragment { public class SongListPageFragment extends Fragment {
private FragmentSongListPageBinding bind; private FragmentSongListPageBinding bind;
@ -39,6 +37,12 @@ public class SongListPageFragment extends Fragment {
return view; return view;
} }
@Override
public void onStart() {
super.onStart();
activity.setBottomNavigationBarVisibility(false);
}
@Override @Override
public void onDestroyView() { public void onDestroyView() {
super.onDestroyView(); super.onDestroyView();
@ -79,13 +83,17 @@ public class SongListPageFragment extends Fragment {
songListPageViewModel.year = getArguments().getInt("year_object"); songListPageViewModel.year = getArguments().getInt("year_object");
bind.pageTitleLabel.setText("Year " + songListPageViewModel.year); bind.pageTitleLabel.setText("Year " + songListPageViewModel.year);
} }
else if(getArguments().getString(Song.IS_FAVORITE) != null) {
songListPageViewModel.title = Song.IS_FAVORITE;
bind.pageTitleLabel.setText("Favourite song");
}
} }
private void initSongListView() { private void initSongListView() {
bind.songListRecyclerView.setLayoutManager(new LinearLayoutManager(requireContext())); bind.songListRecyclerView.setLayoutManager(new LinearLayoutManager(requireContext()));
bind.songListRecyclerView.setHasFixedSize(true); bind.songListRecyclerView.setHasFixedSize(true);
songResultSearchAdapter = new SongResultSearchAdapter(requireContext(), new ArrayList<>()); songResultSearchAdapter = new SongResultSearchAdapter(requireContext(), getChildFragmentManager());
bind.songListRecyclerView.setAdapter(songResultSearchAdapter); bind.songListRecyclerView.setAdapter(songResultSearchAdapter);
songListPageViewModel.getSongList().observe(requireActivity(), songs -> songResultSearchAdapter.setItems(songs)); songListPageViewModel.getSongList().observe(requireActivity(), songs -> songResultSearchAdapter.setItems(songs));
} }

View file

@ -99,7 +99,6 @@ public class SyncFragment extends Fragment {
} }
private void syncAlbums() { private void syncAlbums() {
Log.d(TAG, "syncAlbums");
SyncUtil.getAlbums(requireContext(), new MediaCallback() { SyncUtil.getAlbums(requireContext(), new MediaCallback() {
@Override @Override
public void onError(Exception exception) { public void onError(Exception exception) {
@ -117,7 +116,6 @@ public class SyncFragment extends Fragment {
} }
private void syncArtists() { private void syncArtists() {
Log.d(TAG, "syncArtists");
SyncUtil.getArtists(requireContext(), new MediaCallback() { SyncUtil.getArtists(requireContext(), new MediaCallback() {
@Override @Override
public void onError(Exception exception) { public void onError(Exception exception) {
@ -135,7 +133,6 @@ public class SyncFragment extends Fragment {
} }
private void syncGenres() { private void syncGenres() {
Log.d(TAG, "syncGenres");
SyncUtil.getGenres(requireContext(), new MediaCallback() { SyncUtil.getGenres(requireContext(), new MediaCallback() {
@Override @Override
public void onError(Exception exception) { public void onError(Exception exception) {
@ -156,7 +153,6 @@ public class SyncFragment extends Fragment {
} }
private void syncPlaylist() { private void syncPlaylist() {
Log.d(TAG, "syncPlaylist");
SyncUtil.getPlaylists(requireContext(), new MediaCallback() { SyncUtil.getPlaylists(requireContext(), new MediaCallback() {
@Override @Override
public void onError(Exception exception) { public void onError(Exception exception) {
@ -174,7 +170,6 @@ public class SyncFragment extends Fragment {
} }
private void syncSongs() { private void syncSongs() {
Log.d(TAG, "syncSongs");
SyncUtil.getSongs(requireContext(), syncViewModel.getCatalogue(), new MediaCallback() { SyncUtil.getSongs(requireContext(), syncViewModel.getCatalogue(), new MediaCallback() {
@Override @Override
public void onError(Exception exception) { public void onError(Exception exception) {
@ -193,8 +188,6 @@ public class SyncFragment extends Fragment {
} }
private void syncSongsPerGenre(List<Genre> genres) { private void syncSongsPerGenre(List<Genre> genres) {
Log.d(TAG, "syncSongsPerGenre");
for (Genre genre : genres) { for (Genre genre : genres) {
SyncUtil.getSongsPerGenre(requireContext(), new MediaCallback() { SyncUtil.getSongsPerGenre(requireContext(), new MediaCallback() {
@Override @Override
@ -210,29 +203,23 @@ public class SyncFragment extends Fragment {
}, genre.id); }, genre.id);
} }
Log.d(TAG, "syncSongsPerGenre: set progress");
animateProgressBar(true); animateProgressBar(true);
PreferenceUtil.getInstance(requireContext()).setSongGenreSync(true); PreferenceUtil.getInstance(requireContext()).setSongGenreSync(true);
} }
private void animateProgressBar(boolean step) { private void animateProgressBar(boolean step) {
Log.d(TAG, "animateProgressBar: PROGRESS " + step);
syncViewModel.setProgress(step); syncViewModel.setProgress(step);
bind.loadingProgressBar.setProgress(syncViewModel.getProgressBarInfo(), true); bind.loadingProgressBar.setProgress(syncViewModel.getProgressBarInfo(), true);
countProgress(); countProgress();
} }
private void countProgress() { private void countProgress() {
Log.d(TAG, "countProgress = " + syncViewModel.getProgress());
Log.d(TAG, "progressbar = " + syncViewModel.getProgressBarInfo());
if (syncViewModel.getProgress() == syncViewModel.getStep()) { if (syncViewModel.getProgress() == syncViewModel.getStep()) {
if (syncViewModel.getProgressBarInfo() >= 100) if (syncViewModel.getProgressBarInfo() < 100)
terminate();
else
Toast.makeText(requireContext(), "Sync error", Toast.LENGTH_SHORT).show(); Toast.makeText(requireContext(), "Sync error", Toast.LENGTH_SHORT).show();
terminate();
} }
} }

View file

@ -0,0 +1,54 @@
package com.cappielloantonio.play.ui.fragment.bottomsheetdialog;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.Toast;
import androidx.annotation.Nullable;
import com.cappielloantonio.play.R;
import com.cappielloantonio.play.model.Album;
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
public class AlbumBottomSheetDialog extends BottomSheetDialogFragment implements View.OnClickListener {
private static final String TAG = "AlbumBottomSheetDialog";
private Album album;
public AlbumBottomSheetDialog(Album album) {
this.album = album;
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.bottom_sheet_album_dialog, container, false);
init(view);
return view;
}
private void init(View view) {
Button button1 = view.findViewById(R.id.button1);
Button button2 = view.findViewById(R.id.button2);
button1.setOnClickListener(v -> {
Toast.makeText(requireContext(), album.getTitle(), Toast.LENGTH_SHORT).show();
dismiss();
});
button2.setOnClickListener(v -> {
Toast.makeText(requireContext(), album.getArtistName(), Toast.LENGTH_SHORT).show();
dismiss();
});
}
@Override
public void onClick(View v) {
dismiss();
}
}

View file

@ -0,0 +1,121 @@
package com.cappielloantonio.play.ui.fragment.bottomsheetdialog;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.ToggleButton;
import androidx.annotation.Nullable;
import androidx.lifecycle.ViewModelProvider;
import com.cappielloantonio.play.R;
import com.cappielloantonio.play.glide.CustomGlideRequest;
import com.cappielloantonio.play.model.Song;
import com.cappielloantonio.play.viewmodel.AlbumBottomSheetViewModel;
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
public class SongBottomSheetDialog extends BottomSheetDialogFragment implements View.OnClickListener {
private static final String TAG = "AlbumBottomSheetDialog";
private AlbumBottomSheetViewModel albumBottomSheetViewModel;
private Song song;
private ImageView coverSong;
private TextView titleSong;
private TextView artistSong;
private ToggleButton thumbToggle;
private TextView playRadio;
private TextView playNext;
private TextView addToQueue;
private TextView Download;
private TextView addToPlaylist;
private TextView goToArtist;
public SongBottomSheetDialog(Song song) {
this.song = song;
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.bottom_sheet_song_dialog, container, false);
albumBottomSheetViewModel = new ViewModelProvider(requireActivity()).get(AlbumBottomSheetViewModel.class);
albumBottomSheetViewModel.setSong(song);
init(view);
return view;
}
private void init(View view) {
coverSong = view.findViewById(R.id.song_cover_image_view);
CustomGlideRequest.Builder
.from(requireContext(), albumBottomSheetViewModel.getSong().getPrimary(), albumBottomSheetViewModel.getSong().getBlurHash(), CustomGlideRequest.PRIMARY, CustomGlideRequest.TOP_QUALITY)
.build()
.into(coverSong);
titleSong = view.findViewById(R.id.song_title_text_view);
titleSong.setText(albumBottomSheetViewModel.getSong().getTitle());
artistSong = view.findViewById(R.id.song_artist_text_view);
artistSong.setText(albumBottomSheetViewModel.getSong().getArtistName());
thumbToggle = view.findViewById(R.id.button_favorite);
thumbToggle.setChecked(albumBottomSheetViewModel.getSong().isFavorite());
thumbToggle.setOnClickListener(v -> {
albumBottomSheetViewModel.setFavorite();
dismissBottomSheet();
});
playRadio = view.findViewById(R.id.play_radio_text_view);
playRadio.setOnClickListener(v -> {
Toast.makeText(requireContext(), "Play radio", Toast.LENGTH_SHORT).show();
dismissBottomSheet();
});
playNext = view.findViewById(R.id.play_next_text_view);
playNext.setOnClickListener(v -> {
Toast.makeText(requireContext(), "Play next", Toast.LENGTH_SHORT).show();
dismissBottomSheet();
});
addToQueue = view.findViewById(R.id.add_to_queue_text_view);
addToQueue.setOnClickListener(v -> {
Toast.makeText(requireContext(), "Add to queue", Toast.LENGTH_SHORT).show();
dismissBottomSheet();
});
Download = view.findViewById(R.id.download_text_view);
Download.setOnClickListener(v -> {
Toast.makeText(requireContext(), "Download", Toast.LENGTH_SHORT).show();
dismissBottomSheet();
});
addToPlaylist = view.findViewById(R.id.add_to_playlist_text_view);
addToPlaylist.setOnClickListener(v -> {
Toast.makeText(requireContext(), "Add to playlist", Toast.LENGTH_SHORT).show();
dismissBottomSheet();
});
goToArtist = view.findViewById(R.id.go_to_artist_text_view);
goToArtist.setOnClickListener(v -> {
Toast.makeText(requireContext(), "Go to artist", Toast.LENGTH_SHORT).show();
dismissBottomSheet();
});
}
@Override
public void onClick(View v) {
dismissBottomSheet();
}
private void dismissBottomSheet() {
dismiss();
}
}

View file

@ -0,0 +1,39 @@
package com.cappielloantonio.play.viewmodel;
import android.app.Application;
import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;
import com.cappielloantonio.play.model.Song;
import com.cappielloantonio.play.repository.SongRepository;
public class AlbumBottomSheetViewModel extends AndroidViewModel {
private SongRepository songRepository;
private Song song;
public AlbumBottomSheetViewModel(@NonNull Application application) {
super(application);
songRepository = new SongRepository(application);
}
public void setSong(Song song) {
this.song = song;
}
public Song getSong() {
return song;
}
public void setFavorite() {
if(song.isFavorite()) {
song.setFavorite(false);
}
else {
song.setFavorite(true);
}
songRepository.setFavoriteStatus(song);
}
}

View file

@ -1,7 +1,6 @@
package com.cappielloantonio.play.viewmodel; package com.cappielloantonio.play.viewmodel;
import android.app.Application; import android.app.Application;
import android.util.Log;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel; import androidx.lifecycle.AndroidViewModel;
@ -20,6 +19,7 @@ public class HomeViewModel extends AndroidViewModel {
private LiveData<List<Song>> recentlyPlayedSongSample; private LiveData<List<Song>> recentlyPlayedSongSample;
private LiveData<List<Song>> recentlyAddedSongSample; private LiveData<List<Song>> recentlyAddedSongSample;
private LiveData<List<Song>> mostPlayedSongSample; private LiveData<List<Song>> mostPlayedSongSample;
private LiveData<List<Song>> favoritesSongSample;
private List<Integer> years; private List<Integer> years;
public HomeViewModel(@NonNull Application application) { public HomeViewModel(@NonNull Application application) {
@ -31,6 +31,7 @@ public class HomeViewModel extends AndroidViewModel {
recentlyPlayedSongSample = songRepository.getListLiveRecentlyPlayedSampleSong(20); recentlyPlayedSongSample = songRepository.getListLiveRecentlyPlayedSampleSong(20);
recentlyAddedSongSample = songRepository.getListLiveRecentlyAddedSampleSong(20); recentlyAddedSongSample = songRepository.getListLiveRecentlyAddedSampleSong(20);
mostPlayedSongSample = songRepository.getListLiveMostPlayedSampleSong(20); mostPlayedSongSample = songRepository.getListLiveMostPlayedSampleSong(20);
favoritesSongSample = songRepository.getListLiveFavoritesSampleSong(20);
years = songRepository.getYearList(); years = songRepository.getYearList();
} }
@ -56,7 +57,10 @@ public class HomeViewModel extends AndroidViewModel {
} }
public List<Integer> getYearList() { public List<Integer> getYearList() {
Log.d(TAG, "getYearList: " + years.toString());
return years; return years;
} }
public LiveData<List<Song>> getFavorites() {
return favoritesSongSample;
}
} }

View file

@ -56,6 +56,9 @@ public class SongListPageViewModel extends AndroidViewModel {
case Song.BY_YEAR: case Song.BY_YEAR:
songList = songRepository.getSongByYearListLive(year); songList = songRepository.getSongByYearListLive(year);
break; break;
case Song.IS_FAVORITE:
songList = songRepository.getListLiveFavoritesSong();
break;
} }
return songList; return songList;

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_thumb_up" android:state_checked="true" android:color="@color/titleTextColor"/>
<item android:drawable="@drawable/ic_thumb_up_outlined" android:state_checked="false" android:color="@color/titleTextColor" />
</selector>

View file

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M12,8c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM12,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM12,16c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2z"/>
</vector>

View file

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M8,6.82v10.36c0,0.79 0.87,1.27 1.54,0.84l8.14,-5.18c0.62,-0.39 0.62,-1.29 0,-1.69L9.54,5.98C8.87,5.55 8,6.03 8,6.82z"/>
</vector>

View file

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M10.59,9.17L6.12,4.7c-0.39,-0.39 -1.02,-0.39 -1.41,0 -0.39,0.39 -0.39,1.02 0,1.41l4.46,4.46 1.42,-1.4zM15.35,4.85l1.19,1.19L4.7,17.88c-0.39,0.39 -0.39,1.02 0,1.41 0.39,0.39 1.02,0.39 1.41,0L17.96,7.46l1.19,1.19c0.31,0.31 0.85,0.09 0.85,-0.36L20,4.5c0,-0.28 -0.22,-0.5 -0.5,-0.5h-3.79c-0.45,0 -0.67,0.54 -0.36,0.85zM14.83,13.41l-1.41,1.41 3.13,3.13 -1.2,1.2c-0.31,0.31 -0.09,0.85 0.36,0.85h3.79c0.28,0 0.5,-0.22 0.5,-0.5v-3.79c0,-0.45 -0.54,-0.67 -0.85,-0.35l-1.19,1.19 -3.13,-3.14z"/>
</vector>

View file

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M1,21h4L5,9L1,9v12zM23,10c0,-1.1 -0.9,-2 -2,-2h-6.31l0.95,-4.57 0.03,-0.32c0,-0.41 -0.17,-0.79 -0.44,-1.06L14.17,1 7.59,7.59C7.22,7.95 7,8.45 7,9v10c0,1.1 0.9,2 2,2h9c0.83,0 1.54,-0.5 1.84,-1.22l3.02,-7.05c0.09,-0.23 0.14,-0.47 0.14,-0.73v-2z"/>
</vector>

View file

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M9,21h9c0.83,0 1.54,-0.5 1.84,-1.22l3.02,-7.05c0.09,-0.23 0.14,-0.47 0.14,-0.73v-2c0,-1.1 -0.9,-2 -2,-2h-6.31l0.95,-4.57 0.03,-0.32c0,-0.41 -0.17,-0.79 -0.44,-1.06L14.17,1 7.58,7.59C7.22,7.95 7,8.45 7,9v10c0,1.1 0.9,2 2,2zM9,9l4.34,-4.34L12,10h9v2l-3,7H9V9zM1,9h4v12H1z"/>
</vector>

View file

@ -28,5 +28,23 @@
app:labelVisibilityMode="unlabeled" app:labelVisibilityMode="unlabeled"
app:layout_behavior="@string/hide_bottom_view_on_scroll_behavior" app:layout_behavior="@string/hide_bottom_view_on_scroll_behavior"
app:layout_scrollFlags="scroll|enterAlways|snap" app:layout_scrollFlags="scroll|enterAlways|snap"
app:menu="@menu/bottom_nav_menu" /> app:menu="@menu/bottom_nav_menu">
<LinearLayout
android:id="@+id/offline_mode_linear_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorAccent"
android:layout_gravity="bottom"
android:gravity="center"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="6dp"
android:text="Offline mode"/>
</LinearLayout>
</com.google.android.material.bottomnavigation.BottomNavigationView>
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="This is a BottomSheet"
android:textSize="25sp" />
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="button 1" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="button 2" />
</LinearLayout>

View file

@ -0,0 +1,191 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@color/cardColor">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="12dp"
android:paddingStart="20dp"
android:paddingEnd="20dp">
<!-- Header -->
<androidx.cardview.widget.CardView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:backgroundTint="@color/cardColor"
android:paddingTop="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:tint="@color/subtitleTextColor"
card_view:cardCornerRadius="4dp"
card_view:cardElevation="0dp"
card_view:cardPreventCornerOverlap="false"
card_view:cardUseCompatPadding="false">
<ImageView
android:id="@+id/song_cover_image_view"
android:layout_width="54dp"
android:layout_height="54dp" />
</androidx.cardview.widget.CardView>
<ToggleButton
android:id="@+id/button_favorite"
android:layout_width="24dp"
android:layout_height="24dp"
android:background="@drawable/button_favorite_selector"
android:checked="false"
android:gravity="center_vertical"
android:paddingStart="8dp"
android:paddingTop="4dp"
android:paddingEnd="20dp"
android:text=""
android:textOff=""
android:textOn=""
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/song_title_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:fontFamily="@font/open_sans_font_family"
android:maxLines="1"
android:paddingTop="8dp"
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:text="@string/label_placeholder"
android:textColor="@color/titleTextColor"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintStart_toEndOf="@+id/imageView"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/song_artist_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/open_sans_font_family"
android:paddingStart="12dp"
android:text="@string/label_placeholder"
android:textColor="@color/subtitleTextColor"
android:textSize="14sp"
app:layout_constraintStart_toEndOf="@+id/imageView"
app:layout_constraintTop_toBottomOf="@+id/song_title_text_view" />
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:id="@+id/option_linear_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:paddingTop="8dp"
android:paddingBottom="12dp">
<TextView
android:id="@+id/play_radio_text_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Avvia radio"
android:fontFamily="@font/open_sans_font_family"
android:textFontWeight="700"
android:textSize="15dp"
android:textColor="@color/titleTextColor"
android:paddingTop="14dp"
android:paddingBottom="14dp"
android:paddingStart="20dp"
android:background="?attr/selectableItemBackground"
android:clickable="true"/>
<TextView
android:id="@+id/play_next_text_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="14dp"
android:paddingBottom="14dp"
android:text="Riproduci dopo"
android:paddingStart="20dp"
android:fontFamily="@font/open_sans_font_family"
android:textFontWeight="700"
android:textSize="15dp"
android:textColor="@color/titleTextColor"
android:background="?attr/selectableItemBackground"
android:clickable="true" />
<TextView
android:id="@+id/add_to_queue_text_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="14dp"
android:paddingBottom="14dp"
android:text="Aggiungi alla coda"
android:paddingStart="20dp"
android:fontFamily="@font/open_sans_font_family"
android:textFontWeight="700"
android:textSize="15dp"
android:textColor="@color/titleTextColor"
android:background="?attr/selectableItemBackground"
android:clickable="true"/>
<TextView
android:id="@+id/download_text_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="14dp"
android:paddingBottom="14dp"
android:text="Scarica"
android:paddingStart="20dp"
android:fontFamily="@font/open_sans_font_family"
android:textFontWeight="700"
android:textSize="15dp"
android:textColor="@color/titleTextColor"
android:background="?attr/selectableItemBackground"
android:clickable="true"
/>
<TextView
android:id="@+id/add_to_playlist_text_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="14dp"
android:paddingBottom="14dp"
android:text="Aggiungi alla playlist"
android:paddingStart="20dp"
android:fontFamily="@font/open_sans_font_family"
android:textFontWeight="700"
android:textSize="15dp"
android:textColor="@color/titleTextColor"
android:background="?attr/selectableItemBackground"
android:clickable="true"/>
<TextView
android:id="@+id/go_to_artist_text_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="14dp"
android:paddingBottom="14dp"
android:text="Vai all'artista"
android:paddingStart="20dp"
android:fontFamily="@font/open_sans_font_family"
android:textFontWeight="700"
android:textSize="15dp"
android:textColor="@color/titleTextColor"
android:background="?attr/selectableItemBackground"
android:clickable="true"/>
</LinearLayout>
</LinearLayout>

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android" <androidx.core.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
@ -21,7 +22,8 @@
app:layout_constraintDimensionRatio="W, 4:5" app:layout_constraintDimensionRatio="W, 4:5"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent"
app:cardCornerRadius="0dp">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -47,7 +49,6 @@
android:id="@+id/album_title_label" android:id="@+id/album_title_label"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="60dp"
android:elevation="4dp" android:elevation="4dp"
android:fontFamily="@font/open_sans_font_family" android:fontFamily="@font/open_sans_font_family"
android:paddingStart="20dp" android:paddingStart="20dp"
@ -62,27 +63,41 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" /> app:layout_constraintStart_toStartOf="parent" />
<View
android:layout_width="match_parent"
android:layout_height="86dp"
android:background="@drawable/gradient_backdrop_fading_down_background_image"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/card_view" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
<!-- Label and button --> <!-- Label and button -->
<TextView <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="-54dp" android:layout_marginTop="12dp"
android:fontFamily="@font/open_sans_font_family" android:orientation="horizontal"
android:paddingStart="16dp" android:paddingStart="8dp"
android:paddingEnd="16dp" android:paddingEnd="8dp">
android:text="Song"
android:textColor="@color/titleTextColor" <TextView
android:textSize="22sp" android:layout_width="0dp"
android:textStyle="bold" /> android:layout_height="wrap_content"
android:layout_weight="1"
android:fontFamily="@font/open_sans_font_family"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:text="Songs"
android:textColor="@color/titleTextColor"
android:textSize="22sp"
android:textStyle="bold" />
<ImageButton
android:id="@+id/album_settings_image_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:layout_marginTop="-6dp"
android:backgroundTint="@android:color/transparent"
android:tint="@color/titleTextColor"
android:src="@drawable/ic_more" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/song_recycler_view" android:id="@+id/song_recycler_view"
@ -91,9 +106,7 @@
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
android:clipToPadding="false" android:clipToPadding="false"
android:paddingStart="16dp"
android:paddingTop="8dp" android:paddingTop="8dp"
android:paddingEnd="8dp" android:paddingBottom="8dp" />
android:paddingBottom="54dp" />
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>

View file

@ -21,7 +21,8 @@
app:layout_constraintDimensionRatio="W, 4:5" app:layout_constraintDimensionRatio="W, 4:5"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent"
app:cardCornerRadius="0dp">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -47,7 +48,6 @@
android:id="@+id/artist_name_label" android:id="@+id/artist_name_label"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="60dp"
android:elevation="4dp" android:elevation="4dp"
android:fontFamily="@font/open_sans_font_family" android:fontFamily="@font/open_sans_font_family"
android:paddingStart="20dp" android:paddingStart="20dp"
@ -61,21 +61,13 @@
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" /> app:layout_constraintStart_toStartOf="parent" />
<View
android:layout_width="match_parent"
android:layout_height="86dp"
android:background="@drawable/gradient_backdrop_fading_down_background_image"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/card_view" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
<!-- Label and button --> <!-- Label and button -->
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="-58dp" android:layout_marginTop="12dp"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingStart="8dp" android:paddingStart="8dp"
android:paddingEnd="8dp"> android:paddingEnd="8dp">
@ -113,9 +105,7 @@
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
android:clipToPadding="false" android:clipToPadding="false"
android:paddingStart="16dp"
android:paddingTop="8dp" android:paddingTop="8dp"
android:paddingEnd="8dp"
android:paddingBottom="8dp" /> android:paddingBottom="8dp" />
<TextView <TextView
@ -140,6 +130,6 @@
android:paddingStart="16dp" android:paddingStart="16dp"
android:paddingTop="8dp" android:paddingTop="8dp"
android:paddingEnd="8dp" android:paddingEnd="8dp"
android:paddingBottom="54dp" /> android:paddingBottom="8dp" />
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>

View file

@ -1,257 +1,305 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android" <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/pull_to_refresh_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
app:layout_behavior="@string/hide_bottom_view_on_scroll_behavior"
android:paddingTop="20dp">
<LinearLayout <androidx.core.widget.NestedScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:orientation="vertical" app:layout_behavior="@string/hide_bottom_view_on_scroll_behavior"
android:paddingBottom="8dp"> android:paddingTop="20dp">
<!-- Discover music -->
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical"
android:paddingBottom="8dp">
<TextView <!-- Discover music -->
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/open_sans_font_family"
android:paddingStart="16dp"
android:paddingTop="20dp"
android:paddingEnd="16dp"
android:text="Music discovery"
android:textColor="@color/titleTextColor"
android:textSize="22sp"
android:textStyle="bold" />
<!-- slideview -->
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/discover_song_view_pager"
android:layout_width="match_parent"
android:layout_height="188dp"
android:clipToPadding="false"
android:paddingTop="8dp"
android:paddingBottom="8dp" />
</LinearLayout>
<!-- Recently added tracks -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<!-- Label and button -->
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="vertical">
android:paddingStart="8dp"
android:paddingTop="8dp"
android:paddingEnd="8dp">
<TextView <TextView
android:layout_width="0dp" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1"
android:fontFamily="@font/open_sans_font_family" android:fontFamily="@font/open_sans_font_family"
android:paddingStart="8dp" android:paddingStart="16dp"
android:paddingTop="12dp" android:paddingTop="20dp"
android:paddingEnd="8dp" android:paddingEnd="16dp"
android:text="Recently added" android:text="Music discovery"
android:textColor="@color/titleTextColor" android:textColor="@color/titleTextColor"
android:textSize="22sp" android:textSize="22sp"
android:textStyle="bold" /> android:textStyle="bold" />
<!-- slideview -->
<TextView <androidx.viewpager2.widget.ViewPager2
android:id="@+id/recently_added_tracks_text_view_clickable" android:id="@+id/discover_song_view_pager"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="188dp"
android:fontFamily="@font/open_sans_font_family" android:clipToPadding="false"
android:paddingStart="8dp" android:paddingTop="8dp"
android:paddingTop="12dp" android:paddingBottom="8dp" />
android:paddingEnd="8dp"
android:text="See all"
android:textColor="@color/subtitleTextColor"
android:textSize="14sp" />
</LinearLayout> </LinearLayout>
<androidx.recyclerview.widget.RecyclerView <!-- Recently added tracks -->
android:id="@+id/recently_added_tracks_recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:clipToPadding="false"
android:paddingStart="16dp"
android:paddingTop="8dp"
android:paddingEnd="8dp"
android:paddingBottom="8dp" />
</LinearLayout>
<!-- Recently added tracks -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<!-- Label and button -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/open_sans_font_family"
android:paddingStart="16dp"
android:paddingTop="20dp"
android:paddingEnd="16dp"
android:text="Flashback"
android:textColor="@color/titleTextColor"
android:textSize="22sp"
android:textStyle="bold" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/years_recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:clipToPadding="false"
android:paddingStart="16dp"
android:paddingTop="8dp"
android:paddingEnd="8dp"
android:paddingBottom="8dp" />
</LinearLayout>
<!-- Recently played tracks -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<!-- Label and button -->
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="vertical">
android:paddingStart="8dp"
android:paddingTop="8dp"
android:paddingEnd="8dp">
<TextView <!-- Label and button -->
android:layout_width="0dp" <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:orientation="horizontal"
android:fontFamily="@font/open_sans_font_family"
android:paddingStart="8dp" android:paddingStart="8dp"
android:paddingTop="12dp" android:paddingTop="8dp"
android:paddingEnd="8dp">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fontFamily="@font/open_sans_font_family"
android:paddingStart="8dp"
android:paddingTop="12dp"
android:paddingEnd="8dp"
android:text="Recently added"
android:textColor="@color/titleTextColor"
android:textSize="22sp"
android:textStyle="bold" />
<TextView
android:id="@+id/recently_added_tracks_text_view_clickable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/open_sans_font_family"
android:paddingStart="8dp"
android:paddingTop="12dp"
android:paddingEnd="8dp"
android:text="See all"
android:textColor="@color/subtitleTextColor"
android:textSize="14sp" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recently_added_tracks_recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:clipToPadding="false"
android:paddingStart="16dp"
android:paddingTop="8dp"
android:paddingEnd="8dp" android:paddingEnd="8dp"
android:text="Last played" android:paddingBottom="8dp" />
</LinearLayout>
<!-- Fashback -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<!-- Label and button -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/open_sans_font_family"
android:paddingStart="16dp"
android:paddingTop="20dp"
android:paddingEnd="16dp"
android:text="Flashback"
android:textColor="@color/titleTextColor" android:textColor="@color/titleTextColor"
android:textSize="22sp" android:textSize="22sp"
android:textStyle="bold" /> android:textStyle="bold" />
<androidx.recyclerview.widget.RecyclerView
<TextView android:id="@+id/years_recycler_view"
android:id="@+id/recently_played_tracks_text_view_clickable" android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:fontFamily="@font/open_sans_font_family" android:layout_marginTop="8dp"
android:paddingStart="8dp" android:layout_marginBottom="8dp"
android:paddingTop="12dp" android:clipToPadding="false"
android:paddingStart="16dp"
android:paddingTop="8dp"
android:paddingEnd="8dp" android:paddingEnd="8dp"
android:text="See all" android:paddingBottom="8dp" />
android:textColor="@color/subtitleTextColor"
android:textSize="14sp" />
</LinearLayout> </LinearLayout>
<androidx.recyclerview.widget.RecyclerView <!-- Favorites -->
android:id="@+id/recently_played_tracks_recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:clipToPadding="false"
android:paddingStart="16dp"
android:paddingTop="8dp"
android:paddingEnd="8dp"
android:paddingBottom="8dp" />
</LinearLayout>
<!-- Most played tracks -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<!-- Label and button -->
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="vertical">
android:paddingStart="8dp"
android:paddingTop="8dp"
android:paddingEnd="8dp">
<TextView <!-- Label and button -->
android:layout_width="0dp" <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:orientation="horizontal"
android:fontFamily="@font/open_sans_font_family"
android:paddingStart="8dp" android:paddingStart="8dp"
android:paddingTop="12dp" android:paddingTop="8dp"
android:paddingEnd="8dp" android:paddingEnd="8dp">
android:text="Most played"
android:textColor="@color/titleTextColor" <TextView
android:textSize="22sp" android:layout_width="0dp"
android:textStyle="bold" /> android:layout_height="wrap_content"
android:layout_weight="1"
android:fontFamily="@font/open_sans_font_family"
android:paddingStart="8dp"
android:paddingTop="12dp"
android:paddingEnd="8dp"
android:text="Favorites"
android:textColor="@color/titleTextColor"
android:textSize="22sp"
android:textStyle="bold" />
<TextView <TextView
android:id="@+id/most_played_tracks_text_view_clickable" android:id="@+id/favorites_tracks_text_view_clickable"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/open_sans_font_family"
android:paddingStart="8dp"
android:paddingTop="12dp"
android:paddingEnd="8dp"
android:text="See all"
android:textColor="@color/subtitleTextColor"
android:textSize="14sp" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/favorites_tracks_recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:fontFamily="@font/open_sans_font_family" android:layout_marginTop="8dp"
android:paddingStart="8dp" android:layout_marginBottom="8dp"
android:paddingTop="12dp" android:clipToPadding="false"
android:paddingEnd="8dp" android:paddingTop="8dp"
android:text="See all" android:paddingBottom="8dp" />
android:textColor="@color/subtitleTextColor"
android:textSize="14sp" />
</LinearLayout> </LinearLayout>
<androidx.recyclerview.widget.RecyclerView <!-- Most played tracks -->
android:id="@+id/most_played_tracks_recycler_view" <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="8dp" android:orientation="vertical">
android:layout_marginBottom="8dp"
android:clipToPadding="false"
android:paddingStart="16dp"
android:paddingTop="8dp"
android:paddingEnd="8dp"
android:paddingBottom="8dp" />
<Button <!-- Label and button -->
android:id="@+id/resync_button" <LinearLayout
style="@style/Widget.MaterialComponents.Button.OutlinedButton" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingStart="8dp"
android:paddingTop="8dp"
android:paddingEnd="8dp">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fontFamily="@font/open_sans_font_family"
android:paddingStart="8dp"
android:paddingTop="12dp"
android:paddingEnd="8dp"
android:text="Most played"
android:textColor="@color/titleTextColor"
android:textSize="22sp"
android:textStyle="bold" />
<TextView
android:id="@+id/most_played_tracks_text_view_clickable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/open_sans_font_family"
android:paddingStart="8dp"
android:paddingTop="12dp"
android:paddingEnd="8dp"
android:text="See all"
android:textColor="@color/subtitleTextColor"
android:textSize="14sp" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/most_played_tracks_recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:clipToPadding="false"
android:paddingStart="16dp"
android:paddingTop="8dp"
android:paddingEnd="8dp"
android:paddingBottom="8dp" />
</LinearLayout>
<!-- Recently played tracks -->
<LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="16dp" android:orientation="vertical">
android:layout_marginTop="24dp"
android:layout_marginEnd="16dp" <!-- Label and button -->
android:text="Resync" <LinearLayout
android:textAllCaps="false" android:layout_width="match_parent"
android:textColor="@color/normalTextColor" android:layout_height="wrap_content"
app:cornerRadius="24dp" /> android:orientation="horizontal"
android:paddingStart="8dp"
android:paddingTop="8dp"
android:paddingEnd="8dp">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fontFamily="@font/open_sans_font_family"
android:paddingStart="8dp"
android:paddingTop="12dp"
android:paddingEnd="8dp"
android:text="Last played"
android:textColor="@color/titleTextColor"
android:textSize="22sp"
android:textStyle="bold" />
<TextView
android:id="@+id/recently_played_tracks_text_view_clickable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/open_sans_font_family"
android:paddingStart="8dp"
android:paddingTop="12dp"
android:paddingEnd="8dp"
android:text="See all"
android:textColor="@color/subtitleTextColor"
android:textSize="14sp" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recently_played_tracks_recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:clipToPadding="false"
android:paddingStart="16dp"
android:paddingTop="8dp"
android:paddingEnd="8dp"
android:paddingBottom="24dp" />
</LinearLayout>
</LinearLayout> </LinearLayout>
</LinearLayout> </androidx.core.widget.NestedScrollView>
</androidx.core.widget.NestedScrollView> </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

View file

@ -197,19 +197,6 @@
android:paddingTop="8dp" android:paddingTop="8dp"
android:paddingEnd="8dp"/> android:paddingEnd="8dp"/>
<Button
android:id="@+id/sync_genre_button"
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="16dp"
android:paddingBottom="12dp"
android:text="Sync Genres"
android:textAllCaps="false"
android:textColor="@color/normalTextColor"
app:cornerRadius="24dp" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>

View file

@ -141,9 +141,7 @@
android:layout_marginTop="4dp" android:layout_marginTop="4dp"
android:clipToPadding="false" android:clipToPadding="false"
android:overScrollMode="never" android:overScrollMode="never"
android:paddingStart="16dp"
android:paddingTop="8dp" android:paddingTop="8dp"
android:paddingEnd="8dp"
android:paddingBottom="24dp" /> android:paddingBottom="24dp" />
<TextView <TextView

View file

@ -31,9 +31,7 @@
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
android:clipToPadding="false" android:clipToPadding="false"
android:paddingStart="16dp"
android:paddingTop="8dp" android:paddingTop="8dp"
android:paddingEnd="8dp"
android:paddingBottom="8dp" /> android:paddingBottom="8dp" />
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>

View file

@ -28,7 +28,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:ellipsize="end" android:ellipsize="end"
android:fontFamily="@font/open_sans_font_family" android:fontFamily="@font/open_sans_font_family"
android:maxWidth="172dp" android:maxWidth="256dp"
android:maxLines="2" android:maxLines="2"
android:paddingStart="2dp" android:paddingStart="2dp"
android:paddingTop="8dp" android:paddingTop="8dp"

View file

@ -19,7 +19,7 @@
<ImageView <ImageView
android:id="@+id/track_cover_image_view" android:id="@+id/track_cover_image_view"
android:layout_width="172dp" android:layout_width="172dp"
android:layout_height="172dp" /> android:layout_height="172dp"/>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>
<TextView <TextView

View file

@ -4,9 +4,11 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingTop="2dp" android:paddingStart="16dp"
android:paddingEnd="4dp" android:paddingTop="3dp"
android:paddingBottom="2dp"> android:paddingEnd="12dp"
android:paddingBottom="3dp"
android:background="?attr/selectableItemBackground">
<androidx.cardview.widget.CardView <androidx.cardview.widget.CardView
android:id="@+id/imageView" android:id="@+id/imageView"
@ -26,8 +28,8 @@
<ImageView <ImageView
android:id="@+id/song_cover_image_view" android:id="@+id/song_cover_image_view"
android:layout_width="48dp" android:layout_width="52dp"
android:layout_height="48dp" /> android:layout_height="52dp" />
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>
<LinearLayout <LinearLayout
@ -45,7 +47,7 @@
android:fontFamily="@font/open_sans_font_family" android:fontFamily="@font/open_sans_font_family"
android:maxLines="1" android:maxLines="1"
android:paddingStart="12dp" android:paddingStart="12dp"
android:paddingTop="8dp" android:paddingTop="10dp"
android:paddingEnd="12dp" android:paddingEnd="12dp"
android:text="@string/label_placeholder" android:text="@string/label_placeholder"
android:textColor="@color/titleTextColor" android:textColor="@color/titleTextColor"