mirror of
https://github.com/Steffo99/twom.git
synced 2024-11-24 17:14:24 +00:00
Display user profile at the top right if logged in
This commit is contained in:
parent
5a083bbd05
commit
8c255b55fd
2 changed files with 18 additions and 1 deletions
|
@ -1,8 +1,12 @@
|
||||||
package eu.steffo.twom.matrix
|
package eu.steffo.twom.matrix
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.material.icons.Icons
|
||||||
|
import androidx.compose.material.icons.filled.AccountCircle
|
||||||
import androidx.compose.material3.CenterAlignedTopAppBar
|
import androidx.compose.material3.CenterAlignedTopAppBar
|
||||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||||
|
import androidx.compose.material3.Icon
|
||||||
|
import androidx.compose.material3.IconButton
|
||||||
import androidx.compose.material3.Scaffold
|
import androidx.compose.material3.Scaffold
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
|
@ -26,7 +30,19 @@ fun MatrixActivityScaffold(
|
||||||
CenterAlignedTopAppBar(
|
CenterAlignedTopAppBar(
|
||||||
title = {
|
title = {
|
||||||
Text(LocalContext.current.getString(R.string.app_name))
|
Text(LocalContext.current.getString(R.string.app_name))
|
||||||
}
|
},
|
||||||
|
actions = {
|
||||||
|
if (session != null) {
|
||||||
|
IconButton(
|
||||||
|
onClick = {}
|
||||||
|
) {
|
||||||
|
Icon(
|
||||||
|
Icons.Filled.AccountCircle,
|
||||||
|
LocalContext.current.getString(R.string.account_label)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -22,4 +22,5 @@
|
||||||
<string name="notloggedin_text">To use TwoM, you need to be logged into Matrix.</string>
|
<string name="notloggedin_text">To use TwoM, you need to be logged into Matrix.</string>
|
||||||
<string name="notloggedin_login_text">Login</string>
|
<string name="notloggedin_login_text">Login</string>
|
||||||
<string name="loggedin_text">You are logged in.</string>
|
<string name="loggedin_text">You are logged in.</string>
|
||||||
|
<string name="account_label">My account</string>
|
||||||
</resources>
|
</resources>
|
Loading…
Reference in a new issue