diff --git a/app/src/main/java/com/cappielloantonio/play/ui/fragment/HomeFragment.java b/app/src/main/java/com/cappielloantonio/play/ui/fragment/HomeFragment.java index c6e11d97..7045de4b 100644 --- a/app/src/main/java/com/cappielloantonio/play/ui/fragment/HomeFragment.java +++ b/app/src/main/java/com/cappielloantonio/play/ui/fragment/HomeFragment.java @@ -51,7 +51,6 @@ public class HomeFragment extends Fragment { homeViewModel = new ViewModelProvider(requireActivity()).get(HomeViewModel.class); init(); - initSwipeToRefresh(); initDiscoverSongSlideView(); initRecentAddedSongView(); initFavoritesSongView(); @@ -99,22 +98,21 @@ public class HomeFragment extends Fragment { 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); + bind.syncMusicButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + 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(); + } }); } diff --git a/app/src/main/res/drawable/ic_downloading.xml b/app/src/main/res/drawable/ic_downloading.xml new file mode 100644 index 00000000..dc70bf7d --- /dev/null +++ b/app/src/main/res/drawable/ic_downloading.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml index 3008023d..3f28a9a0 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_home.xml @@ -1,304 +1,313 @@ - + android:layout_height="match_parent" + app:layout_behavior="@string/hide_bottom_view_on_scroll_behavior"> - + android:layout_height="wrap_content" + android:orientation="vertical" + android:paddingBottom="@dimen/global_padding_bottom"> + + android:orientation="vertical"> - - + 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" /> - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + android:layout_height="212dp" + android:clipToPadding="false" + android:paddingTop="8dp" + android:paddingBottom="8dp" /> - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 46181001..96ed41f1 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -47,6 +47,8 @@ Remove from queue Add to playlist + Sync music + The playing notification provides actions for play/pause etc. Playing Notification \ No newline at end of file