mirror of
https://github.com/Docile-Alligator/Infinity-For-Reddit.git
synced 2026-08-18 11:03:26 +00:00
Continue implementing reminders.
This commit is contained in:
@ -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
|
||||
|
||||
@ -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(
|
||||
|
||||
@ -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
|
||||
)
|
||||
}
|
||||
@ -1669,7 +1669,12 @@
|
||||
<string name="reminder_time_must_be_in_future">The reminder time must be in the future.</string>
|
||||
<string name="invalid_reminder_post_id">Invalid post id</string>
|
||||
<string name="note">Note:</string>
|
||||
<string name="reminder_reliability_notice">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.</string>
|
||||
<string name="reminder_reliability_notice_app_update_force_stop_title">"App Updates \u0026 Force Stops: "</string>
|
||||
<string name="reminder_reliability_notice_app_update_force_stop_description">If you force-close the app or it updates, reminders will pause. Simply open the app once to reactivate them.</string>
|
||||
<string name="reminder_reliability_notice_battery_title">"Battery \u0026 Timing: "</string>
|
||||
<string name="reminder_reliability_notice_battery_description">To save battery, your phone may slightly delay reminders rather than triggering them at the exact time.</string>
|
||||
<string name="reminder_reliability_notice_device_settings_title">"Device Settings: "</string>
|
||||
<string name="reminder_reliability_notice_device_settings_description">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.</string>
|
||||
<string name="reminder_set">Reminder set</string>
|
||||
<string name="reminder">Reminder</string>
|
||||
|
||||
|
||||
@ -23,7 +23,6 @@
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="android:backgroundDimEnabled">false</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.NoActionBarWithTransparentStatusBar" parent="AppTheme.NoActionBar">
|
||||
|
||||
Reference in New Issue
Block a user