mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
Alias strings R to Res (#3619)
This commit is contained in:
parent
a687328f08
commit
0833a6767e
153 changed files with 1403 additions and 1350 deletions
|
|
@ -28,8 +28,8 @@ import androidx.compose.ui.res.stringResource
|
|||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import org.meshtastic.core.strings.R
|
||||
import org.meshtastic.core.ui.component.AutoLinkText
|
||||
import org.meshtastic.core.strings.R as Res
|
||||
|
||||
@Composable
|
||||
fun AnalyticsIntro(modifier: Modifier = Modifier) {
|
||||
|
|
@ -39,17 +39,21 @@ fun AnalyticsIntro(modifier: Modifier = Modifier) {
|
|||
verticalArrangement = Arrangement.spacedBy(8.dp),
|
||||
) {
|
||||
val textModifier = Modifier.fillMaxWidth().align(Alignment.CenterHorizontally)
|
||||
Text(modifier = textModifier, textAlign = TextAlign.Center, text = stringResource(R.string.analytics_notice))
|
||||
Text(modifier = textModifier, textAlign = TextAlign.Center, text = stringResource(R.string.analytics_platforms))
|
||||
AutoLinkText(stringResource(R.string.firebase_link))
|
||||
AutoLinkText(stringResource(R.string.datadog_link))
|
||||
Text(modifier = textModifier, textAlign = TextAlign.Center, text = stringResource(Res.string.analytics_notice))
|
||||
Text(
|
||||
modifier = textModifier,
|
||||
textAlign = TextAlign.Center,
|
||||
text = stringResource(Res.string.analytics_platforms),
|
||||
)
|
||||
AutoLinkText(stringResource(Res.string.firebase_link))
|
||||
AutoLinkText(stringResource(Res.string.datadog_link))
|
||||
|
||||
Text(
|
||||
modifier = textModifier,
|
||||
textAlign = TextAlign.Center,
|
||||
text = stringResource(R.string.for_more_information_see_our_privacy_policy),
|
||||
text = stringResource(Res.string.for_more_information_see_our_privacy_policy),
|
||||
)
|
||||
AutoLinkText(text = stringResource(R.string.privacy_url))
|
||||
AutoLinkText(text = stringResource(Res.string.privacy_url))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import androidx.compose.ui.res.stringResource
|
|||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.unit.dp
|
||||
import org.meshtastic.core.strings.R
|
||||
import org.meshtastic.core.strings.R as Res
|
||||
|
||||
/**
|
||||
* Screen for explaining and guiding the user to configure critical alert settings. This screen is part of the app
|
||||
|
|
@ -50,8 +50,8 @@ internal fun CriticalAlertsScreen(onSkip: () -> Unit, onConfigure: () -> Unit) {
|
|||
IntroBottomBar(
|
||||
onSkip = onSkip,
|
||||
onConfigure = onConfigure,
|
||||
configureButtonText = stringResource(R.string.configure_critical_alerts),
|
||||
skipButtonText = stringResource(R.string.skip),
|
||||
configureButtonText = stringResource(Res.string.configure_critical_alerts),
|
||||
skipButtonText = stringResource(Res.string.skip),
|
||||
)
|
||||
},
|
||||
) { innerPadding ->
|
||||
|
|
@ -61,13 +61,13 @@ internal fun CriticalAlertsScreen(onSkip: () -> Unit, onConfigure: () -> Unit) {
|
|||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
) {
|
||||
Text(
|
||||
text = stringResource(R.string.critical_alerts),
|
||||
text = stringResource(Res.string.critical_alerts),
|
||||
style = MaterialTheme.typography.headlineLarge.copy(fontWeight = FontWeight.Bold),
|
||||
textAlign = TextAlign.Center,
|
||||
)
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
Text(
|
||||
text = stringResource(R.string.critical_alerts_dnd_request_text),
|
||||
text = stringResource(Res.string.critical_alerts_dnd_request_text),
|
||||
style = MaterialTheme.typography.bodyLarge,
|
||||
textAlign = TextAlign.Center,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import androidx.compose.material.icons.outlined.Router
|
|||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import org.meshtastic.core.strings.R
|
||||
import org.meshtastic.core.strings.R as Res
|
||||
|
||||
/**
|
||||
* Screen for configuring location permissions during the app introduction. It explains why location permissions are
|
||||
|
|
@ -42,8 +42,8 @@ internal fun LocationScreen(showNextButton: Boolean, onSkip: () -> Unit, onConfi
|
|||
val context = LocalContext.current
|
||||
val annotatedString =
|
||||
context.createClickableAnnotatedString(
|
||||
fullTextRes = R.string.phone_location_description,
|
||||
linkTextRes = R.string.settings,
|
||||
fullTextRes = Res.string.phone_location_description,
|
||||
linkTextRes = Res.string.settings,
|
||||
tag = SETTINGS_TAG,
|
||||
)
|
||||
|
||||
|
|
@ -51,34 +51,34 @@ internal fun LocationScreen(showNextButton: Boolean, onSkip: () -> Unit, onConfi
|
|||
listOf(
|
||||
FeatureUIData(
|
||||
icon = Icons.Outlined.LocationOn,
|
||||
titleRes = R.string.share_location,
|
||||
subtitleRes = R.string.share_location_description,
|
||||
titleRes = Res.string.share_location,
|
||||
subtitleRes = Res.string.share_location_description,
|
||||
),
|
||||
FeatureUIData(
|
||||
icon = Icons.Outlined.Router,
|
||||
titleRes = R.string.distance_measurements,
|
||||
subtitleRes = R.string.distance_measurements_description,
|
||||
titleRes = Res.string.distance_measurements,
|
||||
subtitleRes = Res.string.distance_measurements_description,
|
||||
),
|
||||
FeatureUIData(
|
||||
icon = Icons.Outlined.Router, // Consider a different icon if appropriate
|
||||
titleRes = R.string.distance_filters,
|
||||
subtitleRes = R.string.distance_filters_description,
|
||||
titleRes = Res.string.distance_filters,
|
||||
subtitleRes = Res.string.distance_filters_description,
|
||||
),
|
||||
FeatureUIData(
|
||||
icon = Icons.Outlined.LocationOn, // Consider a different icon if appropriate
|
||||
titleRes = R.string.mesh_map_location,
|
||||
subtitleRes = R.string.mesh_map_location_description,
|
||||
titleRes = Res.string.mesh_map_location,
|
||||
subtitleRes = Res.string.mesh_map_location_description,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
PermissionScreenLayout(
|
||||
headlineRes = R.string.phone_location,
|
||||
headlineRes = Res.string.phone_location,
|
||||
annotatedDescription = annotatedString,
|
||||
features = features,
|
||||
onSkip = onSkip,
|
||||
onConfigure = onConfigure,
|
||||
configureButtonTextRes = if (showNextButton) R.string.next else R.string.configure_location_permissions,
|
||||
configureButtonTextRes = if (showNextButton) Res.string.next else Res.string.configure_location_permissions,
|
||||
onAnnotationClick = {
|
||||
val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS)
|
||||
intent.data = Uri.fromParts("package", context.packageName, null)
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ import androidx.compose.ui.res.stringResource
|
|||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.unit.dp
|
||||
import org.meshtastic.core.strings.R
|
||||
import org.meshtastic.core.strings.R as Res
|
||||
|
||||
/**
|
||||
* Screen for configuring notification permissions during the app introduction. It explains why notification permissions
|
||||
|
|
@ -53,8 +53,8 @@ internal fun NotificationsScreen(showNextButton: Boolean, onSkip: () -> Unit, on
|
|||
val context = LocalContext.current
|
||||
val annotatedString =
|
||||
context.createClickableAnnotatedString(
|
||||
fullTextRes = R.string.notification_permissions_description,
|
||||
linkTextRes = R.string.settings,
|
||||
fullTextRes = Res.string.notification_permissions_description,
|
||||
linkTextRes = Res.string.settings,
|
||||
tag = SETTINGS_TAG,
|
||||
)
|
||||
|
||||
|
|
@ -62,41 +62,44 @@ internal fun NotificationsScreen(showNextButton: Boolean, onSkip: () -> Unit, on
|
|||
listOf(
|
||||
FeatureUIData(
|
||||
icon = Icons.Outlined.Message,
|
||||
titleRes = R.string.incoming_messages,
|
||||
subtitleRes = R.string.notifications_for_channel_and_direct_messages,
|
||||
titleRes = Res.string.incoming_messages,
|
||||
subtitleRes = Res.string.notifications_for_channel_and_direct_messages,
|
||||
),
|
||||
FeatureUIData(
|
||||
icon = Icons.Outlined.SpeakerPhone,
|
||||
titleRes = R.string.new_nodes,
|
||||
subtitleRes = R.string.notifications_for_newly_discovered_nodes,
|
||||
titleRes = Res.string.new_nodes,
|
||||
subtitleRes = Res.string.notifications_for_newly_discovered_nodes,
|
||||
),
|
||||
FeatureUIData(
|
||||
icon = Icons.Outlined.BatteryAlert,
|
||||
titleRes = R.string.low_battery,
|
||||
subtitleRes = R.string.notifications_for_low_battery_alerts,
|
||||
titleRes = Res.string.low_battery,
|
||||
subtitleRes = Res.string.notifications_for_low_battery_alerts,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
PermissionScreenLayout(
|
||||
headlineRes = R.string.app_notifications,
|
||||
headlineRes = Res.string.app_notifications,
|
||||
annotatedDescription = annotatedString,
|
||||
features = features,
|
||||
additionalContent = {
|
||||
Text(
|
||||
text = stringResource(R.string.critical_alerts),
|
||||
text = stringResource(Res.string.critical_alerts),
|
||||
style = MaterialTheme.typography.titleLarge.copy(fontWeight = FontWeight.Bold),
|
||||
textAlign = TextAlign.Center,
|
||||
)
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
FeatureRow(
|
||||
feature =
|
||||
FeatureUIData(icon = Icons.Filled.Notifications, subtitleRes = R.string.critical_alerts_description),
|
||||
FeatureUIData(
|
||||
icon = Icons.Filled.Notifications,
|
||||
subtitleRes = Res.string.critical_alerts_description,
|
||||
),
|
||||
)
|
||||
},
|
||||
onSkip = onSkip,
|
||||
onConfigure = onConfigure,
|
||||
configureButtonTextRes = if (showNextButton) R.string.next else R.string.configure_notification_permissions,
|
||||
configureButtonTextRes = if (showNextButton) Res.string.next else Res.string.configure_notification_permissions,
|
||||
onAnnotationClick = {
|
||||
val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS)
|
||||
intent.data = Uri.fromParts("package", context.packageName, null)
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ import androidx.compose.ui.text.TextLayoutResult
|
|||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.unit.dp
|
||||
import org.meshtastic.core.strings.R
|
||||
import org.meshtastic.core.strings.R as Res
|
||||
|
||||
/**
|
||||
* A generic layout for screens within the app introduction flow. It typically presents a headline, a descriptive text
|
||||
|
|
@ -93,7 +93,7 @@ internal fun PermissionScreenLayout(
|
|||
onSkip = onSkip,
|
||||
onConfigure = onConfigure,
|
||||
configureButtonText = stringResource(configureButtonTextRes),
|
||||
skipButtonText = stringResource(R.string.skip),
|
||||
skipButtonText = stringResource(Res.string.skip),
|
||||
)
|
||||
},
|
||||
) { innerPadding ->
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ import androidx.compose.ui.text.font.FontWeight
|
|||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import org.meshtastic.core.strings.R
|
||||
import org.meshtastic.core.strings.R as Res
|
||||
|
||||
/**
|
||||
* The initial welcome screen for the app introduction flow. It displays a brief overview of the app's key features.
|
||||
|
|
@ -53,18 +53,18 @@ internal fun WelcomeScreen(onGetStarted: () -> Unit) {
|
|||
listOf(
|
||||
FeatureUIData(
|
||||
icon = Icons.Outlined.SettingsInputAntenna,
|
||||
titleRes = R.string.stay_connected_anywhere,
|
||||
subtitleRes = R.string.communicate_off_the_grid,
|
||||
titleRes = Res.string.stay_connected_anywhere,
|
||||
subtitleRes = Res.string.communicate_off_the_grid,
|
||||
),
|
||||
FeatureUIData(
|
||||
icon = Icons.Outlined.Hub,
|
||||
titleRes = R.string.create_your_own_networks,
|
||||
subtitleRes = R.string.easily_set_up_private_mesh_networks,
|
||||
titleRes = Res.string.create_your_own_networks,
|
||||
subtitleRes = Res.string.easily_set_up_private_mesh_networks,
|
||||
),
|
||||
FeatureUIData(
|
||||
icon = Icons.Outlined.NearMe,
|
||||
titleRes = R.string.track_and_share_locations,
|
||||
subtitleRes = R.string.share_your_location_in_real_time,
|
||||
titleRes = Res.string.track_and_share_locations,
|
||||
subtitleRes = Res.string.share_your_location_in_real_time,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
|
@ -75,7 +75,7 @@ internal fun WelcomeScreen(onGetStarted: () -> Unit) {
|
|||
onSkip = {}, // No skip on welcome
|
||||
onConfigure = onGetStarted,
|
||||
skipButtonText = "", // Not shown
|
||||
configureButtonText = stringResource(R.string.get_started),
|
||||
configureButtonText = stringResource(Res.string.get_started),
|
||||
showSkipButton = false, // Explicitly hide skip for welcome
|
||||
)
|
||||
},
|
||||
|
|
@ -86,12 +86,12 @@ internal fun WelcomeScreen(onGetStarted: () -> Unit) {
|
|||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
) {
|
||||
Text(
|
||||
text = stringResource(R.string.intro_welcome),
|
||||
text = stringResource(Res.string.intro_welcome),
|
||||
style = MaterialTheme.typography.titleLarge.copy(fontWeight = FontWeight.Bold),
|
||||
textAlign = TextAlign.Center,
|
||||
)
|
||||
Text(
|
||||
text = stringResource(R.string.meshtastic),
|
||||
text = stringResource(Res.string.meshtastic),
|
||||
style = MaterialTheme.typography.headlineLarge.copy(fontWeight = FontWeight.Bold),
|
||||
textAlign = TextAlign.Center,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue