mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 09:53:33 +00:00
Add a button shortcut in SongBottomSheetDialog to rate the track
This commit is contained in:
parent
75d6f3afd3
commit
10c5c295e6
2 changed files with 29 additions and 0 deletions
|
|
@ -51,6 +51,7 @@ public class SongBottomSheetDialog extends BottomSheetDialogFragment implements
|
||||||
private TextView playRadio;
|
private TextView playRadio;
|
||||||
private TextView playNext;
|
private TextView playNext;
|
||||||
private TextView addToQueue;
|
private TextView addToQueue;
|
||||||
|
private TextView rate;
|
||||||
private TextView download;
|
private TextView download;
|
||||||
private TextView addToPlaylist;
|
private TextView addToPlaylist;
|
||||||
private TextView goToAlbum;
|
private TextView goToAlbum;
|
||||||
|
|
@ -148,6 +149,18 @@ public class SongBottomSheetDialog extends BottomSheetDialogFragment implements
|
||||||
dismissBottomSheet();
|
dismissBottomSheet();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
rate = view.findViewById(R.id.rate_text_view);
|
||||||
|
rate.setOnClickListener(v -> {
|
||||||
|
Bundle bundle = new Bundle();
|
||||||
|
bundle.putParcelable("song_object", song);
|
||||||
|
|
||||||
|
RatingDialog dialog = new RatingDialog();
|
||||||
|
dialog.setArguments(bundle);
|
||||||
|
dialog.show(requireActivity().getSupportFragmentManager(), null);
|
||||||
|
|
||||||
|
dismissBottomSheet();
|
||||||
|
});
|
||||||
|
|
||||||
download = view.findViewById(R.id.download_text_view);
|
download = view.findViewById(R.id.download_text_view);
|
||||||
download.setOnClickListener(v -> {
|
download.setOnClickListener(v -> {
|
||||||
DownloadUtil.getDownloadTracker(requireContext()).toggleDownload(Arrays.asList(song));
|
DownloadUtil.getDownloadTracker(requireContext()).toggleDownload(Arrays.asList(song));
|
||||||
|
|
|
||||||
|
|
@ -136,6 +136,22 @@
|
||||||
android:textFontWeight="700"
|
android:textFontWeight="700"
|
||||||
android:textSize="14sp" />
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/rate_text_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?attr/selectableItemBackground"
|
||||||
|
android:clickable="true"
|
||||||
|
android:fontFamily="@font/opensans"
|
||||||
|
android:paddingStart="20dp"
|
||||||
|
android:paddingTop="12dp"
|
||||||
|
android:paddingEnd="20dp"
|
||||||
|
android:paddingBottom="12dp"
|
||||||
|
android:text="Valuta"
|
||||||
|
android:textColor="@color/titleTextColor"
|
||||||
|
android:textFontWeight="700"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/download_text_view"
|
android:id="@+id/download_text_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue