mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2024-12-17 17:20:21 +01:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f31054de4f | |||
| 8cc0954430 | |||
| 8f6a31ca07 |
@@ -262,7 +262,7 @@ jobs:
|
||||
# rm -rf dist-newstyle/src/direct-sq* is here because of the bug in cabal's dependency which prevents second build from finishing
|
||||
|
||||
- name: 'Setup MSYS2'
|
||||
if: startsWith(github.ref, 'refs/tags/v') && matrix.os == 'windows-latest'
|
||||
if: matrix.os == 'windows-latest'
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: ucrt64
|
||||
|
||||
+3
-67
@@ -6,7 +6,6 @@ import androidx.compose.foundation.lazy.*
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material.*
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.runtime.*
|
||||
import androidx.compose.runtime.saveable.rememberSaveable
|
||||
import androidx.compose.ui.Alignment
|
||||
@@ -25,7 +24,6 @@ import chat.simplex.common.views.onboarding.WhatsNewView
|
||||
import chat.simplex.common.views.onboarding.shouldShowWhatsNew
|
||||
import chat.simplex.common.views.usersettings.SettingsView
|
||||
import chat.simplex.common.platform.*
|
||||
import chat.simplex.common.views.localauth.VerticalDivider
|
||||
import chat.simplex.common.views.newchat.*
|
||||
import chat.simplex.res.MR
|
||||
import kotlinx.coroutines.*
|
||||
@@ -42,9 +40,6 @@ fun ChatListView(chatModel: ChatModel, settingsState: SettingsViewState, setPerf
|
||||
if (animated) newChatSheetState.value = AnimatedViewState.HIDING
|
||||
else newChatSheetState.value = AnimatedViewState.GONE
|
||||
}
|
||||
|
||||
val inDMs = remember { mutableStateOf(true) }
|
||||
|
||||
LaunchedEffect(Unit) {
|
||||
if (shouldShowWhatsNew(chatModel)) {
|
||||
delay(1000L)
|
||||
@@ -107,59 +102,8 @@ fun ChatListView(chatModel: ChatModel, settingsState: SettingsViewState, setPerf
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
) {
|
||||
|
||||
// Direct Messages or Groups toggle
|
||||
Box (
|
||||
modifier = Modifier.fillMaxWidth().height(48.dp)
|
||||
){
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth(),
|
||||
horizontalArrangement = Arrangement.Center
|
||||
) {
|
||||
IconButton(
|
||||
modifier = Modifier.size(48.dp).weight(1f),
|
||||
onClick = { inDMs.value = true }
|
||||
) {
|
||||
Icon(
|
||||
painterResource(MR.images.ic_person),
|
||||
contentDescription = null,
|
||||
tint = if (inDMs.value) MaterialTheme.colors.primary else MaterialTheme.colors.secondary,
|
||||
modifier = Modifier
|
||||
.padding(3.dp)
|
||||
.padding(3.dp)
|
||||
.size(34.dp)
|
||||
.weight(1f)
|
||||
)
|
||||
}
|
||||
|
||||
VerticalDivider(
|
||||
startIndent = 8.dp
|
||||
)
|
||||
|
||||
IconButton(
|
||||
modifier = Modifier.size(48.dp).weight(1f),
|
||||
onClick = { inDMs.value = false }
|
||||
) {
|
||||
Icon(
|
||||
painterResource(MR.images.ic_group),
|
||||
contentDescription = null,
|
||||
tint = if (!inDMs.value) MaterialTheme.colors.primary else MaterialTheme.colors.secondary,
|
||||
modifier = Modifier
|
||||
.padding(3.dp)
|
||||
.padding(3.dp)
|
||||
.size(34.dp)
|
||||
.weight(1f)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
Divider()
|
||||
|
||||
|
||||
// Chat list
|
||||
if (chatModel.chats.isNotEmpty()) {
|
||||
ChatList(chatModel, search = searchInList, inDMs=inDMs.value)
|
||||
ChatList(chatModel, search = searchInList)
|
||||
} else if (!switchingUsersAndHosts.value) {
|
||||
Box(Modifier.fillMaxSize()) {
|
||||
if (!stopped && !newChatSheetState.collectAsState().value.isVisible()) {
|
||||
@@ -388,7 +332,7 @@ fun connectIfOpenedViaUri(rhId: Long?, uri: URI, chatModel: ChatModel) {
|
||||
private var lazyListState = 0 to 0
|
||||
|
||||
@Composable
|
||||
private fun ChatList(chatModel: ChatModel, search: String, inDMs: Boolean) {
|
||||
private fun ChatList(chatModel: ChatModel, search: String) {
|
||||
val listState = rememberLazyListState(lazyListState.first, lazyListState.second)
|
||||
DisposableEffect(Unit) {
|
||||
onDispose { lazyListState = listState.firstVisibleItemIndex to listState.firstVisibleItemScrollOffset }
|
||||
@@ -404,15 +348,7 @@ private fun ChatList(chatModel: ChatModel, search: String, inDMs: Boolean) {
|
||||
listState
|
||||
) {
|
||||
items(chats) { chat ->
|
||||
if (inDMs) {
|
||||
if (chat.chatInfo.chatType == ChatType.Direct) {
|
||||
ChatListNavLinkView(chat, chatModel)
|
||||
}
|
||||
} else {
|
||||
if (chat.chatInfo.chatType == ChatType.Group) {
|
||||
ChatListNavLinkView(chat, chatModel)
|
||||
}
|
||||
}
|
||||
ChatListNavLinkView(chat, chatModel)
|
||||
}
|
||||
}
|
||||
if (chats.isEmpty() && !chatModel.chats.isEmpty()) {
|
||||
|
||||
@@ -8,7 +8,7 @@ title: App settings
|
||||
To open app settings:
|
||||
|
||||
- Open the app.
|
||||
- Tap on your user profile image in the upper right-hand of the screen.
|
||||
- Tap on your user profile image in the upper left-hand of the screen.
|
||||
- If you have more than one profile, tap the current profile again or choose Settings.
|
||||
|
||||
## Your profile settings
|
||||
|
||||
Reference in New Issue
Block a user