added refresh button, put font back to 16/20sp
parent
d92ae128fb
commit
d03b06341a
|
|
@ -15,6 +15,7 @@ import fr.forum_thalie.tsumugi.playerstore.PlayerStore
|
||||||
|
|
||||||
import java.util.Timer
|
import java.util.Timer
|
||||||
import android.view.MenuItem
|
import android.view.MenuItem
|
||||||
|
import com.google.android.material.snackbar.Snackbar
|
||||||
import fr.forum_thalie.tsumugi.alarm.RadioAlarm
|
import fr.forum_thalie.tsumugi.alarm.RadioAlarm
|
||||||
import fr.forum_thalie.tsumugi.planning.Planning
|
import fr.forum_thalie.tsumugi.planning.Planning
|
||||||
|
|
||||||
|
|
@ -86,6 +87,14 @@ class MainActivity : BaseActivity() {
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
R.id.action_refresh -> {
|
||||||
|
PlayerStore.instance.queue.clear()
|
||||||
|
//PlayerStore.instance.lp.clear()
|
||||||
|
PlayerStore.instance.initApi()
|
||||||
|
val s = Snackbar.make(findViewById(R.id.nav_host_container), getString(R.string.refreshing) as CharSequence, Snackbar.LENGTH_LONG)
|
||||||
|
s.show()
|
||||||
|
true
|
||||||
|
}
|
||||||
R.id.action_settings -> {
|
R.id.action_settings -> {
|
||||||
val i = Intent(this, ParametersActivity::class.java)
|
val i = Intent(this, ParametersActivity::class.java)
|
||||||
startActivity(i)
|
startActivity(i)
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,7 @@ class PlayerStore {
|
||||||
{
|
{
|
||||||
updateApi(result)
|
updateApi(result)
|
||||||
currentSongBackup.copy(currentSong)
|
currentSongBackup.copy(currentSong)
|
||||||
|
fetchLastRequest()
|
||||||
isQueueUpdated.value = true
|
isQueueUpdated.value = true
|
||||||
|
|
||||||
isLpUpdated.value = true
|
isLpUpdated.value = true
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,9 @@ class NowPlayingFragment : Fragment() {
|
||||||
listenersText,8, 16, 2, TypedValue.COMPLEX_UNIT_SP)
|
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...
|
// 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.
|
// so I observe a dedicated Mutable that gets set when the queue is updated.
|
||||||
|
|
|
||||||
|
|
@ -193,7 +193,7 @@
|
||||||
android:text=""
|
android:text=""
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textColor="@color/whited3"
|
android:textColor="@color/whited3"
|
||||||
android:textSize="14sp"
|
android:textSize="16sp"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/upNext"
|
app:layout_constraintTop_toBottomOf="@id/upNext"
|
||||||
android:visibility="visible"/>
|
android:visibility="visible"/>
|
||||||
|
|
@ -206,7 +206,7 @@
|
||||||
android:text=""
|
android:text=""
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textColor="@color/whited"
|
android:textColor="@color/whited"
|
||||||
android:textSize="14sp"
|
android:textSize="16sp"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/text_song_artist_next"
|
app:layout_constraintTop_toBottomOf="@id/text_song_artist_next"
|
||||||
android:visibility="visible" />
|
android:visibility="visible" />
|
||||||
|
|
@ -222,7 +222,7 @@
|
||||||
android:text="@string/current_programme"
|
android:text="@string/current_programme"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textColor="@color/whited3"
|
android:textColor="@color/whited3"
|
||||||
android:textSize="14sp"
|
android:textSize="16sp"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/topInfoGuideline"
|
app:layout_constraintBottom_toBottomOf="@id/topInfoGuideline"
|
||||||
android:visibility="visible" />
|
android:visibility="visible" />
|
||||||
|
|
@ -237,7 +237,7 @@
|
||||||
android:gravity="start|bottom"
|
android:gravity="start|bottom"
|
||||||
android:textAlignment="textStart"
|
android:textAlignment="textStart"
|
||||||
android:textColor="@color/whited"
|
android:textColor="@color/whited"
|
||||||
android:textSize="14sp"
|
android:textSize="16sp"
|
||||||
app:layout_constraintStart_toEndOf="@id/current_programme"
|
app:layout_constraintStart_toEndOf="@id/current_programme"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/topInfoGuideline"
|
app:layout_constraintBottom_toBottomOf="@id/topInfoGuideline"
|
||||||
|
|
@ -298,7 +298,7 @@
|
||||||
android:text=""
|
android:text=""
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textColor="@color/whited"
|
android:textColor="@color/whited"
|
||||||
android:textSize="18sp"
|
android:textSize="20sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
|
|
@ -310,7 +310,7 @@
|
||||||
android:text=""
|
android:text=""
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textColor="@color/whited3"
|
android:textColor="@color/whited3"
|
||||||
android:textSize="18sp"
|
android:textSize="20sp"
|
||||||
app:layout_constraintBottom_toTopOf="@id/text_song_title"
|
app:layout_constraintBottom_toTopOf="@id/text_song_title"
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
|
|
@ -376,7 +376,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
app:layout_constraintGuide_percent="0.58" />
|
app:layout_constraintGuide_percent="0.63" />
|
||||||
|
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
|
|
|
||||||
|
|
@ -15,23 +15,22 @@
|
||||||
app:showAsAction="ifRoom"/>
|
app:showAsAction="ifRoom"/>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
<item
|
|
||||||
android:id="@+id/action_refresh"
|
|
||||||
android:title="@string/action_refresh"
|
|
||||||
app:showAsAction="never"/>
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!--
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_bug_submit"
|
android:id="@+id/action_bug_submit"
|
||||||
android:title="@string/action_bug_submit"
|
android:title="@string/action_bug_submit"
|
||||||
app:showAsAction="never"/>
|
app:showAsAction="never"/>
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_refresh"
|
||||||
|
android:title="@string/action_refresh"
|
||||||
|
app:showAsAction="never"/>
|
||||||
|
|
||||||
<item android:id="@+id/action_settings"
|
<item android:id="@+id/action_settings"
|
||||||
android:title="@string/action_settings"
|
android:title="@string/action_settings"
|
||||||
android:icon="@drawable/ic_settings"
|
android:icon="@drawable/ic_settings"
|
||||||
app:showAsAction="ifRoom"/>
|
app:showAsAction="never"/>
|
||||||
|
|
||||||
|
|
||||||
</menu>
|
</menu>
|
||||||
|
|
@ -52,5 +52,7 @@
|
||||||
<string name="setSleepDuration">Choisir une durée (en minutes)</string>
|
<string name="setSleepDuration">Choisir une durée (en minutes)</string>
|
||||||
<string name="willCloseIn">Extinction dans %1$d minutes</string>
|
<string name="willCloseIn">Extinction dans %1$d minutes</string>
|
||||||
<string name="fetchPeriod">Choisir la fréquence de mise à jour quand la radio est stoppée</string>
|
<string name="fetchPeriod">Choisir la fréquence de mise à jour quand la radio est stoppée</string>
|
||||||
|
<string name="refreshing">Actualisation…</string>
|
||||||
|
<string name="action_refresh">Raffraîchir les données</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
||||||
|
|
@ -72,5 +72,7 @@
|
||||||
<string name="setSleepDuration">Set duration (minutes)</string>
|
<string name="setSleepDuration">Set duration (minutes)</string>
|
||||||
<string name="willCloseIn">Will close in %1$d minutes</string>
|
<string name="willCloseIn">Will close in %1$d minutes</string>
|
||||||
<string name="fetchPeriod">Set update period when stopped</string>
|
<string name="fetchPeriod">Set update period when stopped</string>
|
||||||
|
<string name="refreshing">Refreshing data…</string>
|
||||||
|
<string name="action_refresh">Refresh data</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue