Merge branch 'master' of git.reim.ar:ReiMerc/easyeat
This commit is contained in:
commit
76a0e6afee
@ -1,5 +1,6 @@
|
||||
package tech.mercantec.easyeat
|
||||
|
||||
import android.app.ProgressDialog
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.widget.Button
|
||||
@ -20,6 +21,10 @@ class LoginActivity : AppCompatActivity() {
|
||||
val email = findViewById<EditText>(R.id.email).text.toString()
|
||||
val password = findViewById<EditText>(R.id.password).text.toString()
|
||||
|
||||
val progressDialog = ProgressDialog(this)
|
||||
progressDialog.setMessage("Loading...")
|
||||
progressDialog.show()
|
||||
|
||||
thread {
|
||||
try {
|
||||
login(email, password)
|
||||
@ -29,6 +34,10 @@ class LoginActivity : AppCompatActivity() {
|
||||
}
|
||||
|
||||
return@thread
|
||||
} finally {
|
||||
runOnUiThread {
|
||||
progressDialog.hide()
|
||||
}
|
||||
}
|
||||
|
||||
val intent = Intent(this, MainActivity::class.java)
|
||||
|
@ -1,5 +1,6 @@
|
||||
package tech.mercantec.easyeat
|
||||
|
||||
import android.app.ProgressDialog
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.widget.Button
|
||||
@ -27,6 +28,10 @@ class RegisterActivity : AppCompatActivity() {
|
||||
return@setOnClickListener
|
||||
}
|
||||
|
||||
val progressDialog = ProgressDialog(this)
|
||||
progressDialog.setMessage("Loading...")
|
||||
progressDialog.show()
|
||||
|
||||
thread {
|
||||
try {
|
||||
register(email, username, password)
|
||||
@ -36,6 +41,10 @@ class RegisterActivity : AppCompatActivity() {
|
||||
}
|
||||
|
||||
return@thread
|
||||
} finally {
|
||||
runOnUiThread {
|
||||
progressDialog.hide()
|
||||
}
|
||||
}
|
||||
|
||||
startActivity(Intent(this, LoginActivity::class.java))
|
||||
|
Loading…
Reference in New Issue
Block a user