android: rework incognito mode - choose when making connection (#2867)

* android: rework incognito mode - choose when making connection

* remove commented code

* remove commented code

* change text

* text editor border

* smaller qr code

* chat preview height

* fix spacing

* desktop dialogue

* remove import

---------

Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
This commit is contained in:
spaced4ndy
2023-08-08 17:28:18 +04:00
committed by GitHub
parent 1a567c88db
commit b095c09283
43 changed files with 591 additions and 488 deletions
@@ -1,7 +1,13 @@
package chat.simplex.common.views.helpers
import androidx.compose.foundation.*
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
import androidx.compose.runtime.*
import androidx.compose.ui.Modifier
import androidx.compose.ui.input.key.*
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.*
import chat.simplex.common.DialogParams
import chat.simplex.res.MR
@@ -21,6 +27,8 @@ actual fun DefaultDialog(
) {
Dialog(
undecorated = true,
transparent = true,
resizable = false,
title = "",
onCloseRequest = onDismissRequest,
onPreviewKeyEvent = { event ->
@@ -29,7 +37,12 @@ actual fun DefaultDialog(
} else false
}
) {
content()
Surface(
Modifier
.border(border = BorderStroke(1.dp, MaterialTheme.colors.secondary.copy(alpha = 0.3F)), shape = RoundedCornerShape(8))
) {
content()
}
}
}
@@ -6,7 +6,8 @@ import chat.simplex.common.model.ChatModel
@Composable
actual fun ScanToConnectView(chatModel: ChatModel, close: () -> Unit) {
ConnectContactLayout(
chatModelIncognito = chatModel.incognito.value,
chatModel = chatModel,
incognitoPref = chatModel.controller.appPrefs.incognito,
close = close
)
}