including material3 dependencies and attempting 1 for 1 swap of imports

This commit is contained in:
Adam Brown 2022-09-04 15:07:16 +01:00 committed by Adam Brown
parent f20e3a4c40
commit 1a6f8b6b40
24 changed files with 98 additions and 92 deletions

View File

@ -106,7 +106,7 @@ ext.Dependencies.with {
androidxComposeUi = "androidx.compose.ui:ui:${composeVer}"
androidxComposeFoundation = "androidx.compose.foundation:foundation:${composeVer}"
androidxComposeMaterial = "androidx.compose.material:material:${composeVer}"
androidxComposeMaterial = "androidx.compose.material3:material3:1.0.0-beta01"
androidxComposeIconsExtended = "androidx.compose.material:material-icons-extended:${composeVer}"
androidxActivityCompose = "androidx.activity:activity-compose:1.4.0"
kotlinCompilerExtensionVersion = "1.3.0"

View File

@ -3,7 +3,7 @@ package app.dapk.st.design.components
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.Text
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier

View File

@ -3,8 +3,8 @@ package app.dapk.st.design.components
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.Button
import androidx.compose.material.Text
import androidx.compose.material3.Button
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier

View File

@ -6,7 +6,7 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.BoxScope
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.Text
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier

View File

@ -1,9 +1,9 @@
package app.dapk.st.design.components
import androidx.compose.foundation.layout.Box
import androidx.compose.material.DropdownMenu
import androidx.compose.material.Icon
import androidx.compose.material.IconButton
import androidx.compose.material3.DropdownMenu
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.MoreVert
import androidx.compose.runtime.*

View File

@ -1,8 +1,8 @@
package app.dapk.st.design.components
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material.MaterialTheme
import androidx.compose.material.darkColors
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.darkColorScheme
import androidx.compose.runtime.*
import androidx.compose.ui.graphics.Color
import com.google.accompanist.systemuicontroller.rememberSystemUiController
@ -12,7 +12,7 @@ private object Palette {
val brandPrimary = Color(0xFFb41cca)
}
private val DARK_COLOURS = darkColors(
private val DARK_COLOURS = darkColorScheme(
primary = Palette.brandPrimary,
onPrimary = Color(0xDDFFFFFF),
)
@ -56,9 +56,9 @@ fun SmallTalkTheme(content: @Composable () -> Unit) {
val systemUiController = rememberSystemUiController()
val systemInDarkTheme = isSystemInDarkTheme()
MaterialTheme(
colors = if (systemInDarkTheme) DARK_COLOURS else LIGHT_COLOURS,
// colorScheme = if (systemInDarkTheme) DARK_COLOURS else LIGHT_COLOURS,
) {
val backgroundColor = MaterialTheme.colors.background
val backgroundColor = MaterialTheme.colorScheme.background
SideEffect {
systemUiController.setSystemBarsColor(backgroundColor)
}

View File

@ -4,7 +4,7 @@ import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.offset
import androidx.compose.material.*
import androidx.compose.material3.*
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.runtime.Composable
@ -14,6 +14,7 @@ import androidx.compose.ui.unit.Density
import androidx.compose.ui.unit.IntOffset
import androidx.compose.ui.unit.dp
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun Toolbar(
onNavigate: (() -> Unit)? = null,
@ -23,7 +24,7 @@ fun Toolbar(
) {
val navigationIcon = foo(onNavigate)
TopAppBar(
SmallTopAppBar(
modifier = Modifier.height(72.dp).run {
if (offset == null) {
this
@ -31,13 +32,14 @@ fun Toolbar(
this.offset(offset)
}
},
backgroundColor = MaterialTheme.colors.background,
navigationIcon = navigationIcon,
colors = TopAppBarDefaults.smallTopAppBarColors(
containerColor = MaterialTheme.colorScheme.background
),
navigationIcon = navigationIcon ?: {},
title = title?.let {
{ Text(it, maxLines = 2) }
} ?: {},
actions = actions,
elevation = 0.dp
)
Divider(modifier = Modifier.fillMaxWidth(), color = Color.Black.copy(alpha = 0.2f), thickness = 0.5.dp)
}

View File

@ -2,9 +2,9 @@ package app.dapk.st.design.components
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.*
import androidx.compose.material.Divider
import androidx.compose.material.Icon
import androidx.compose.material.Text
import androidx.compose.material3.Divider
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier

View File

@ -4,9 +4,9 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.material.CircularProgressIndicator
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
@ -17,7 +17,7 @@ import androidx.compose.ui.unit.sp
@Composable
fun Header(label: String) {
Box(Modifier.padding(top = 24.dp, start = 24.dp, end = 24.dp)) {
Text(text = label.uppercase(), fontWeight = FontWeight.Bold, fontSize = 12.sp, color = MaterialTheme.colors.primary)
Text(text = label.uppercase(), fontWeight = FontWeight.Bold, fontSize = 12.sp, color = MaterialTheme.colorScheme.primary)
}
}

View File

@ -10,8 +10,8 @@ import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
@ -155,7 +155,7 @@ private fun DirectoryItem(room: RoomFoo, onClick: (RoomId) -> Unit, clock: Clock
onClick(overview.roomId)
}) {
Row(Modifier.padding(20.dp)) {
val secondaryText = MaterialTheme.colors.onBackground.copy(alpha = 0.5f)
val secondaryText = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.5f)
Box(Modifier.fillMaxHeight(), contentAlignment = Alignment.Center) {
CircleishAvatar(overview.roomAvatarUrl?.value, roomName, size = 50.dp)
@ -171,7 +171,7 @@ private fun DirectoryItem(room: RoomFoo, onClick: (RoomId) -> Unit, clock: Clock
overflow = TextOverflow.Ellipsis,
fontFamily = FontFamily.SansSerif,
fontWeight = FontWeight.Medium,
color = MaterialTheme.colors.onBackground
color = MaterialTheme.colorScheme.onBackground
)
Spacer(modifier = Modifier.width(6.dp))
@ -184,7 +184,7 @@ private fun DirectoryItem(room: RoomFoo, onClick: (RoomId) -> Unit, clock: Clock
fontSize = 12.sp,
maxLines = 1,
text = formattedTimestamp,
color = if (hasUnread) MaterialTheme.colors.primary else secondaryText
color = if (hasUnread) MaterialTheme.colorScheme.primary else secondaryText
)
}
@ -198,7 +198,7 @@ private fun DirectoryItem(room: RoomFoo, onClick: (RoomId) -> Unit, clock: Clock
Box(
Modifier
.align(Alignment.Center)
.background(color = MaterialTheme.colors.primary, shape = CircleShape)
.background(color = MaterialTheme.colorScheme.primary, shape = CircleShape)
.size(22.dp),
contentAlignment = Alignment.Center
) {
@ -214,7 +214,7 @@ private fun DirectoryItem(room: RoomFoo, onClick: (RoomId) -> Unit, clock: Clock
fontSize = unreadTextSize,
fontWeight = FontWeight.Medium,
text = unreadLabelContent,
color = MaterialTheme.colors.onPrimary
color = MaterialTheme.colorScheme.onPrimary
)
}
}
@ -244,7 +244,7 @@ private fun body(overview: RoomOverview, secondaryText: Color, typing: SyncServi
"$name is typing..."
},
maxLines = 1,
color = MaterialTheme.colors.primary
color = MaterialTheme.colorScheme.primary
)
}
else -> when (val lastMessage = overview.lastMessage) {

View File

@ -1,7 +1,7 @@
package app.dapk.st.home
import androidx.compose.foundation.layout.*
import androidx.compose.material.*
import androidx.compose.material3.*
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.ui.Modifier
@ -17,6 +17,7 @@ import app.dapk.st.home.HomeScreenState.Page.Profile
import app.dapk.st.login.LoginScreen
import app.dapk.st.profile.ProfileScreen
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun HomeScreen(homeViewModel: HomeViewModel) {
SmallTalkTheme {
@ -61,10 +62,10 @@ fun HomeScreen(homeViewModel: HomeViewModel) {
private fun BottomBar(state: SignedIn, homeViewModel: HomeViewModel) {
Column {
Divider(modifier = Modifier.fillMaxWidth(), color = Color.Black.copy(alpha = 0.2f), thickness = 0.5.dp)
BottomNavigation(elevation = 0.dp, backgroundColor = Color.Transparent, modifier = Modifier.height(IntrinsicSize.Min)) {
NavigationBar(containerColor = Color.Transparent, modifier = Modifier.height(IntrinsicSize.Min)) {
Page.values().forEach { page ->
when (page) {
Directory -> BottomNavigationItem(
Directory -> NavigationBarItem(
icon = { Icon(page.icon, contentDescription = null) },
selected = state.page == page,
onClick = {
@ -74,7 +75,7 @@ private fun BottomBar(state: SignedIn, homeViewModel: HomeViewModel) {
}
},
)
Profile -> BottomNavigationItem(
Profile -> NavigationBarItem(
icon = {
Box(modifier = Modifier.fillMaxHeight()) {
CircleishAvatar(state.me.avatarUrl?.value, state.me.displayName ?: state.me.userId.value, size = 25.dp)

View File

@ -2,9 +2,9 @@ package app.dapk.st.home
import android.os.Bundle
import androidx.activity.compose.setContent
import androidx.compose.material.AlertDialog
import androidx.compose.material.Text
import androidx.compose.material.TextButton
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
import androidx.lifecycle.lifecycleScope
import app.dapk.st.core.DapkActivity

View File

@ -4,7 +4,7 @@ import android.widget.Toast
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material.*
import androidx.compose.material3.*
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Visibility
import androidx.compose.material.icons.filled.VisibilityOff
@ -34,7 +34,7 @@ import app.dapk.st.core.StartObserving
import app.dapk.st.login.LoginEvent.LoginComplete
import app.dapk.st.login.LoginScreenState.*
@OptIn(ExperimentalComposeUiApi::class)
@OptIn(ExperimentalComposeUiApi::class, ExperimentalMaterial3Api::class)
@Composable
fun LoginScreen(loginViewModel: LoginViewModel, onLoggedIn: () -> Unit) {
loginViewModel.ObserveEvents(onLoggedIn)

View File

@ -7,7 +7,7 @@ import android.os.Bundle
import android.os.Parcelable
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.Surface
import androidx.compose.material3.Surface
import androidx.compose.ui.Modifier
import app.dapk.st.core.*
import app.dapk.st.design.components.SmallTalkTheme

View File

@ -10,7 +10,7 @@ import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.BasicTextField
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material.*
import androidx.compose.material3.*
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Check
import androidx.compose.material.icons.filled.Close
@ -64,9 +64,7 @@ internal fun MessengerScreen(roomId: RoomId, attachments: List<MessageAttachment
Column {
Toolbar(onNavigate = { navigator.navigate.upToHome() }, roomTitle, actions = {
OverflowMenu {
DropdownMenuItem(onClick = {}) {
Text("Settings")
}
DropdownMenuItem(text = { Text("Settings") }, onClick = {})
}
})
when (state.composerState) {
@ -126,7 +124,7 @@ private fun ColumnScope.Room(roomStateLce: Lce<MessengerState>) {
"$name is typing..."
},
maxLines = 1,
color = MaterialTheme.colors.primary
color = MaterialTheme.colorScheme.primary
)
}
}
@ -251,7 +249,7 @@ private fun MessageImage(content: BubbleContent<RoomEvent.Image>) {
fontSize = 11.sp,
text = content.message.author.displayName ?: content.message.author.id.value,
maxLines = 1,
color = MaterialTheme.colors.onPrimary
color = MaterialTheme.colorScheme.onPrimary
)
}
@ -274,7 +272,7 @@ private fun MessageImage(content: BubbleContent<RoomEvent.Image>) {
fontSize = 9.sp,
text = "${editedPrefix ?: ""}${content.message.time}",
textAlign = TextAlign.End,
color = MaterialTheme.colors.onPrimary,
color = MaterialTheme.colorScheme.onPrimary,
modifier = Modifier.wrapContentSize()
)
SendStatus(content.message)
@ -359,12 +357,12 @@ private fun TextBubbleContent(content: BubbleContent<RoomEvent.Message>) {
fontSize = 11.sp,
text = content.message.author.displayName ?: content.message.author.id.value,
maxLines = 1,
color = MaterialTheme.colors.onPrimary
color = MaterialTheme.colorScheme.onPrimary
)
}
Text(
text = content.message.content,
color = MaterialTheme.colors.onPrimary,
color = MaterialTheme.colorScheme.onPrimary,
fontSize = 15.sp,
modifier = Modifier.wrapContentSize(),
textAlign = TextAlign.Start,
@ -377,7 +375,7 @@ private fun TextBubbleContent(content: BubbleContent<RoomEvent.Message>) {
fontSize = 9.sp,
text = "${editedPrefix ?: ""}${content.message.time}",
textAlign = TextAlign.End,
color = MaterialTheme.colors.onPrimary,
color = MaterialTheme.colorScheme.onPrimary,
modifier = Modifier.wrapContentSize()
)
SendStatus(content.message)
@ -416,13 +414,13 @@ private fun ReplyBubbleContent(content: BubbleContent<RoomEvent.Reply>) {
fontSize = 11.sp,
text = replyName,
maxLines = 1,
color = MaterialTheme.colors.onPrimary
color = MaterialTheme.colorScheme.onPrimary
)
when (val replyingTo = content.message.replyingTo) {
is Message -> {
Text(
text = replyingTo.content,
color = MaterialTheme.colors.onPrimary,
color = MaterialTheme.colorScheme.onPrimary,
fontSize = 15.sp,
modifier = Modifier.wrapContentSize(),
textAlign = TextAlign.Start,
@ -457,14 +455,14 @@ private fun ReplyBubbleContent(content: BubbleContent<RoomEvent.Reply>) {
fontSize = 11.sp,
text = content.message.message.author.displayName ?: content.message.message.author.id.value,
maxLines = 1,
color = MaterialTheme.colors.onPrimary
color = MaterialTheme.colorScheme.onPrimary
)
}
when (val message = content.message.message) {
is Message -> {
Text(
text = message.content,
color = MaterialTheme.colors.onPrimary,
color = MaterialTheme.colorScheme.onPrimary,
fontSize = 15.sp,
modifier = Modifier.wrapContentSize(),
textAlign = TextAlign.Start,
@ -497,7 +495,7 @@ private fun ReplyBubbleContent(content: BubbleContent<RoomEvent.Reply>) {
fontSize = 9.sp,
text = content.message.time,
textAlign = TextAlign.End,
color = MaterialTheme.colors.onPrimary,
color = MaterialTheme.colorScheme.onPrimary,
modifier = Modifier.wrapContentSize()
)
SendStatus(content.message.message)
@ -522,12 +520,12 @@ private fun RowScope.SendStatus(message: RoomEvent) {
Spacer(modifier = Modifier.width(4.dp))
Box(
modifier = Modifier
.border(0.5.dp, MaterialTheme.colors.onPrimary, CircleShape)
.border(0.5.dp, MaterialTheme.colorScheme.onPrimary, CircleShape)
.size(10.dp)
.padding(2.dp)
) {
if (isSent) {
Icon(imageVector = Icons.Filled.Check, "", tint = MaterialTheme.colors.onPrimary)
Icon(imageVector = Icons.Filled.Check, "", tint = MaterialTheme.colorScheme.onPrimary)
}
}
}
@ -536,11 +534,11 @@ private fun RowScope.SendStatus(message: RoomEvent) {
Spacer(modifier = Modifier.width(4.dp))
Box(
modifier = Modifier
.border(0.5.dp, MaterialTheme.colors.error, CircleShape)
.border(0.5.dp, MaterialTheme.colorScheme.error, CircleShape)
.size(10.dp)
.padding(2.dp)
) {
Icon(imageVector = Icons.Filled.Close, "", tint = MaterialTheme.colors.error)
Icon(imageVector = Icons.Filled.Close, "", tint = MaterialTheme.colorScheme.error)
}
}
}
@ -548,6 +546,7 @@ private fun RowScope.SendStatus(message: RoomEvent) {
}
}
@OptIn(ExperimentalMaterial3Api::class)
@Composable
private fun TextComposer(state: ComposerState.Text, onTextChange: (String) -> Unit, onSend: () -> Unit) {
Row(
@ -562,7 +561,7 @@ private fun TextComposer(state: ComposerState.Text, onTextChange: (String) -> Un
.align(Alignment.Bottom)
.weight(1f)
.fillMaxHeight()
.background(MaterialTheme.colors.onSurface.copy(alpha = TextFieldDefaults.BackgroundOpacity), RoundedCornerShape(24.dp)),
.background(MaterialTheme.colorScheme.onSurface.copy(alpha = 1.0f), RoundedCornerShape(24.dp)),
contentAlignment = Alignment.TopStart,
) {
Box(Modifier.padding(14.dp)) {
@ -573,8 +572,8 @@ private fun TextComposer(state: ComposerState.Text, onTextChange: (String) -> Un
modifier = Modifier.fillMaxWidth(),
value = state.value,
onValueChange = { onTextChange(it) },
cursorBrush = SolidColor(MaterialTheme.colors.primary),
textStyle = LocalTextStyle.current.copy(color = LocalContentColor.current.copy(LocalContentAlpha.current)),
cursorBrush = SolidColor(MaterialTheme.colorScheme.primary),
// textStyle = LocalTextStyle.current.copy(color = LocalContentColor.current.copy(LocalContentAlpha.current)),
keyboardOptions = KeyboardOptions(capitalization = KeyboardCapitalization.Sentences, autoCorrect = true)
)
}
@ -585,7 +584,7 @@ private fun TextComposer(state: ComposerState.Text, onTextChange: (String) -> Un
enabled = state.value.isNotEmpty(),
modifier = Modifier
.clip(CircleShape)
.background(if (state.value.isEmpty()) Color.DarkGray else MaterialTheme.colors.primary)
.background(if (state.value.isEmpty()) Color.DarkGray else MaterialTheme.colorScheme.primary)
.run {
if (size.height == 0 || size.width == 0) {
this
@ -604,7 +603,7 @@ private fun TextComposer(state: ComposerState.Text, onTextChange: (String) -> Un
Icon(
imageVector = Icons.Filled.Send,
contentDescription = "",
tint = MaterialTheme.colors.onPrimary,
tint = MaterialTheme.colorScheme.onPrimary,
)
}
}
@ -615,7 +614,10 @@ private fun AttachmentComposer(state: ComposerState.Attachments, onSend: () -> U
Box(modifier = Modifier.fillMaxSize()) {
val context = LocalContext.current
Image(
modifier = Modifier.fillMaxHeight().wrapContentWidth().align(Alignment.Center),
modifier = Modifier
.fillMaxHeight()
.wrapContentWidth()
.align(Alignment.Center),
painter = rememberAsyncImagePainter(
model = ImageRequest.Builder(context)
.data(state.values.first().uri.value.toUri())
@ -624,18 +626,21 @@ private fun AttachmentComposer(state: ComposerState.Attachments, onSend: () -> U
contentDescription = null,
)
Box(Modifier.align(Alignment.BottomEnd).padding(12.dp)) {
Box(
Modifier
.align(Alignment.BottomEnd)
.padding(12.dp)) {
IconButton(
enabled = true,
modifier = Modifier
.clip(CircleShape)
.background(MaterialTheme.colors.primary),
.background(MaterialTheme.colorScheme.primary),
onClick = onSend,
) {
Icon(
imageVector = Icons.Filled.Send,
contentDescription = "",
tint = MaterialTheme.colors.onPrimary,
tint = MaterialTheme.colorScheme.onPrimary,
)
}
}

View File

@ -7,10 +7,9 @@ import android.os.Bundle
import android.os.Parcelable
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.Surface
import androidx.compose.material3.Surface
import androidx.compose.ui.Modifier
import app.dapk.st.messenger.MessengerModule
import app.dapk.st.messenger.MessengerScreen
import app.dapk.st.design.components.SmallTalkTheme
import app.dapk.st.core.DapkActivity
import app.dapk.st.core.module

View File

@ -7,7 +7,7 @@ import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.*
import androidx.compose.material3.*
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.CameraAlt
import androidx.compose.material.icons.filled.Settings
@ -84,11 +84,11 @@ private fun ProfilePage(context: Context, viewModel: ProfileViewModel, profile:
IconButton(modifier = Modifier
.size(avatarSize * 0.314f)
.align(Alignment.BottomEnd)
.background(MaterialTheme.colors.primary, shape = CircleShape)
.background(MaterialTheme.colorScheme.primary, shape = CircleShape)
.padding(12.dp),
onClick = {}
) {
Icon(Icons.Filled.CameraAlt, contentDescription = null, tint = MaterialTheme.colors.onPrimary)
Icon(Icons.Filled.CameraAlt, contentDescription = null, tint = MaterialTheme.colorScheme.onPrimary)
}
}
}

View File

@ -3,7 +3,7 @@ package app.dapk.st.settings
import android.os.Bundle
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.Surface
import androidx.compose.material3.Surface
import androidx.compose.ui.Modifier
import app.dapk.st.core.DapkActivity
import app.dapk.st.core.module

View File

@ -13,7 +13,7 @@ import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material.*
import androidx.compose.material3.*
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Visibility
import androidx.compose.material.icons.filled.VisibilityOff
@ -50,7 +50,7 @@ import app.dapk.st.navigator.Navigator
import app.dapk.st.settings.SettingsEvent.*
import app.dapk.st.settings.eventlogger.EventLogActivity
@OptIn(ExperimentalComposeUiApi::class)
@OptIn(ExperimentalComposeUiApi::class, ExperimentalMaterial3Api::class)
@Composable
internal fun SettingsScreen(viewModel: SettingsViewModel, onSignOut: () -> Unit, navigator: Navigator) {
viewModel.ObserveEvents(onSignOut)

View File

@ -3,7 +3,7 @@ package app.dapk.st.settings.eventlogger
import android.os.Bundle
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.Surface
import androidx.compose.material3.Surface
import androidx.compose.ui.Modifier
import app.dapk.st.core.DapkActivity
import app.dapk.st.core.module

View File

@ -5,9 +5,9 @@ import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.material.DropdownMenu
import androidx.compose.material.DropdownMenuItem
import androidx.compose.material.Text
import androidx.compose.material3.DropdownMenu
import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.Text
import androidx.compose.runtime.*
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
@ -85,13 +85,12 @@ private fun Events(selectedPageContent: SelectedState, onExit: () -> Unit, onSel
DropdownMenu(expanded = expanded, onDismissRequest = { expanded = false }) {
filterItems.forEachIndexed { index, item ->
DropdownMenuItem(
text = { Text(item ?: "all") },
onClick = {
expanded = false
onSelectTag(filterItems[index])
}
) {
Text(item ?: "all")
}
)
}
}
}

View File

@ -6,7 +6,7 @@ import android.os.Bundle
import android.os.Parcelable
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.Surface
import androidx.compose.material3.Surface
import androidx.compose.ui.Modifier
import app.dapk.st.core.DapkActivity
import app.dapk.st.core.module

View File

@ -6,8 +6,8 @@ import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
@ -93,7 +93,7 @@ private fun DirectoryItem(item: Item, onClick: (Item) -> Unit) {
.clickable { onClick(item) }
) {
Row(Modifier.padding(20.dp)) {
val secondaryText = MaterialTheme.colors.onBackground.copy(alpha = 0.5f)
val secondaryText = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.5f)
Box(Modifier.fillMaxHeight(), contentAlignment = Alignment.Center) {
CircleishAvatar(item.roomAvatarUrl?.value, roomName, size = 50.dp)
@ -109,7 +109,7 @@ private fun DirectoryItem(item: Item, onClick: (Item) -> Unit) {
overflow = TextOverflow.Ellipsis,
fontFamily = FontFamily.SansSerif,
fontWeight = FontWeight.Medium,
color = MaterialTheme.colors.onBackground
color = MaterialTheme.colorScheme.onBackground
)
Spacer(modifier = Modifier.width(6.dp))
}

View File

@ -3,7 +3,7 @@ package app.dapk.st.verification
import android.os.Bundle
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.Surface
import androidx.compose.material3.Surface
import androidx.compose.ui.Modifier
import app.dapk.st.design.components.SmallTalkTheme
import app.dapk.st.core.DapkActivity