Add an alert dialog when creating live in order to help the user wait for completion
fixes #1
This commit is contained in:
parent
be2e41765f
commit
a8e290fc0b
@ -4,10 +4,12 @@ import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.widget.ArrayAdapter
|
||||
import android.widget.ProgressBar
|
||||
import androidx.activity.result.ActivityResult
|
||||
import androidx.activity.result.ActivityResultCallback
|
||||
import androidx.activity.result.ActivityResultLauncher
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import fr.mobdev.peertubelive.R
|
||||
@ -274,12 +276,18 @@ class CreateLiveActivity : AppCompatActivity() {
|
||||
}
|
||||
|
||||
private fun goLive(streamSettings: StreamSettings) {
|
||||
val builder = AlertDialog.Builder(this)
|
||||
builder.setCancelable(false)
|
||||
builder.setTitle(R.string.creating)
|
||||
builder.setView(ProgressBar(this))
|
||||
val dialog = builder.show()
|
||||
InstanceManager.createLive(this,oAuthData.baseUrl!!,oAuthData,streamSettings,object : InstanceManager.InstanceListener {
|
||||
override fun onSuccess(args: Bundle?) {
|
||||
if(args != null) {
|
||||
val streamData = args.getParcelable<StreamData>(InstanceManager.EXTRA_DATA)!!
|
||||
val intent = Intent(this@CreateLiveActivity, StreamActivity::class.java)
|
||||
intent.putExtra(InstanceManager.EXTRA_DATA,streamData)
|
||||
dialog.dismiss()
|
||||
startLive.launch(intent)
|
||||
}
|
||||
}
|
||||
@ -288,6 +296,7 @@ class CreateLiveActivity : AppCompatActivity() {
|
||||
runOnUiThread {
|
||||
binding.error.text = error
|
||||
binding.error.visibility = View.VISIBLE
|
||||
dialog.dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -58,6 +58,8 @@
|
||||
<string name="save_replay">Publier une rediffusion automatiquement à la fin du direct</string>
|
||||
<string name="stream_ended">Direct terminé</string>
|
||||
<string name="end_stream">Arrêter le direct</string>
|
||||
<string name="creating">Patientez pendant la creation du direct</string>
|
||||
|
||||
<!-- placeholders -->
|
||||
<string name="exemple_instance">ex: peertube.fr, https://peertube.fr</string>
|
||||
|
||||
|
@ -57,6 +57,8 @@
|
||||
<string name="save_replay">Automatically publish a replay when your live ends</string>
|
||||
<string name="stream_ended">Live ended</string>
|
||||
<string name="end_stream">Stop the live</string>
|
||||
<string name="creating">Wait for live creation</string>
|
||||
|
||||
<!-- placeholders -->
|
||||
<string name="exemple_instance">e.g. peertube.fr, https://peertube.fr</string>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user