44 lines
1.7 KiB
Kotlin
44 lines
1.7 KiB
Kotlin
|
|
package at.lockstep.player
|
||
|
|
|
||
|
|
import android.os.Bundle
|
||
|
|
import androidx.activity.ComponentActivity
|
||
|
|
import androidx.activity.compose.setContent
|
||
|
|
import androidx.compose.foundation.layout.fillMaxSize
|
||
|
|
import androidx.compose.material3.MaterialTheme
|
||
|
|
import androidx.compose.material3.Surface
|
||
|
|
import androidx.compose.runtime.getValue
|
||
|
|
import androidx.compose.runtime.mutableFloatStateOf
|
||
|
|
import androidx.compose.runtime.mutableStateOf
|
||
|
|
import androidx.compose.runtime.remember
|
||
|
|
import androidx.compose.runtime.setValue
|
||
|
|
import androidx.compose.ui.Modifier
|
||
|
|
import at.lockstep.player.ui.NowPlayingScreen
|
||
|
|
import at.lockstep.player.ui.NowPlayingUiState
|
||
|
|
|
||
|
|
class MainActivity : ComponentActivity() {
|
||
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||
|
|
super.onCreate(savedInstanceState)
|
||
|
|
setContent {
|
||
|
|
MaterialTheme {
|
||
|
|
Surface(modifier = Modifier.fillMaxSize()) {
|
||
|
|
var progress by remember { mutableFloatStateOf(0f) }
|
||
|
|
var playing by remember { mutableStateOf(false) }
|
||
|
|
NowPlayingScreen(
|
||
|
|
state = NowPlayingUiState(
|
||
|
|
title = "No track",
|
||
|
|
artist = "—",
|
||
|
|
progress = progress,
|
||
|
|
durationSeconds = 180,
|
||
|
|
isPlaying = playing,
|
||
|
|
),
|
||
|
|
onProgressChange = { progress = it },
|
||
|
|
onPrevious = { /* TODO: service / JNI */ },
|
||
|
|
onTogglePlayPause = { playing = !playing },
|
||
|
|
onNext = { /* TODO: service / JNI */ },
|
||
|
|
)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|