align views; fix accept

This commit is contained in:
spaced4ndy
2024-11-21 21:15:04 +04:00
parent 899ec474c9
commit 5402f41940
6 changed files with 49 additions and 36 deletions
@@ -3606,7 +3606,7 @@ enum class OperatorTag {
}
data class ServerOperatorInfo(
val description: String,
val description: List<String>,
val website: String,
val logo: ImageResource,
val largeLogo: ImageResource,
@@ -3615,7 +3615,10 @@ data class ServerOperatorInfo(
)
val operatorsInfo: Map<OperatorTag, ServerOperatorInfo> = mapOf(
OperatorTag.SimpleX to ServerOperatorInfo(
description = "SimpleX Chat preset servers",
description = listOf(
"SimpleX Chat is the first communication network that has no user profile IDs of any kind, not even random numbers or keys that identify the users.",
"SimpleX Chat Ltd develops the communication software for SimpleX network."
),
website = "https://simplex.chat",
logo = MR.images.decentralized,
largeLogo = MR.images.logo,
@@ -3623,20 +3626,18 @@ val operatorsInfo: Map<OperatorTag, ServerOperatorInfo> = mapOf(
largeLogoDarkMode = MR.images.logo_light
),
OperatorTag.Flux to ServerOperatorInfo(
description = "Flux is the largest decentralized cloud infrastructure, leveraging a global network of user-operated computational nodes. Flux offers a powerful, scalable, and affordable platform designed to support individuals, businesses, and cutting-edge technologies like AI. With high uptime and worldwide distribution, Flux ensures reliable, accessible cloud computing for all.",
description = listOf(
"Flux is the largest decentralized cloud infrastructure, leveraging a global network of user-operated computational nodes.",
"Flux offers a powerful, scalable, and affordable platform designed to support individuals, businesses, and cutting-edge technologies like AI. With high uptime and worldwide distribution, Flux ensures reliable, accessible cloud computing for all."
),
website = "https://runonflux.com",
logo = MR.images.decentralized,
largeLogo = MR.images.logo,
logoDarkMode = MR.images.decentralized_light,
largeLogoDarkMode = MR.images.logo_light
// LALAL
// logo = "flux_logo_symbol",
// largeLogo = "flux_logo",
// logoDarkMode = "flux_logo_symbol",
// largeLogoDarkMode = "flux_logo-light"
logo = MR.images.flux_logo_symbol,
largeLogo = MR.images.flux_logo,
logoDarkMode = MR.images.flux_logo_symbol,
largeLogoDarkMode = MR.images.flux_logo_light
),
OperatorTag.XYZ to ServerOperatorInfo(
description = "XYZ servers",
description = listOf("XYZ servers"),
website = "XYZ website",
logo = MR.images.shield,
largeLogo = MR.images.logo,
@@ -3644,7 +3645,7 @@ val operatorsInfo: Map<OperatorTag, ServerOperatorInfo> = mapOf(
largeLogoDarkMode = MR.images.logo_light
),
OperatorTag.Demo to ServerOperatorInfo(
description = "Demo operator",
description = listOf("Demo operator"),
website = "Demo website",
logo = MR.images.decentralized,
largeLogo = MR.images.logo,
@@ -3729,7 +3730,7 @@ data class ServerOperator(
) {
companion object {
val dummyOperatorInfo = ServerOperatorInfo(
description = "Default",
description = listOf("Default"),
website = "Default",
logo = MR.images.decentralized,
largeLogo = MR.images.logo,
@@ -3814,13 +3815,17 @@ data class ServerOperator(
}
}
val logo: ImageResource get() {
return if (CurrentColors.value.base == DefaultTheme.LIGHT) info.logo else info.logoDarkMode
}
val logo: ImageResource
@Composable
get() {
return if (isInDarkTheme()) info.logoDarkMode else info.logo
}
val largeLogo: ImageResource get() {
return if (CurrentColors.value.base == DefaultTheme.LIGHT) info.largeLogo else info.largeLogoDarkMode
}
val largeLogo: ImageResource
@Composable
get() {
return if (isInDarkTheme()) info.largeLogoDarkMode else info.largeLogo
}
}
@Serializable
@@ -2,8 +2,7 @@ package chat.simplex.common.views.onboarding
import SectionBottomSpacer
import SectionTextFooter
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.background
import androidx.compose.foundation.*
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.*
import androidx.compose.material.*
@@ -127,7 +126,7 @@ private fun OperatorCheckView(serverOperator: ServerOperator, selectedOperatorId
shape = RoundedCornerShape(18.dp)
) {
Row(Modifier.padding(DEFAULT_PADDING_HALF), verticalAlignment = Alignment.CenterVertically) {
Icon(painterResource(serverOperator.largeLogo), null, Modifier.height(48.dp))
Image(painterResource(serverOperator.largeLogo), null, Modifier.height(48.dp))
Spacer(Modifier.width(DEFAULT_PADDING_HALF).weight(1f))
CircleCheckbox(checked)
}
@@ -139,16 +139,7 @@ fun OperatorViewLayout(
Column {
SectionView(generalGetString(MR.strings.operator).uppercase()) {
SectionItemView({ ModalManager.start.showModalCloseable { _ -> OperatorInfoView(operator) } }) {
Image(
painterResource(operator.logo),
operator.tradeName,
modifier = Modifier.size(24.dp),
colorFilter = if (operator.enabled) null else ColorFilter.colorMatrix(ColorMatrix().apply {
setToSaturation(0f)
})
)
TextIconSpaced()
Text(operator.tradeName, color = MaterialTheme.colors.onBackground)
Image(painterResource(operator.largeLogo), null, Modifier.height(48.dp))
}
UseOperatorToggle(
scope = scope,
@@ -401,10 +392,29 @@ private fun OperatorInfoView(serverOperator: ServerOperator) {
SectionView {
SectionItemView {
Text(serverOperator.info.description)
Column(verticalArrangement = Arrangement.spacedBy(10.dp)) {
Image(painterResource(serverOperator.largeLogo), null, Modifier.height(48.dp))
if (serverOperator.legalName != null) {
Text(serverOperator.legalName)
}
}
}
}
SectionDividerSpaced(maxBottomPadding = false)
SectionView {
SectionItemView {
Column(verticalArrangement = Arrangement.spacedBy(10.dp)) {
serverOperator.info.description.forEach { d ->
Text(d)
}
}
}
}
SectionDividerSpaced()
SectionView(generalGetString(MR.strings.operator_website).uppercase()) {
SectionItemView {
val website = serverOperator.info.website
@@ -524,7 +534,6 @@ private fun SingleOperatorUsageConditionsView(
Column(modifier = Modifier.weight(1f).padding(end = DEFAULT_PADDING, start = DEFAULT_PADDING, bottom = DEFAULT_PADDING, top = DEFAULT_PADDING_HALF)) {
ConditionsTextView(rhId)
}
AcceptConditionsButton(close)
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB