Skip to content

Instantly share code, notes, and snippets.

@Astroa7m
Last active June 29, 2022 17:35
Show Gist options
  • Save Astroa7m/c385c0343763f6a032092396e44e7793 to your computer and use it in GitHub Desktop.
Save Astroa7m/c385c0343763f6a032092396e44e7793 to your computer and use it in GitHub Desktop.
RemoteWidget
import androidx.compose.runtime.Composable
import androidx.glance.GlanceModifier
import androidx.glance.Image
import androidx.glance.ImageProvider
import androidx.glance.appwidget.GlanceAppWidget
import androidx.glance.layout.ContentScale
import androidx.glance.layout.fillMaxSize
import com.example.remotewidget.R
class RemoteWidget : GlanceAppWidget() {
@Composable
override fun Content() {
Image(
provider = ImageProvider(R.drawable.ic_launcher_foreground),
contentDescription = null,
modifier = GlanceModifier.fillMaxSize(),
contentScale = ContentScale.Crop
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment