This file contains hidden or 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
| class ListWidget : GlanceAppWidget() { | |
| private val items = listOf("an item", "another item", /* more items */) | |
| @Composable | |
| override fun Content() { | |
| LazyColumn( | |
| modifier = GlanceModifier.padding(8.dp) | |
| ) { | |
| items(items) { item -> |
This file contains hidden or 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
| class ErrorUIWidget : GlanceAppWidget(errorUiLayout = R.layout.layout_widget_custom_error) { | |
| // Normal widget implementation | |
| } |
This file contains hidden or 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
| class ActionWidget : GlanceAppWidget() { | |
| @Composable | |
| override fun Content() { | |
| Button( | |
| text = "Start an activity", | |
| onClick = actionStartActivity<DummyActivity>( | |
| parameters = actionParametersOf( | |
| actionWidgetKey to "activity" | |
| ) |
This file contains hidden or 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
| class ActionWidget : GlanceAppWidget() { | |
| @Composable | |
| override fun Content() { | |
| Button( | |
| text = "Log on a click event", | |
| onClick = actionRunCallback<LogActionCallback>( | |
| parameters = actionParametersOf( | |
| actionWidgetKey to "log event" | |
| ) |
This file contains hidden or 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
| <?xml version="1.0" encoding="utf-8"?> | |
| <manifest...> | |
| <application...> | |
| <receiver | |
| android:name=".HelloWorldWidgetReceiver"> | |
| <intent-filter> | |
| <action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> | |
| </intent-filter> |
This file contains hidden or 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
| class HelloWorldWidgetReceiver : GlanceAppWidgetReceiver() { | |
| override val glanceAppWidget: GlanceAppWidget = HelloWorldWidget() | |
| } |
This file contains hidden or 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
| class HelloWorldWidget : GlanceAppWidget() { | |
| @Composable | |
| override fun Content() { | |
| Text(text = "Hello world!") | |
| } | |
| } |
This file contains hidden or 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
| CameraView | CameraController | |
|---|---|---|
| takePicture(Executor, OnImageCapturedCallback) | takePicture(Executor, OnImageCapturedCallback) | |
| takePicture(OutputFileOptions, Executor, OnImageSavedCallback) | takePicture(OutputFileOptions, Executor, OnImageSavedCallback) |
This file contains hidden or 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
| CameraView | CameraController | |
|---|---|---|
| - | setImageAnalysisAnalyzer(Executor, Analyzer) | |
| - | clearImageAnalysisAnalyzer() | |
| - | getImageAnalysisBackpressureStrategy() | |
| - | setImageAnalysisBackpressureStrategy(int) | |
| - | getImageAnalysisImageQueueDepth() | |
| - | setImageAnalysisImageQueueDepth(int) |
This file contains hidden or 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
| CameraView | CameraController | |
|---|---|---|
| getPreviewStreamState() | Call directly on associated PreviewView | |
| getScaleType() | Call directly on associated PreviewView | |
| setScaleType(ScaleType) | Call directly on associated PreviewView |