Remove manual theming and fix background colors

This commit is contained in:
Andrew 2024-06-13 12:26:51 +09:30
parent 9721dbbd9e
commit 96157d65a6
11 changed files with 153 additions and 172 deletions

View File

@ -19,6 +19,7 @@ import org.thoughtcrime.securesms.conversation.disappearingmessages.ui.UiState
import org.thoughtcrime.securesms.database.RecipientDatabase import org.thoughtcrime.securesms.database.RecipientDatabase
import org.thoughtcrime.securesms.database.ThreadDatabase import org.thoughtcrime.securesms.database.ThreadDatabase
import org.thoughtcrime.securesms.ui.SessionMaterialTheme import org.thoughtcrime.securesms.ui.SessionMaterialTheme
import org.thoughtcrime.securesms.ui.setContentWithTheme
import javax.inject.Inject import javax.inject.Inject
@AndroidEntryPoint @AndroidEntryPoint
@ -45,7 +46,7 @@ class DisappearingMessagesActivity: PassphraseRequiredActionBarActivity() {
setUpToolbar() setUpToolbar()
binding.container.setContent { DisappearingMessagesScreen() } binding.container.setContentWithTheme { DisappearingMessagesScreen() }
lifecycleScope.launch { lifecycleScope.launch {
repeatOnLifecycle(Lifecycle.State.STARTED) { repeatOnLifecycle(Lifecycle.State.STARTED) {
@ -87,8 +88,6 @@ class DisappearingMessagesActivity: PassphraseRequiredActionBarActivity() {
@Composable @Composable
fun DisappearingMessagesScreen() { fun DisappearingMessagesScreen() {
val uiState by viewModel.uiState.collectAsState(UiState()) val uiState by viewModel.uiState.collectAsState(UiState())
SessionMaterialTheme { DisappearingMessages(uiState, callbacks = viewModel)
DisappearingMessages(uiState, callbacks = viewModel)
}
} }
} }

View File

@ -14,14 +14,11 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.pager.HorizontalPager import androidx.compose.foundation.pager.HorizontalPager
import androidx.compose.foundation.pager.rememberPagerState import androidx.compose.foundation.pager.rememberPagerState
import androidx.compose.material.MaterialTheme
import androidx.compose.material.primarySurface
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.ComposeView
import androidx.compose.ui.res.stringResource import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.tooling.preview.PreviewParameter
@ -50,7 +47,6 @@ import org.thoughtcrime.securesms.ui.LocalDimensions
import org.thoughtcrime.securesms.ui.PreviewTheme import org.thoughtcrime.securesms.ui.PreviewTheme
import org.thoughtcrime.securesms.ui.SessionColors import org.thoughtcrime.securesms.ui.SessionColors
import org.thoughtcrime.securesms.ui.SessionColorsParameterProvider import org.thoughtcrime.securesms.ui.SessionColorsParameterProvider
import org.thoughtcrime.securesms.ui.SessionMaterialTheme
import org.thoughtcrime.securesms.ui.components.AppBar import org.thoughtcrime.securesms.ui.components.AppBar
import org.thoughtcrime.securesms.ui.components.BorderlessButtonWithIcon import org.thoughtcrime.securesms.ui.components.BorderlessButtonWithIcon
import org.thoughtcrime.securesms.ui.components.MaybeScanQrCode import org.thoughtcrime.securesms.ui.components.MaybeScanQrCode
@ -59,6 +55,7 @@ import org.thoughtcrime.securesms.ui.components.SessionButtonText
import org.thoughtcrime.securesms.ui.components.SessionOutlinedTextField import org.thoughtcrime.securesms.ui.components.SessionOutlinedTextField
import org.thoughtcrime.securesms.ui.components.SessionTabRow import org.thoughtcrime.securesms.ui.components.SessionTabRow
import org.thoughtcrime.securesms.ui.contentDescription import org.thoughtcrime.securesms.ui.contentDescription
import org.thoughtcrime.securesms.ui.onCreateView
class NewMessageFragment : Fragment() { class NewMessageFragment : Fragment() {
@ -79,20 +76,16 @@ class NewMessageFragment : Fragment() {
override fun onCreateView( override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?, inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle? savedInstanceState: Bundle?
): View = ComposeView(requireContext()).apply { ): View = onCreateView {
setContent { val uiState by viewModel.state.collectAsState(State())
SessionMaterialTheme { NewMessage(
val uiState by viewModel.state.collectAsState(State()) uiState,
NewMessage( viewModel.qrErrors,
uiState, viewModel,
viewModel.qrErrors, onClose = { delegate.onDialogClosePressed() },
viewModel, onBack = { delegate.onDialogBackPressed() },
onClose = { delegate.onDialogClosePressed() }, onHelp = { requireContext().showOpenUrlDialog("https://sessionapp.zendesk.com/hc/en-us/articles/4439132747033-How-do-Session-ID-usernames-work") }
onBack = { delegate.onDialogBackPressed() }, )
onHelp = { requireContext().showOpenUrlDialog("https://sessionapp.zendesk.com/hc/en-us/articles/4439132747033-How-do-Session-ID-usernames-work") }
)
}
}
} }
private fun createPrivateChat(hexEncodedPublicKey: String) { private fun createPrivateChat(hexEncodedPublicKey: String) {
@ -130,7 +123,7 @@ private fun NewMessage(
) { ) {
val pagerState = rememberPagerState { TITLES.size } val pagerState = rememberPagerState { TITLES.size }
Column(modifier = Modifier.background(MaterialTheme.colors.primarySurface)) { Column(modifier = Modifier.background(LocalColors.current.backgroundSecondary)) {
AppBar(stringResource(R.string.messageNew), onClose = onClose, onBack = onBack) AppBar(stringResource(R.string.messageNew), onClose = onClose, onBack = onBack)
SessionTabRow(pagerState, TITLES) SessionTabRow(pagerState, TITLES)
HorizontalPager(pagerState) { HorizontalPager(pagerState) {

View File

@ -77,6 +77,7 @@ import org.thoughtcrime.securesms.ui.baseMonospace
import org.thoughtcrime.securesms.ui.blackAlpha40 import org.thoughtcrime.securesms.ui.blackAlpha40
import org.thoughtcrime.securesms.ui.components.SessionButtonText import org.thoughtcrime.securesms.ui.components.SessionButtonText
import org.thoughtcrime.securesms.ui.destructiveButtonColors import org.thoughtcrime.securesms.ui.destructiveButtonColors
import org.thoughtcrime.securesms.ui.setComposeContent
import javax.inject.Inject import javax.inject.Inject
@AndroidEntryPoint @AndroidEntryPoint
@ -103,9 +104,7 @@ class MessageDetailActivity : PassphraseRequiredActionBarActivity() {
viewModel.timestamp = intent.getLongExtra(MESSAGE_TIMESTAMP, -1L) viewModel.timestamp = intent.getLongExtra(MESSAGE_TIMESTAMP, -1L)
ComposeView(this) setComposeContent { MessageDetailsScreen() }
.apply { setContent { MessageDetailsScreen() } }
.let(::setContentView)
lifecycleScope.launch { lifecycleScope.launch {
viewModel.eventFlow.collect { viewModel.eventFlow.collect {
@ -122,16 +121,14 @@ class MessageDetailActivity : PassphraseRequiredActionBarActivity() {
@Composable @Composable
private fun MessageDetailsScreen() { private fun MessageDetailsScreen() {
val state by viewModel.stateFlow.collectAsState() val state by viewModel.stateFlow.collectAsState()
SessionMaterialTheme { MessageDetails(
MessageDetails( state = state,
state = state, onReply = if (state.canReply) { { setResultAndFinish(ON_REPLY) } } else null,
onReply = if (state.canReply) { { setResultAndFinish(ON_REPLY) } } else null, onResend = state.error?.let { { setResultAndFinish(ON_RESEND) } },
onResend = state.error?.let { { setResultAndFinish(ON_RESEND) } }, onDelete = { setResultAndFinish(ON_DELETE) },
onDelete = { setResultAndFinish(ON_DELETE) }, onClickImage = { viewModel.onClickImage(it) },
onClickImage = { viewModel.onClickImage(it) }, onAttachmentNeedsDownload = viewModel::onAttachmentNeedsDownload,
onAttachmentNeedsDownload = viewModel::onAttachmentNeedsDownload, )
)
}
} }
private fun setResultAndFinish(code: Int) { private fun setResultAndFinish(code: Int) {

View File

@ -26,6 +26,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.ComposeView
import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextAlign
@ -105,6 +106,7 @@ import org.thoughtcrime.securesms.ui.base
import org.thoughtcrime.securesms.ui.components.OutlineButton import org.thoughtcrime.securesms.ui.components.OutlineButton
import org.thoughtcrime.securesms.ui.contentDescription import org.thoughtcrime.securesms.ui.contentDescription
import org.thoughtcrime.securesms.ui.h8 import org.thoughtcrime.securesms.ui.h8
import org.thoughtcrime.securesms.ui.setContentWithTheme
import org.thoughtcrime.securesms.ui.small import org.thoughtcrime.securesms.ui.small
import org.thoughtcrime.securesms.util.ConfigurationMessageUtilities import org.thoughtcrime.securesms.util.ConfigurationMessageUtilities
import org.thoughtcrime.securesms.util.IP2Country import org.thoughtcrime.securesms.util.IP2Country
@ -206,7 +208,7 @@ class HomeActivity : PassphraseRequiredActionBarActivity(),
binding.sessionToolbar.disableClipping() binding.sessionToolbar.disableClipping()
// Set up seed reminder view // Set up seed reminder view
lifecycleScope.launchWhenStarted { lifecycleScope.launchWhenStarted {
binding.seedReminderView.setContent { binding.seedReminderView.setContentWithTheme {
if (!textSecurePreferences.getHasViewedSeed()) SeedReminder() if (!textSecurePreferences.getHasViewedSeed()) SeedReminder()
} }
} }
@ -223,7 +225,9 @@ class HomeActivity : PassphraseRequiredActionBarActivity(),
} }
// Set up empty state view // Set up empty state view
binding.emptyStateContainer.setContent { EmptyView(ApplicationContext.getInstance(this).newAccount) } binding.emptyStateContainer.setContentWithTheme {
EmptyView(ApplicationContext.getInstance(this).newAccount)
}
IP2Country.configureIfNeeded(this@HomeActivity) IP2Country.configureIfNeeded(this@HomeActivity)
@ -371,93 +375,89 @@ class HomeActivity : PassphraseRequiredActionBarActivity(),
@Composable @Composable
private fun SeedReminder() { private fun SeedReminder() {
SessionMaterialTheme { Column {
Column { // Color Strip
// Color Strip Box(
Box( Modifier
Modifier .fillMaxWidth()
.fillMaxWidth() .height(4.dp)
.height(4.dp) .background(LocalColors.current.primary)
.background(MaterialTheme.colors.secondary) )
) Row(
Row( Modifier
Modifier .background(LocalColors.current.backgroundSecondary)
.background(MaterialTheme.colors.surface) .padding(
.padding( horizontal = LocalDimensions.current.marginSmall,
horizontal = LocalDimensions.current.marginSmall, vertical = LocalDimensions.current.marginExtraSmall
vertical = LocalDimensions.current.marginExtraSmall )
) ) {
) { Column(Modifier.weight(1f)) {
Column(Modifier.weight(1f)) { Row {
Row {
Text(
stringResource(R.string.save_your_recovery_password),
style = MaterialTheme.typography.h8
)
Spacer(Modifier.requiredWidth(LocalDimensions.current.itemSpacingExtraSmall))
SessionShieldIcon()
}
Text( Text(
stringResource(R.string.save_your_recovery_password_to_make_sure_you_don_t_lose_access_to_your_account), stringResource(R.string.save_your_recovery_password),
style = MaterialTheme.typography.small style = MaterialTheme.typography.h8
) )
Spacer(Modifier.requiredWidth(LocalDimensions.current.itemSpacingExtraSmall))
SessionShieldIcon()
} }
Spacer(Modifier.width(LocalDimensions.current.marginExtraExtraSmall)) Text(
OutlineButton( stringResource(R.string.save_your_recovery_password_to_make_sure_you_don_t_lose_access_to_your_account),
textId = R.string.continue_2, style = MaterialTheme.typography.small
modifier = Modifier
.align(Alignment.CenterVertically)
.contentDescription(R.string.AccessibilityId_reveal_recovery_phrase_button),
onClick = { start<RecoveryPasswordActivity>() }
) )
} }
Spacer(Modifier.width(LocalDimensions.current.marginExtraExtraSmall))
OutlineButton(
textId = R.string.continue_2,
modifier = Modifier
.align(Alignment.CenterVertically)
.contentDescription(R.string.AccessibilityId_reveal_recovery_phrase_button),
onClick = { start<RecoveryPasswordActivity>() }
)
} }
} }
} }
@Composable @Composable
private fun EmptyView(newAccount: Boolean) { private fun EmptyView(newAccount: Boolean) {
SessionMaterialTheme { Column(
Column( horizontalAlignment = Alignment.CenterHorizontally,
horizontalAlignment = Alignment.CenterHorizontally, modifier = Modifier
modifier = Modifier .padding(horizontal = 50.dp)
.padding(horizontal = 50.dp) .padding(bottom = 12.dp)
.padding(bottom = 12.dp) ) {
) { Spacer(modifier = Modifier.weight(1f))
Spacer(modifier = Modifier.weight(1f)) Icon(
Icon( painter = painterResource(id = if (newAccount) R.drawable.emoji_tada_large else R.drawable.ic_logo_large),
painter = painterResource(id = if (newAccount) R.drawable.emoji_tada_large else R.drawable.ic_logo_large), contentDescription = null,
contentDescription = null, tint = Color.Unspecified
tint = Color.Unspecified )
) if (newAccount) {
if (newAccount) {
Text(
stringResource(R.string.onboardingAccountCreated),
style = MaterialTheme.typography.h4,
textAlign = TextAlign.Center
)
Text(
stringResource(R.string.welcome_to_session),
style = MaterialTheme.typography.base,
color = LocalColors.current.primary,
textAlign = TextAlign.Center
)
}
Divider(modifier = Modifier.padding(vertical = LocalDimensions.current.marginExtraSmall))
Text( Text(
stringResource(R.string.conversationsNone), stringResource(R.string.onboardingAccountCreated),
style = MaterialTheme.typography.h8, style = MaterialTheme.typography.h4,
textAlign = TextAlign.Center, textAlign = TextAlign.Center
modifier = Modifier.padding(bottom = 12.dp)) )
Text( Text(
stringResource(R.string.onboardingHitThePlusButton), stringResource(R.string.welcome_to_session),
style = MaterialTheme.typography.small, style = MaterialTheme.typography.base,
color = LocalColors.current.primary,
textAlign = TextAlign.Center textAlign = TextAlign.Center
) )
Spacer(modifier = Modifier.weight(2f))
} }
Divider(modifier = Modifier.padding(vertical = LocalDimensions.current.marginExtraSmall))
Text(
stringResource(R.string.conversationsNone),
style = MaterialTheme.typography.h8,
textAlign = TextAlign.Center,
modifier = Modifier.padding(bottom = 12.dp))
Text(
stringResource(R.string.onboardingHitThePlusButton),
style = MaterialTheme.typography.small,
textAlign = TextAlign.Center
)
Spacer(modifier = Modifier.weight(2f))
} }
} }

View File

@ -43,6 +43,7 @@ import org.thoughtcrime.securesms.ui.components.OutlineButton
import org.thoughtcrime.securesms.ui.components.SessionOutlinedTextField import org.thoughtcrime.securesms.ui.components.SessionOutlinedTextField
import org.thoughtcrime.securesms.ui.components.SessionTabRow import org.thoughtcrime.securesms.ui.components.SessionTabRow
import org.thoughtcrime.securesms.ui.contentDescription import org.thoughtcrime.securesms.ui.contentDescription
import org.thoughtcrime.securesms.ui.setComposeContent
import org.thoughtcrime.securesms.util.start import org.thoughtcrime.securesms.util.start
import javax.inject.Inject import javax.inject.Inject
@ -75,14 +76,10 @@ class LinkDeviceActivity : BaseActionBarActivity() {
} }
} }
ComposeView(this).apply { setComposeContent {
setContent { val state by viewModel.stateFlow.collectAsState()
val state by viewModel.stateFlow.collectAsState() LoadAccountScreen(state, viewModel::onChange, viewModel::onContinue, viewModel::onScanQrCode)
SessionMaterialTheme { }
LoadAccountScreen(state, viewModel::onChange, viewModel::onContinue, viewModel::onScanQrCode)
}
}
}.let(::setContentView)
} }
@OptIn(ExperimentalFoundationApi::class) @OptIn(ExperimentalFoundationApi::class)

View File

@ -34,6 +34,7 @@ import org.thoughtcrime.securesms.ui.SessionMaterialTheme
import org.thoughtcrime.securesms.ui.base import org.thoughtcrime.securesms.ui.base
import org.thoughtcrime.securesms.ui.contentDescription import org.thoughtcrime.securesms.ui.contentDescription
import org.thoughtcrime.securesms.ui.h7 import org.thoughtcrime.securesms.ui.h7
import org.thoughtcrime.securesms.ui.setComposeContent
import org.thoughtcrime.securesms.util.setUpActionBarSessionLogo import org.thoughtcrime.securesms.util.setUpActionBarSessionLogo
import javax.inject.Inject import javax.inject.Inject
@ -71,9 +72,7 @@ class LoadingActivity: BaseActionBarActivity() {
ApplicationContext.getInstance(this).newAccount = false ApplicationContext.getInstance(this).newAccount = false
ComposeView(this) setComposeContent { LoadingScreen() }
.apply { setContent { LoadingScreen() } }
.let(::setContentView)
setUpActionBarSessionLogo(true) setUpActionBarSessionLogo(true)
@ -103,23 +102,21 @@ class LoadingActivity: BaseActionBarActivity() {
) )
} }
SessionMaterialTheme { Column(horizontalAlignment = Alignment.CenterHorizontally) {
Column(horizontalAlignment = Alignment.CenterHorizontally) { Spacer(modifier = Modifier.weight(1f))
Spacer(modifier = Modifier.weight(1f)) ProgressArc(
ProgressArc( animatable.value,
animatable.value, modifier = Modifier.contentDescription(R.string.AccessibilityId_loading_animation)
modifier = Modifier.contentDescription(R.string.AccessibilityId_loading_animation) )
) Text(
Text( stringResource(R.string.waitOneMoment),
stringResource(R.string.waitOneMoment), style = MaterialTheme.typography.h7
style = MaterialTheme.typography.h7 )
) Text(
Text( stringResource(R.string.loadAccountProgressMessage),
stringResource(R.string.loadAccountProgressMessage), style = MaterialTheme.typography.base
style = MaterialTheme.typography.base )
) Spacer(modifier = Modifier.weight(2f))
Spacer(modifier = Modifier.weight(2f))
}
} }
} }
} }

View File

@ -47,6 +47,7 @@ import org.thoughtcrime.securesms.ui.components.OutlineButton
import org.thoughtcrime.securesms.ui.contentDescription import org.thoughtcrime.securesms.ui.contentDescription
import org.thoughtcrime.securesms.ui.h8 import org.thoughtcrime.securesms.ui.h8
import org.thoughtcrime.securesms.ui.h9 import org.thoughtcrime.securesms.ui.h9
import org.thoughtcrime.securesms.ui.setComposeContent
import org.thoughtcrime.securesms.ui.small import org.thoughtcrime.securesms.ui.small
import org.thoughtcrime.securesms.util.setUpActionBarSessionLogo import org.thoughtcrime.securesms.util.setUpActionBarSessionLogo
import javax.inject.Inject import javax.inject.Inject
@ -63,18 +64,13 @@ class MessageNotificationsActivity : BaseActionBarActivity() {
setUpActionBarSessionLogo(true) setUpActionBarSessionLogo(true)
TextSecurePreferences.setHasSeenWelcomeScreen(this, true) TextSecurePreferences.setHasSeenWelcomeScreen(this, true)
ComposeView(this) setComposeContent { MessageNotificationsScreen() }
.apply { setContent { MessageNotificationsScreen() } }
.let(::setContentView)
} }
@Composable @Composable
private fun MessageNotificationsScreen() { private fun MessageNotificationsScreen() {
val state by viewModel.stateFlow.collectAsState() val state by viewModel.stateFlow.collectAsState()
MessageNotificationsScreen(state, viewModel::setEnabled, ::register)
SessionMaterialTheme {
MessageNotificationsScreen(state, viewModel::setEnabled, ::register)
}
} }
private fun register() { private fun register() {

View File

@ -49,6 +49,7 @@ import org.thoughtcrime.securesms.ui.components.SmallButtons
import org.thoughtcrime.securesms.ui.contentDescription import org.thoughtcrime.securesms.ui.contentDescription
import org.thoughtcrime.securesms.ui.extraSmallMonospace import org.thoughtcrime.securesms.ui.extraSmallMonospace
import org.thoughtcrime.securesms.ui.h8 import org.thoughtcrime.securesms.ui.h8
import org.thoughtcrime.securesms.ui.setComposeContent
class RecoveryPasswordActivity : BaseActionBarActivity() { class RecoveryPasswordActivity : BaseActionBarActivity() {
@ -58,14 +59,12 @@ class RecoveryPasswordActivity : BaseActionBarActivity() {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
supportActionBar!!.title = resources.getString(R.string.sessionRecoveryPassword) supportActionBar!!.title = resources.getString(R.string.sessionRecoveryPassword)
ComposeView(this).apply { setComposeContent {
setContent { RecoveryPasswordScreen(
RecoveryPasswordScreen( viewModel.seed,
viewModel.seed, { viewModel.copySeed(this) }
{ viewModel.copySeed(context) } ) { onHide() }
) { onHide() } }
}
}.let(::setContentView)
} }
private fun onHide() { private fun onHide() {
@ -109,18 +108,16 @@ fun RecoveryPasswordScreen(
copySeed:() -> Unit = {}, copySeed:() -> Unit = {},
onHide:() -> Unit = {} onHide:() -> Unit = {}
) { ) {
SessionMaterialTheme { Column(
Column( verticalArrangement = Arrangement.spacedBy(LocalDimensions.current.marginExtraSmall),
verticalArrangement = Arrangement.spacedBy(LocalDimensions.current.marginExtraSmall), modifier = Modifier
modifier = Modifier .contentDescription(R.string.AccessibilityId_recovery_password)
.contentDescription(R.string.AccessibilityId_recovery_password) .verticalScroll(rememberScrollState())
.verticalScroll(rememberScrollState()) .padding(bottom = LocalDimensions.current.marginExtraSmall)
.padding(bottom = LocalDimensions.current.marginExtraSmall) ) {
) { SmallButtons {
SmallButtons { RecoveryPasswordCell(seed, copySeed)
RecoveryPasswordCell(seed, copySeed) HideRecoveryPasswordCell(onHide)
HideRecoveryPasswordCell(onHide)
}
} }
} }
} }

View File

@ -82,6 +82,7 @@ import org.thoughtcrime.securesms.ui.SessionMaterialTheme
import org.thoughtcrime.securesms.ui.components.OutlineButton import org.thoughtcrime.securesms.ui.components.OutlineButton
import org.thoughtcrime.securesms.ui.components.OutlineCopyButton import org.thoughtcrime.securesms.ui.components.OutlineCopyButton
import org.thoughtcrime.securesms.ui.destructiveButtonColors import org.thoughtcrime.securesms.ui.destructiveButtonColors
import org.thoughtcrime.securesms.ui.setContentWithTheme
import org.thoughtcrime.securesms.util.BitmapDecodingException import org.thoughtcrime.securesms.util.BitmapDecodingException
import org.thoughtcrime.securesms.util.BitmapUtil import org.thoughtcrime.securesms.util.BitmapUtil
import org.thoughtcrime.securesms.util.ConfigurationMessageUtilities import org.thoughtcrime.securesms.util.ConfigurationMessageUtilities
@ -132,10 +133,8 @@ class SettingsActivity : PassphraseRequiredActionBarActivity() {
versionTextView.text = String.format(getString(R.string.version_s), "${BuildConfig.VERSION_NAME} (${BuildConfig.VERSION_CODE} - $gitCommitFirstSixChars)") versionTextView.text = String.format(getString(R.string.version_s), "${BuildConfig.VERSION_NAME} (${BuildConfig.VERSION_CODE} - $gitCommitFirstSixChars)")
} }
binding.composeView.setContent { binding.composeView.setContentWithTheme {
SessionMaterialTheme { Buttons()
Buttons()
}
} }
} }

View File

@ -95,7 +95,7 @@ val primaryYellow = Color(0xFFFAD657)
val dangerDark = Color(0xFFFF3A3A) val dangerDark = Color(0xFFFF3A3A)
val dangerLight = Color(0xFFE12D19) val dangerLight = Color(0xFFE12D19)
val disabledDark = Color(0xFFA1A2A1) val disabledDark = Color(0xFFA1A2A1)
val disabledLioht = Color(0xFF6D6D6D) val disabledLight = Color(0xFF6D6D6D)
fun sessionColors( fun sessionColors(
isLight: Boolean, isLight: Boolean,
@ -128,7 +128,7 @@ val classicLight = SessionColors(
isLight = true, isLight = true,
primary = primaryGreen, primary = primaryGreen,
danger = dangerLight, danger = dangerLight,
disabled = disabledLioht, disabled = disabledLight,
background = Color.White, background = Color.White,
backgroundSecondary = classicLight5, backgroundSecondary = classicLight5,
text = Color.Black, text = Color.Black,
@ -158,7 +158,7 @@ val oceanLight = SessionColors(
isLight = true, isLight = true,
primary = primaryBlue, primary = primaryBlue,
danger = dangerLight, danger = dangerLight,
disabled = disabledLioht, disabled = disabledLight,
background = oceanLight7, background = oceanLight7,
backgroundSecondary = oceanLight6, backgroundSecondary = oceanLight6,
text = oceanLight1, text = oceanLight1,

View File

@ -18,3 +18,9 @@ fun Fragment.onCreateView(content: @Composable () -> Unit): ComposeView = Compos
} }
} }
} }
fun ComposeView.setContentWithTheme(content: @Composable () -> Unit) = setContent {
SessionMaterialTheme {
content()
}
}