Migrate Compose Glance and Navigation snippets to GitHub - #1031
Conversation
Replaced Any? with a more reasonable List<String>. Added an example Log.e to avoid a comment. Signed-off-by: morgillo <morgillo@google.com>
…EXCLUDE section to keep up the unnecessary (on DAC) method implementation. Signed-off-by: morgillo <morgillo@google.com>
…re](https://developer.android.com/reference/kotlin/androidx/glance/appwidget/GlanceAppWidget#onCompositionError(android.content.Context,androidx.glance.GlanceId,kotlin.Int,kotlin.Throwable)). We shouldn't extract this. On the contrary, we should link out to the official reference page: ```` To use this feature, override the [onCompositionError()](https://developer.android.com/reference/kotlin/androidx/glance/appwidget/GlanceAppWidget#onCompositionError(android.content.Context,androidx.glance.GlanceId,kotlin.Int,kotlin.Throwable)) function: ```` on the DAC page. Signed-off-by: morgillo <morgillo@google.com>
Signed-off-by: morgillo <morgillo@google.com>
Signed-off-by: morgillo <morgillo@google.com>
Signed-off-by: morgillo <morgillo@google.com>
…iew-based snippets. Signed-off-by: morgillo <morgillo@google.com>
#1 (comment) Signed-off-by: morgillo <morgillo@google.com>
#1 (comment) Signed-off-by: morgillo <morgillo@google.com>
#1 (comment) Signed-off-by: morgillo <morgillo@google.com>
#1 (comment) Signed-off-by: morgillo <morgillo@google.com>
#1 (comment) Signed-off-by: morgillo <morgillo@google.com>
Signed-off-by: morgillo <morgillo@google.com>
#1 (comment) Signed-off-by: morgillo <morgillo@google.com>
…snippets katherinekuan/migrate-dac-snippets
| private fun getErrorIntent(context: Context, throwable: Throwable): PendingIntent { | ||
| val intent = Intent(context, UpgradeToHelloWorldPro::class.java) | ||
| intent.action = "widgetError" | ||
| // [START_EXCLUDE] |
There was a problem hiding this comment.
Can you add silent to the tag so ... doesn't show up in the visible snippet on DAC?
// [START_EXCLUDE silent]
android#1031 (comment) Signed-off-by: Ivan Morgillo <imorgillo@gmail.com>
alabiaga
left a comment
There was a problem hiding this comment.
initial pass, will look again.
| // [START android_compose_e2e_enable] | ||
| override fun onCreate(savedInstanceState: Bundle?) { | ||
| super.onCreate(savedInstanceState) | ||
| enableEdgeToEdge() |
There was a problem hiding this comment.
Now that we are migrating these to snippets, it is more useful as the developer can go to this file and see that enableEdgeToEdge is an extension function. The documentation needs to be modified as the enableEdgeToEdge link being referred to prior to showing the code snippet links to the method defined in WindowCompat vs the extension function defined in package androidx.activity.ComponentActivity that is being used in the snippet.
| // [START android_compose_e2e_immersive_mode] | ||
| val windowInsetsController = WindowCompat.getInsetsController(window, window.decorView) | ||
|
|
||
| // Hide the system bars. |
There was a problem hiding this comment.
nitpick and I wish others would have said that same in my changes but we should be consistent with whether we omit or end in a period for these comments.
I think we should always end with a period, ".".
Migrate Compose Glance and Navigation snippets to GitHub.
Migrate hardcoded code snippets across Compose Glance, and Edge-to-edge documentation pages to GitHub-hosted code snippets in the android/snippets repository.
Affected Pages: