-
-
Save kasem-sm/1bda51d4830dd6f5b1e9442aba5050ec to your computer and use it in GitHub Desktop.
When Jetpack's Glance met his fellow worker, Work Manager
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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