feat: Jam-Host abgeben, Einladen-Code mittig (1.7.0)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -309,7 +309,18 @@ class JamActivity : AppCompatActivity() {
|
||||
Unit
|
||||
}
|
||||
} else null
|
||||
members.addView(row(name, info, image = null, initial = m.name.take(1).uppercase(), action1 = null, action2 = kick).apply {
|
||||
// Host-Rolle abgeben (nur an jemanden, der gerade verbunden ist).
|
||||
val makeHost = if (state.isHost && m.id != state.you && m.online) {
|
||||
R.drawable.ic_crown to {
|
||||
AlertDialog.Builder(this)
|
||||
.setMessage(getString(R.string.jam_make_host_confirm, m.name))
|
||||
.setPositiveButton(R.string.jam_make_host) { _, _ -> JamHub.send("transfer", "memberId" to m.id) }
|
||||
.setNegativeButton(R.string.pc_cancel, null)
|
||||
.show()
|
||||
Unit
|
||||
}
|
||||
} else null
|
||||
members.addView(row(name, info, image = null, initial = m.name.take(1).uppercase(), action1 = makeHost, action2 = kick).apply {
|
||||
alpha = if (m.online) 1f else 0.5f
|
||||
})
|
||||
}
|
||||
|
||||
@@ -276,6 +276,7 @@ object JamHub {
|
||||
"not_allowed" -> str(R.string.jam_error_not_allowed)
|
||||
"queue_full" -> str(R.string.jam_error_queue_full)
|
||||
"bad_video" -> str(R.string.jam_error_bad_video)
|
||||
"offline" -> str(R.string.jam_error_offline)
|
||||
"playlist_not_found" -> str(R.string.jam_error_playlist)
|
||||
"rate_limited" -> str(R.string.jam_error_rate_limited)
|
||||
else -> str(R.string.jam_error_other, error)
|
||||
|
||||
Reference in New Issue
Block a user