First song played: What she said - The Smiths

This commit is contained in:
Antonio Cappiello 2021-03-18 16:20:20 +01:00
parent c1c02b3c37
commit 0f19fc3190
12 changed files with 47 additions and 221 deletions

View file

@ -6,7 +6,6 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.ScrollView;
import android.widget.SeekBar;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@ -154,34 +153,15 @@ public class PlayerBottomSheetFragment extends Fragment implements MusicServiceE
bind.playerHeaderLayout.playerHeaderSongArtistLabel.setText(song.getArtistName());
bind.playerBodyLayout.buttonFavorite.setChecked(song.isFavorite());
playSong(song);
}
private void setUpMusicControllers() {
setUpPlayPauseButton();
// setUpPrevNext();
// setUpRepeatButton();
// setUpShuffleButton();
initSeekBar();
}
private void setUpPlayPauseButton() {
bind.playerBodyLayout.playPauseButton.setOnClickListener(v -> {
if (MusicPlayerRemote.isPlaying()) {
MusicPlayerRemote.pauseSong();
Toast.makeText(requireContext(), "PAUSING", Toast.LENGTH_SHORT).show();
} else {
MusicPlayerRemote.resumePlaying();
Toast.makeText(requireContext(), "PLAYING", Toast.LENGTH_SHORT).show();
}
});
}
private void playSong(Song song) {
// Toast.makeText(activity, MusicUtil.getSongFileUri(song), Toast.LENGTH_SHORT).show();
}
public View getPlayerHeader() {
return getView().findViewById(R.id.player_header_layout);
}