Add user name at top of screen
This commit is contained in:
parent
e799e12961
commit
aef919f05b
3 changed files with 9 additions and 4 deletions
|
@ -76,6 +76,7 @@ class MainActivity : AppCompatActivity() {
|
|||
|
||||
private fun loginPage() {
|
||||
setContentView(R.layout.activity_login) // show login page
|
||||
this.title = getString(R.string.app_name)
|
||||
|
||||
val userInput = findViewById<EditText>(R.id.usernameInput)
|
||||
val passwordInput = findViewById<EditText>(R.id.passwordInput)
|
||||
|
@ -120,6 +121,8 @@ class MainActivity : AppCompatActivity() {
|
|||
toggleSettingsButtonVisibility()
|
||||
}, 100) // delay to add button settings
|
||||
}
|
||||
val user = Credentials().get(0).toString()
|
||||
this.title = "${getString(R.string.app_name)} (${getString(R.string.connected_as)} $user)";
|
||||
val valuesRecyclerView = getValuesRecyclerView() // list of all the element in the main page
|
||||
|
||||
class Adapter(private val values: List<String>) :
|
||||
|
@ -157,6 +160,10 @@ class MainActivity : AppCompatActivity() {
|
|||
builder.show()
|
||||
true
|
||||
}
|
||||
button?.setOnClickListener {
|
||||
val password = Credentials().get(1).toString()
|
||||
callScript(user, password, "Plex") // call script
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -208,10 +215,6 @@ class MainActivity : AppCompatActivity() {
|
|||
.show()
|
||||
true
|
||||
}
|
||||
|
||||
// user = Credentials().get(0).toString()
|
||||
// password = Credentials().get(1).toString()
|
||||
// callScript(user, password, "Plex") // call script
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
|
|
|
@ -16,4 +16,5 @@
|
|||
<string name="deletedCredentials">Identifiants supprimés</string>
|
||||
<string name="dropBro">lâche frère</string>
|
||||
<string name="internetPermission">Pas la permission d\'utiliser internet</string>
|
||||
<string name="connected_as">connecté en tant que</string>
|
||||
</resources>
|
|
@ -8,6 +8,7 @@
|
|||
<string name="buttonLogin">Login</string>
|
||||
|
||||
<!-- Main page -->
|
||||
<string name="connected_as">connected as</string>
|
||||
<string name="newAppDialogTitle">New app name</string>
|
||||
<string name="validate">Validate</string>
|
||||
<string name="remove">Remove</string>
|
||||
|
|
Reference in a new issue