mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 01:53:31 +00:00
First song played: What she said - The Smiths
This commit is contained in:
parent
c1c02b3c37
commit
0f19fc3190
12 changed files with 47 additions and 221 deletions
|
|
@ -5,12 +5,14 @@ import android.view.LayoutInflater;
|
|||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.cappielloantonio.play.App;
|
||||
import com.cappielloantonio.play.R;
|
||||
import com.cappielloantonio.play.glide.CustomGlideRequest;
|
||||
import com.cappielloantonio.play.helper.MusicPlayerRemote;
|
||||
import com.cappielloantonio.play.model.Song;
|
||||
import com.cappielloantonio.play.repository.SongRepository;
|
||||
|
||||
|
|
@ -66,6 +68,14 @@ public class PlayerNowPlayingSongAdapter extends RecyclerView.Adapter<PlayerNowP
|
|||
public void onClick(View view) {
|
||||
SongRepository songRepository = new SongRepository(App.getInstance());
|
||||
songRepository.increasePlayCount(songs.get(getAdapterPosition()));
|
||||
|
||||
if (MusicPlayerRemote.isPlaying()) {
|
||||
MusicPlayerRemote.pauseSong();
|
||||
Toast.makeText(context, "PAUSING", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
MusicPlayerRemote.resumePlaying();
|
||||
Toast.makeText(context, "PLAYING", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue