|
@@ -21,8 +21,10 @@ import com.google.android.material.snackbar.BaseTransientBottomBar
|
21
|
21
|
import com.google.android.material.snackbar.Snackbar
|
22
|
22
|
import fr.forum_thalie.tsumugi.*
|
23
|
23
|
import fr.forum_thalie.tsumugi.alarm.RadioSleeper
|
|
24
|
+import fr.forum_thalie.tsumugi.planning.Planning
|
24
|
25
|
import fr.forum_thalie.tsumugi.playerstore.PlayerStore
|
25
|
26
|
import fr.forum_thalie.tsumugi.playerstore.Song
|
|
27
|
+import kotlinx.android.synthetic.main.fragment_nowplaying.*
|
26
|
28
|
|
27
|
29
|
|
28
|
30
|
class NowPlayingFragment : Fragment() {
|
|
@@ -51,10 +53,11 @@ class NowPlayingFragment : Fragment() {
|
51
|
53
|
val streamerPictureImageView: ImageView = root.findViewById(R.id.streamerPicture)
|
52
|
54
|
|
53
|
55
|
// Note: these values are not used in the generic app, but if you want to, you can use them.
|
54
|
|
- /*
|
55
|
|
- val streamerNameText : TextView = root.findViewById(R.id.streamerName)
|
56
|
56
|
val songTitleNextText: TextView = root.findViewById(R.id.text_song_title_next)
|
57
|
57
|
val songArtistNextText: TextView = root.findViewById(R.id.text_song_artist_next)
|
|
58
|
+
|
|
59
|
+ /*
|
|
60
|
+ val streamerNameText : TextView = root.findViewById(R.id.streamerName)
|
58
|
61
|
val listenersText : TextView = root.findViewById(R.id.listenersCount)
|
59
|
62
|
*/
|
60
|
63
|
|
|
@@ -86,11 +89,15 @@ class NowPlayingFragment : Fragment() {
|
86
|
89
|
|
87
|
90
|
|
88
|
91
|
PlayerStore.instance.currentSong.title.observe(viewLifecycleOwner, Observer {
|
89
|
|
- songTitleText.text = it
|
|
92
|
+ songTitleText.text = it
|
|
93
|
+ })
|
|
94
|
+
|
|
95
|
+ Planning.instance.currentProgramme.observe(viewLifecycleOwner, Observer {
|
|
96
|
+ songTitleNextText.text = it
|
90
|
97
|
})
|
91
|
98
|
|
92
|
99
|
PlayerStore.instance.currentSong.artist.observe(viewLifecycleOwner, Observer {
|
93
|
|
- songArtistText.text = it
|
|
100
|
+ songArtistText.text = it
|
94
|
101
|
})
|
95
|
102
|
|
96
|
103
|
PlayerStore.instance.playbackState.observe(viewLifecycleOwner, Observer {
|