1
Fork 0
mirror of https://github.com/Steffo99/twom.git synced 2024-11-25 01:24:24 +00:00

Display user profile at the top right if logged in

This commit is contained in:
Steffo 2023-11-22 19:44:43 +01:00
parent 5a083bbd05
commit 8c255b55fd
Signed by: steffo
GPG key ID: 2A24051445686895
2 changed files with 18 additions and 1 deletions

View file

@ -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)
)
}
}
},
) )
} }
) { ) {

View file

@ -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>