This commit is contained in:
Andrew 2024-04-10 12:21:23 +09:30
parent eb958bac4e
commit 1f04a0f0ff
3 changed files with 11 additions and 14 deletions

View File

@ -119,7 +119,7 @@ private fun NewMessage(
val pagerState = rememberPagerState { TITLES.size }
Column(modifier = Modifier.background(MaterialTheme.colors.background)) {
AppBar("New Message", onClose = { onClose() }, onBack = { onBack() })
AppBar(stringResource(R.string.messageNew), onClose = { onClose() }, onBack = { onBack() })
SessionTabRow(pagerState, TITLES)
HorizontalPager(pagerState) {
when (TITLES[it]) {
@ -144,12 +144,12 @@ fun EnterAccountId(
SessionOutlinedTextField(
text = state.newMessageIdOrOns,
modifier = Modifier.padding(horizontal = 64.dp),
placeholder = "Enter account ID or ONS",
placeholder = stringResource(R.string.accountIdOrOnsEnter),
onChange = callbacks::onChange,
onContinue = callbacks::onContinue,
error = state.error?.string()
)
BorderlessButtonSecondary(text = "Start a new conversation by entering your friend's Account ID, ONS or scanning their QR code.") { onHelp() }
BorderlessButtonSecondary(text = stringResource(R.string.messageNewDescription)) { onHelp() }
Spacer(modifier = Modifier.weight(1f))
OutlineButton(

View File

@ -25,17 +25,12 @@ import androidx.compose.material.Icon
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.graphics.ImageBitmap
import androidx.compose.ui.graphics.asImageBitmap
import androidx.compose.ui.platform.ComposeView
import androidx.compose.ui.res.painterResource
@ -44,16 +39,12 @@ import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.tooling.preview.PreviewParameter
import androidx.compose.ui.unit.dp
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import network.loki.messenger.R
import org.thoughtcrime.securesms.BaseActionBarActivity
import org.thoughtcrime.securesms.showSessionDialog
import org.thoughtcrime.securesms.ui.AppTheme
import org.thoughtcrime.securesms.ui.CellWithPaddingAndMargin
import org.thoughtcrime.securesms.ui.GetString
import org.thoughtcrime.securesms.ui.LaunchedEffectAsync
import org.thoughtcrime.securesms.ui.LocalExtraColors
import org.thoughtcrime.securesms.ui.OutlineButton
import org.thoughtcrime.securesms.ui.PreviewTheme
@ -64,7 +55,6 @@ import org.thoughtcrime.securesms.ui.colorDestructive
import org.thoughtcrime.securesms.ui.contentDescription
import org.thoughtcrime.securesms.ui.h8
import org.thoughtcrime.securesms.ui.small
import kotlin.time.Duration.Companion.seconds
class RecoveryPasswordActivity : BaseActionBarActivity() {
@ -76,7 +66,11 @@ class RecoveryPasswordActivity : BaseActionBarActivity() {
ComposeView(this).apply {
setContent {
RecoveryPassword(viewModel.seed, viewModel.qrBitmap, { viewModel.copySeed(context) }) { onHide() }
RecoveryPassword(
viewModel.seed,
viewModel.qrBitmap,
{ viewModel.copySeed(context) }
) { onHide() }
}
}.let(::setContentView)
}

View File

@ -1117,4 +1117,7 @@
<string name="AccessibilityId_confirm_button">Confirm button</string>
<string name="accountIdErrorInvalid">This Account ID is invalid. Please check and try again.</string>
<string name="enter_account_id">Enter Account ID</string>
<string name="accountIdOrOnsEnter">Enter account ID or ONS</string>
<string name="messageNewDescription">Start a new conversation by entering your friend\'s Account ID, ONS or scanning their QR code.</string>
<string name="messageNew">New Message</string>
</resources>