Skip to content

Instantly share code, notes, and snippets.

@kasem-sm
Last active May 30, 2022
Embed
What would you like to do?
When Jetpack's Glance met his fellow worker, Work Manager
import androidx.glance.GlanceModifier
import androidx.glance.appwidget.GlanceAppWidget
import androidx.glance.layout.Column
class MyWidget() : GlanceAppWidget() {
@Composable
override fun Content() {
Column(
modifier = GlanceModifier
.fillMaxSize()
.background(R.color.widget_background_color),
) {
Text(
text = "Daily Read", // Header
style = TextStyle(
color = ColorProvider(R.color.widget_text_color),
fontSize = 22.sp,
fontWeight = FontWeight.Bold
)
)
Text(
text = "Article Title goes here...",
style = TextStyle(
color = ColorProvider(R.color.widget_text_color),
fontSize = 16.sp,
fontWeight = FontWeight.Normal
)
)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment