diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/OnboardingActivity.kt b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/OnboardingActivity.kt index c33f19dc..d91747a8 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/OnboardingActivity.kt +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/OnboardingActivity.kt @@ -256,7 +256,7 @@ class OnboardingActivity: BaseActivity() { Text( text = buildAnnotatedString { - append(getString(R.string.by_continuing_1)) + append(stringResource(R.string.by_continuing_1)) withLink( LinkAnnotation.Url( @@ -264,10 +264,10 @@ class OnboardingActivity: BaseActivity() { TextLinkStyles(style = SpanStyle(color = Color(LocalAppTheme.current.linkColor))) ) ) { - append(getString(R.string.privacy_policy)) + append(stringResource(R.string.privacy_policy)) } - append(getString(R.string.by_continuing_2)) + append(stringResource(R.string.by_continuing_2)) withLink( LinkAnnotation.Url( @@ -275,10 +275,10 @@ class OnboardingActivity: BaseActivity() { TextLinkStyles(style = SpanStyle(color = Color(LocalAppTheme.current.linkColor))) ) ) { - append(getString(R.string.reddit_user_agreement)) + append(stringResource(R.string.reddit_user_agreement)) } - append(getString(R.string.by_continuing_3)) + append(stringResource(R.string.by_continuing_3)) }, fontFamily = LocalTypography.current.fontFamily, fontSize = 12.sp diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SetReminderActivity.kt b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SetReminderActivity.kt index 834666a8..99fd0a88 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SetReminderActivity.kt +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SetReminderActivity.kt @@ -49,9 +49,13 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource import androidx.compose.ui.res.vectorResource +import androidx.compose.ui.text.SpanStyle +import androidx.compose.ui.text.buildAnnotatedString import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.text.withStyle import androidx.compose.ui.unit.dp import androidx.core.view.WindowInsetsControllerCompat import androidx.lifecycle.ViewModelProvider @@ -410,11 +414,57 @@ class SetReminderActivity: BaseActivity() { ) SecondaryText( - R.string.reminder_reliability_notice, + text = buildAnnotatedString { + withStyle( + SpanStyle( + color = Color(LocalAppTheme.current.primaryTextColor), + fontWeight = FontWeight.Bold + ) + ) { + append(stringResource(R.string.reminder_reliability_notice_app_update_force_stop_title)) + } + + append(stringResource(R.string.reminder_reliability_notice_app_update_force_stop_description)) + }, modifier = Modifier .padding(horizontal = 16.dp), textAlign = TextAlign.Justify ) + SecondaryText( + text = buildAnnotatedString { + withStyle( + SpanStyle( + color = Color(LocalAppTheme.current.primaryTextColor), + fontWeight = FontWeight.Bold + ) + ) { + append(stringResource(R.string.reminder_reliability_notice_battery_title)) + } + + append(stringResource(R.string.reminder_reliability_notice_battery_description)) + }, + modifier = Modifier + .padding(horizontal = 16.dp), + textAlign = TextAlign.Justify + ) + SecondaryText( + text = buildAnnotatedString { + withStyle( + SpanStyle( + color = Color(LocalAppTheme.current.primaryTextColor), + fontWeight = FontWeight.Bold + ) + ) { + append(stringResource(R.string.reminder_reliability_notice_device_settings_title)) + } + + append(stringResource(R.string.reminder_reliability_notice_device_settings_description)) + }, + modifier = Modifier + .padding(horizontal = 16.dp) + .padding(bottom = 16.dp), + textAlign = TextAlign.Justify + ) if (showDatePicker) { DatePickerDialog( diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/customviews/compose/CustomText.kt b/app/src/main/java/ml/docilealligator/infinityforreddit/customviews/compose/CustomText.kt index 215ef70c..9a184218 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/customviews/compose/CustomText.kt +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/customviews/compose/CustomText.kt @@ -1,8 +1,7 @@ package ml.docilealligator.infinityforreddit.customviews.compose -import android.R.attr.lineHeight -import androidx.compose.foundation.layout.padding import androidx.compose.material3.LocalTextStyle +import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier @@ -11,9 +10,10 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.AnnotatedString import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.style.Hyphens +import androidx.compose.ui.text.style.LineBreak import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.TextUnit -import androidx.compose.ui.unit.dp @Composable fun PrimaryText( @@ -108,6 +108,15 @@ fun SecondaryText( color = Color(LocalAppTheme.current.secondaryTextColor), fontFamily = fontFamily, fontSize = fontSize, - textAlign = textAlign + textAlign = textAlign, + style = if (textAlign == TextAlign.Justify) LocalTextStyle.current.copy( + hyphens = Hyphens.Auto, + lineBreak = LineBreak.Paragraph.copy( + strategy = LineBreak.Strategy.HighQuality, + strictness = LineBreak.Strictness.Strict, + wordBreak = LineBreak.WordBreak.Phrase, + ), + letterSpacing = TextUnit.Unspecified + ) else LocalTextStyle.current ) } \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 16ad89e3..f05f5852 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1669,7 +1669,12 @@ The reminder time must be in the future. Invalid post id Note: - Reminders may not be delivered if you force stop the app or if the app is updated and not opened afterward. Simply opening the app again will restore reminder functionality. + "App Updates \u0026 Force Stops: " + If you force-close the app or it updates, reminders will pause. Simply open the app once to reactivate them. + "Battery \u0026 Timing: " + To save battery, your phone may slightly delay reminders rather than triggering them at the exact time. + "Device Settings: " + Some phones (like Xiaomi, Oppo, or Vivo) require you to turn on "Auto-start" or "Background App Launch" in your phone\'s system settings. Otherwise, reminders will stop working if your phone restarts. Reminder set Reminder diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index fe3625a5..5effc9a2 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -23,7 +23,6 @@ @android:color/transparent @null true - false