diff --git a/app/src/main/java/fr/forum_thalie/tsumugi/playerstore/PlayerStore.kt b/app/src/main/java/fr/forum_thalie/tsumugi/playerstore/PlayerStore.kt index 1a51ce9..df4c151 100644 --- a/app/src/main/java/fr/forum_thalie/tsumugi/playerstore/PlayerStore.kt +++ b/app/src/main/java/fr/forum_thalie/tsumugi/playerstore/PlayerStore.kt @@ -229,7 +229,7 @@ class PlayerStore { val queueJSON = resMain.getJSONObject("next") val t = extractSong(queueJSON) - if (queue.isNotEmpty() && t == queue.last()) + if (queue.isNotEmpty() && (t == queue.last() || t == currentSong)) { //[REMOVE LOG CALLS]Log.d((tag, playerStoreTag + "Song already in there: $t") Async(sleepScrape, post) diff --git a/app/src/main/java/fr/forum_thalie/tsumugi/ui/nowplaying/NowPlayingFragment.kt b/app/src/main/java/fr/forum_thalie/tsumugi/ui/nowplaying/NowPlayingFragment.kt index 1fba724..1e306ac 100644 --- a/app/src/main/java/fr/forum_thalie/tsumugi/ui/nowplaying/NowPlayingFragment.kt +++ b/app/src/main/java/fr/forum_thalie/tsumugi/ui/nowplaying/NowPlayingFragment.kt @@ -6,8 +6,6 @@ import android.content.Context import androidx.lifecycle.ViewModelProviders import android.os.Bundle import android.support.v4.media.session.PlaybackStateCompat -import android.util.Log -import android.util.TypedValue import androidx.fragment.app.Fragment import android.view.LayoutInflater import android.view.View @@ -15,7 +13,6 @@ import android.view.ViewGroup import android.widget.* import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintSet -import androidx.core.widget.TextViewCompat import androidx.lifecycle.Observer import com.google.android.material.snackbar.BaseTransientBottomBar import com.google.android.material.snackbar.Snackbar @@ -24,7 +21,6 @@ import fr.forum_thalie.tsumugi.alarm.RadioSleeper import fr.forum_thalie.tsumugi.planning.Planning import fr.forum_thalie.tsumugi.playerstore.PlayerStore import fr.forum_thalie.tsumugi.playerstore.Song -import kotlinx.android.synthetic.main.fragment_nowplaying.* class NowPlayingFragment : Fragment() { @@ -49,7 +45,7 @@ class NowPlayingFragment : Fragment() { val volumeText: TextView = root.findViewById(R.id.volume_text) val progressBar: ProgressBar = root.findViewById(R.id.progressBar) val volumeIconImage : ImageView = root.findViewById(R.id.volume_icon) - val currentProgrammeText: TextView = root.findViewById(R.id.text_current_programme) + val currentProgrammeText: TextView = root.findViewById(R.id.current_programme) val streamerPictureImageView: ImageView = root.findViewById(R.id.streamerPicture) // Note: these values are not used in the generic app, but if you want to, you can use them. @@ -69,10 +65,6 @@ class NowPlayingFragment : Fragment() { listenersText,8, 16, 2, TypedValue.COMPLEX_UNIT_SP) */ - TextViewCompat.setAutoSizeTextTypeUniformWithConfiguration( - currentProgrammeText,8, 20, 2, TypedValue.COMPLEX_UNIT_SP) - - // trick : I can't observe the queue because it's an ArrayDeque that doesn't trigger any change... // so I observe a dedicated Mutable that gets set when the queue is updated. PlayerStore.instance.isQueueUpdated.observe(viewLifecycleOwner, Observer { @@ -97,7 +89,7 @@ class NowPlayingFragment : Fragment() { Planning.instance.currentProgramme.observe(viewLifecycleOwner, Observer { - currentProgrammeText.text = it + currentProgrammeText.text = "${context!!.getString(R.string.current_programme)} $it" }) diff --git a/app/src/main/res/layout/fragment_nowplaying.xml b/app/src/main/res/layout/fragment_nowplaying.xml index 46115b6..efaee16 100644 --- a/app/src/main/res/layout/fragment_nowplaying.xml +++ b/app/src/main/res/layout/fragment_nowplaying.xml @@ -49,7 +49,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" - app:layout_constraintGuide_percent="0.68" /> + app:layout_constraintGuide_percent="0.71" /> + app:layout_constraintTop_toBottomOf="@id/seek_bar_volume" + app:layout_constraintVertical_weight="3"> - - - + + + + > + + + + + + + Volume : - Prochain titre : - Émission en cours : + À suivre : + Émission : En cours Erreur du chargement de WebView. Téléchargez Google Chrome sur le Play Store, ou activez le si vous l\'avez désactivé. Paramètres