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