move strings in core/ui module

disable generating android resources everywhere except core/ui module
replace UiR with R
This commit is contained in:
2025-08-27 04:53:46 +03:00
parent 799ed820e3
commit 4677e484d9
37 changed files with 359 additions and 348 deletions
@@ -58,7 +58,7 @@ import dev.meloda.fast.ui.components.ActionInvokeDismiss
import dev.meloda.fast.ui.components.MaterialDialog
import dev.meloda.fast.ui.components.TextFieldErrorText
import org.koin.androidx.compose.koinViewModel
import dev.meloda.fast.ui.R as UiR
import dev.meloda.fast.ui.R
@Composable
fun CaptchaRoute(
@@ -116,11 +116,11 @@ fun CaptchaScreen(
if (showExitAlert) {
MaterialDialog(
onDismissRequest = { showExitAlert = false },
title = stringResource(id = UiR.string.warning_confirmation),
text = stringResource(id = UiR.string.captcha_exit_warning),
title = stringResource(id = R.string.warning_confirmation),
text = stringResource(id = R.string.captcha_exit_warning),
confirmAction = { confirmedExit = true },
confirmText = stringResource(id = UiR.string.yes),
cancelText = stringResource(id = UiR.string.no),
confirmText = stringResource(id = R.string.yes),
cancelText = stringResource(id = R.string.no),
actionInvokeDismiss = ActionInvokeDismiss.Always
)
}
@@ -187,7 +187,7 @@ fun CaptchaScreen(
if (LocalView.current.isInEditMode) {
Image(
painter = painterResource(id = UiR.drawable.test_captcha),
painter = painterResource(id = R.drawable.test_captcha),
contentDescription = "Captcha image",
modifier = imageModifier
)
@@ -219,7 +219,7 @@ fun CaptchaScreen(
.clip(RoundedCornerShape(10.dp)),
leadingIcon = {
Icon(
painter = painterResource(id = UiR.drawable.round_qr_code_24),
painter = painterResource(id = R.drawable.round_qr_code_24),
contentDescription = "QR code icon",
tint = if (showError) {
MaterialTheme.colorScheme.error
@@ -69,7 +69,7 @@ import dev.meloda.fast.ui.theme.LocalSizeConfig
import dev.meloda.fast.ui.util.handleEnterKey
import dev.meloda.fast.ui.util.handleTabKey
import org.koin.androidx.compose.koinViewModel
import dev.meloda.fast.ui.R as UiR
import dev.meloda.fast.ui.R
@Composable
fun LoginRoute(
@@ -210,7 +210,7 @@ fun LoginScreen(
.align(Alignment.Center)
) {
Text(
text = stringResource(id = UiR.string.sign_in_to_vk),
text = stringResource(id = R.string.sign_in_to_vk),
color = MaterialTheme.colorScheme.onBackground,
style = MaterialTheme.typography.displayMedium
)
@@ -236,11 +236,11 @@ fun LoginScreen(
},
value = screenState.login,
onValueChange = onLoginInputChanged,
label = { Text(text = stringResource(id = UiR.string.login_hint)) },
placeholder = { Text(text = stringResource(id = UiR.string.login_hint)) },
label = { Text(text = stringResource(id = R.string.login_hint)) },
placeholder = { Text(text = stringResource(id = R.string.login_hint)) },
leadingIcon = {
Icon(
painter = painterResource(id = UiR.drawable.ic_round_person_24),
painter = painterResource(id = R.drawable.ic_round_person_24),
contentDescription = "Login icon",
tint = if (screenState.loginError) {
MaterialTheme.colorScheme.error
@@ -261,7 +261,7 @@ fun LoginScreen(
visible = screenState.loginError,
label = "Login error visibility"
) {
TextFieldErrorText(text = stringResource(id = UiR.string.error_empty_field))
TextFieldErrorText(text = stringResource(id = R.string.error_empty_field))
}
Spacer(modifier = Modifier.height(16.dp))
@@ -280,11 +280,11 @@ fun LoginScreen(
.semantics { contentType = ContentType.Password },
value = screenState.password,
onValueChange = onPasswordInputChanged,
label = { Text(text = stringResource(id = UiR.string.password_login_hint)) },
placeholder = { Text(text = stringResource(id = UiR.string.password_login_hint)) },
label = { Text(text = stringResource(id = R.string.password_login_hint)) },
placeholder = { Text(text = stringResource(id = R.string.password_login_hint)) },
leadingIcon = {
Icon(
painter = painterResource(id = UiR.drawable.round_vpn_key_24),
painter = painterResource(id = R.drawable.round_vpn_key_24),
contentDescription = "Password icon",
tint = if (screenState.passwordError) {
MaterialTheme.colorScheme.error
@@ -295,8 +295,8 @@ fun LoginScreen(
},
trailingIcon = {
val imagePainter = painterResource(
id = if (screenState.passwordVisible) UiR.drawable.round_visibility_off_24
else UiR.drawable.round_visibility_24
id = if (screenState.passwordVisible) R.drawable.round_visibility_off_24
else R.drawable.round_visibility_24
)
IconButton(onClick = onPasswordVisibilityButtonClicked) {
@@ -329,7 +329,7 @@ fun LoginScreen(
visible = screenState.passwordError,
label = "Password error visibility"
) {
TextFieldErrorText(text = stringResource(id = UiR.string.error_empty_field))
TextFieldErrorText(text = stringResource(id = R.string.error_empty_field))
}
}
}
@@ -364,7 +364,7 @@ fun LoginScreen(
label = "Sign in icon visibility"
) {
Icon(
painter = painterResource(id = UiR.drawable.ic_arrow_end),
painter = painterResource(id = R.drawable.ic_arrow_end),
contentDescription = "Sign in icon",
tint = MaterialTheme.colorScheme.onSecondaryContainer
)
@@ -397,7 +397,7 @@ fun LoginScreen(
)
}
) {
Text(stringResource(UiR.string.login_sign_up))
Text(stringResource(R.string.login_sign_up))
}
Text(
@@ -412,7 +412,7 @@ fun LoginScreen(
)
}
) {
Text(stringResource(UiR.string.login_forgot_password))
Text(stringResource(R.string.login_forgot_password))
}
}
}
@@ -433,11 +433,11 @@ fun HandleDialogs(
is LoginDialog.Error -> {
MaterialDialog(
onDismissRequest = { onDismissed(loginDialog) },
title = stringResource(UiR.string.title_error),
title = stringResource(R.string.title_error),
text = loginDialog.errorTextResId?.let { stringResource(it) }
?: loginDialog.errorText
?: stringResource(UiR.string.unknown_error_occurred),
confirmText = stringResource(id = UiR.string.ok)
?: stringResource(R.string.unknown_error_occurred),
confirmText = stringResource(id = R.string.ok)
)
}
}
@@ -24,7 +24,7 @@ import androidx.compose.ui.text.withStyle
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import dev.meloda.fast.auth.userbanned.model.UserBannedScreenState
import dev.meloda.fast.ui.R as UiR
import dev.meloda.fast.ui.R
@Preview
@Composable
@@ -74,7 +74,7 @@ fun UserBannedScreen(
}
},
title = {
Text(text = stringResource(id = UiR.string.warning))
Text(text = stringResource(id = R.string.warning))
}
)
}
@@ -86,7 +86,7 @@ fun UserBannedScreen(
.padding(vertical = 8.dp)
) {
Text(
text = stringResource(id = UiR.string.account_temporarily_blocked),
text = stringResource(id = R.string.account_temporarily_blocked),
style = MaterialTheme.typography.titleLarge,
)
@@ -94,7 +94,7 @@ fun UserBannedScreen(
Text(
text = buildAnnotatedString {
withStyle(SpanStyle(fontWeight = FontWeight.Medium)) {
append(stringResource(id = UiR.string.user_name))
append(stringResource(id = R.string.user_name))
append(": ")
}
@@ -104,7 +104,7 @@ fun UserBannedScreen(
Text(
text = buildAnnotatedString {
withStyle(SpanStyle(fontWeight = FontWeight.Medium)) {
append(stringResource(id = UiR.string.blocking_reason_title))
append(stringResource(id = R.string.blocking_reason_title))
append(": ")
}
append(screenState.message)
@@ -60,7 +60,7 @@ import dev.meloda.fast.ui.components.ActionInvokeDismiss
import dev.meloda.fast.ui.components.MaterialDialog
import dev.meloda.fast.ui.components.TextFieldErrorText
import org.koin.androidx.compose.koinViewModel
import dev.meloda.fast.ui.R as UiR
import dev.meloda.fast.ui.R
@Composable
fun ValidationRoute(
@@ -142,11 +142,11 @@ fun ValidationScreen(
if (showExitAlert) {
MaterialDialog(
onDismissRequest = { showExitAlert = false },
title = stringResource(id = UiR.string.warning_confirmation),
text = stringResource(id = UiR.string.validation_exit_warning),
title = stringResource(id = R.string.warning_confirmation),
text = stringResource(id = R.string.validation_exit_warning),
confirmAction = { confirmedExit = true },
confirmText = stringResource(id = UiR.string.yes),
cancelText = stringResource(id = UiR.string.no),
confirmText = stringResource(id = R.string.yes),
cancelText = stringResource(id = R.string.no),
actionInvokeDismiss = ActionInvokeDismiss.Always
)
}
@@ -223,7 +223,7 @@ fun ValidationScreen(
.semantics { contentType = ContentType.SmsOtpCode },
leadingIcon = {
Icon(
painter = painterResource(id = UiR.drawable.round_qr_code_24),
painter = painterResource(id = R.drawable.round_qr_code_24),
contentDescription = "QR Code icon",
tint = if (screenState.codeError) {
MaterialTheme.colorScheme.error
@@ -271,7 +271,7 @@ fun ValidationScreen(
},
icon = {
Icon(
painter = painterResource(id = UiR.drawable.round_sms_24),
painter = painterResource(id = R.drawable.round_sms_24),
tint = MaterialTheme.colorScheme.onPrimary,
contentDescription = "SMS icon"
)