mirror of
https://github.com/mihonapp/mihon.git
synced 2026-10-16 13:48:09 -07:00
Show the updates widget's empty and locked text
This commit is contained in:
+4
-3
@@ -16,15 +16,16 @@ import androidx.glance.text.TextAlign
|
||||
import androidx.glance.text.TextStyle
|
||||
import androidx.glance.unit.ColorProvider
|
||||
import tachiyomi.core.common.Constants
|
||||
import tachiyomi.core.common.i18n.stringResource
|
||||
import tachiyomi.i18n.MR
|
||||
import tachiyomi.presentation.core.i18n.stringResource
|
||||
|
||||
@Composable
|
||||
fun LockedWidget(
|
||||
foreground: ColorProvider,
|
||||
modifier: GlanceModifier = GlanceModifier,
|
||||
) {
|
||||
val intent = Intent(LocalContext.current, Class.forName(Constants.MAIN_ACTIVITY)).apply {
|
||||
val context = LocalContext.current
|
||||
val intent = Intent(context, Class.forName(Constants.MAIN_ACTIVITY)).apply {
|
||||
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
}
|
||||
Box(
|
||||
@@ -34,7 +35,7 @@ fun LockedWidget(
|
||||
contentAlignment = Alignment.Center,
|
||||
) {
|
||||
Text(
|
||||
text = stringResource(MR.strings.appwidget_unavailable_locked),
|
||||
text = context.stringResource(MR.strings.appwidget_unavailable_locked),
|
||||
style = TextStyle(
|
||||
color = foreground,
|
||||
fontSize = 12.sp,
|
||||
|
||||
+4
-3
@@ -22,8 +22,8 @@ import androidx.glance.text.Text
|
||||
import androidx.glance.text.TextStyle
|
||||
import androidx.glance.unit.ColorProvider
|
||||
import tachiyomi.core.common.Constants
|
||||
import tachiyomi.core.common.i18n.stringResource
|
||||
import tachiyomi.i18n.MR
|
||||
import tachiyomi.presentation.core.i18n.stringResource
|
||||
import tachiyomi.presentation.widget.util.calculateRowAndColumnCount
|
||||
|
||||
@Composable
|
||||
@@ -34,6 +34,7 @@ fun UpdatesWidget(
|
||||
bottomPadding: Dp,
|
||||
modifier: GlanceModifier = GlanceModifier,
|
||||
) {
|
||||
val context = LocalContext.current
|
||||
Box(
|
||||
contentAlignment = Alignment.Center,
|
||||
modifier = modifier,
|
||||
@@ -42,7 +43,7 @@ fun UpdatesWidget(
|
||||
CircularProgressIndicator(color = contentColor)
|
||||
} else if (data.isEmpty()) {
|
||||
Text(
|
||||
text = stringResource(MR.strings.information_no_recent),
|
||||
text = context.stringResource(MR.strings.information_no_recent),
|
||||
style = TextStyle(color = contentColor),
|
||||
)
|
||||
} else {
|
||||
@@ -71,7 +72,7 @@ fun UpdatesWidget(
|
||||
contentAlignment = Alignment.Center,
|
||||
) {
|
||||
val intent = Intent(
|
||||
LocalContext.current,
|
||||
context,
|
||||
Class.forName(Constants.MAIN_ACTIVITY),
|
||||
).apply {
|
||||
action = Constants.SHORTCUT_MANGA
|
||||
|
||||
Reference in New Issue
Block a user