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.text.TextStyle
|
||||||
import androidx.glance.unit.ColorProvider
|
import androidx.glance.unit.ColorProvider
|
||||||
import tachiyomi.core.common.Constants
|
import tachiyomi.core.common.Constants
|
||||||
|
import tachiyomi.core.common.i18n.stringResource
|
||||||
import tachiyomi.i18n.MR
|
import tachiyomi.i18n.MR
|
||||||
import tachiyomi.presentation.core.i18n.stringResource
|
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun LockedWidget(
|
fun LockedWidget(
|
||||||
foreground: ColorProvider,
|
foreground: ColorProvider,
|
||||||
modifier: GlanceModifier = GlanceModifier,
|
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)
|
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||||
}
|
}
|
||||||
Box(
|
Box(
|
||||||
@@ -34,7 +35,7 @@ fun LockedWidget(
|
|||||||
contentAlignment = Alignment.Center,
|
contentAlignment = Alignment.Center,
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(MR.strings.appwidget_unavailable_locked),
|
text = context.stringResource(MR.strings.appwidget_unavailable_locked),
|
||||||
style = TextStyle(
|
style = TextStyle(
|
||||||
color = foreground,
|
color = foreground,
|
||||||
fontSize = 12.sp,
|
fontSize = 12.sp,
|
||||||
|
|||||||
+4
-3
@@ -22,8 +22,8 @@ import androidx.glance.text.Text
|
|||||||
import androidx.glance.text.TextStyle
|
import androidx.glance.text.TextStyle
|
||||||
import androidx.glance.unit.ColorProvider
|
import androidx.glance.unit.ColorProvider
|
||||||
import tachiyomi.core.common.Constants
|
import tachiyomi.core.common.Constants
|
||||||
|
import tachiyomi.core.common.i18n.stringResource
|
||||||
import tachiyomi.i18n.MR
|
import tachiyomi.i18n.MR
|
||||||
import tachiyomi.presentation.core.i18n.stringResource
|
|
||||||
import tachiyomi.presentation.widget.util.calculateRowAndColumnCount
|
import tachiyomi.presentation.widget.util.calculateRowAndColumnCount
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
@@ -34,6 +34,7 @@ fun UpdatesWidget(
|
|||||||
bottomPadding: Dp,
|
bottomPadding: Dp,
|
||||||
modifier: GlanceModifier = GlanceModifier,
|
modifier: GlanceModifier = GlanceModifier,
|
||||||
) {
|
) {
|
||||||
|
val context = LocalContext.current
|
||||||
Box(
|
Box(
|
||||||
contentAlignment = Alignment.Center,
|
contentAlignment = Alignment.Center,
|
||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
@@ -42,7 +43,7 @@ fun UpdatesWidget(
|
|||||||
CircularProgressIndicator(color = contentColor)
|
CircularProgressIndicator(color = contentColor)
|
||||||
} else if (data.isEmpty()) {
|
} else if (data.isEmpty()) {
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(MR.strings.information_no_recent),
|
text = context.stringResource(MR.strings.information_no_recent),
|
||||||
style = TextStyle(color = contentColor),
|
style = TextStyle(color = contentColor),
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
@@ -71,7 +72,7 @@ fun UpdatesWidget(
|
|||||||
contentAlignment = Alignment.Center,
|
contentAlignment = Alignment.Center,
|
||||||
) {
|
) {
|
||||||
val intent = Intent(
|
val intent = Intent(
|
||||||
LocalContext.current,
|
context,
|
||||||
Class.forName(Constants.MAIN_ACTIVITY),
|
Class.forName(Constants.MAIN_ACTIVITY),
|
||||||
).apply {
|
).apply {
|
||||||
action = Constants.SHORTCUT_MANGA
|
action = Constants.SHORTCUT_MANGA
|
||||||
|
|||||||
Reference in New Issue
Block a user