Direct registration button
This commit is contained in:
parent
3a24274a2a
commit
e52b54017e
5 changed files with 32 additions and 1 deletions
|
|
@ -80,6 +80,7 @@ class LoginActivity : BaseActivity(), Injectable {
|
|||
getString(R.string.preferences_file_key), Context.MODE_PRIVATE)
|
||||
|
||||
loginButton.setOnClickListener { onButtonClick() }
|
||||
registerButton.setOnClickListener { onRegisterClick() }
|
||||
|
||||
whatsAnInstanceTextView.setOnClickListener {
|
||||
val dialog = AlertDialog.Builder(this)
|
||||
|
|
@ -119,6 +120,21 @@ class LoginActivity : BaseActivity(), Injectable {
|
|||
return super.onOptionsItemSelected(item)
|
||||
}
|
||||
|
||||
private fun onRegisterClick() {
|
||||
registerButton.isEnabled = false
|
||||
|
||||
val uri = Uri.parse(BuildConfig.REGISTER_ACCOUNT_URL)
|
||||
if (!openInCustomTab(uri, this)) {
|
||||
val viewIntent = Intent(Intent.ACTION_VIEW, uri)
|
||||
if (viewIntent.resolveActivity(packageManager) != null) {
|
||||
startActivity(viewIntent)
|
||||
} else {
|
||||
domainEditText.error = getString(R.string.error_no_web_browser_found)
|
||||
setLoading(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtain the oauth client credentials for this app. This is only necessary the first time the
|
||||
* app is run on a given server instance. So, after the first authentication, they are
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue