Skip to content

Migrate Compose Glance and Navigation snippets to GitHub - #1031

Open
hamen wants to merge 20 commits into
android:mainfrom
StellarElements:main
Open

Migrate Compose Glance and Navigation snippets to GitHub#1031
hamen wants to merge 20 commits into
android:mainfrom
StellarElements:main

Conversation

@hamen

@hamen hamen commented Aug 14, 2026

Copy link
Copy Markdown

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:

kkuan2011 and others added 16 commits August 4, 2026 20:18
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>
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
@hamen
hamen requested a review from a team as a code owner August 14, 2026 18:28
@hamen
hamen requested a review from MagicalMeghan August 14, 2026 18:28
@snippet-bot

snippet-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown

Here is the summary of changes.

You are about to add 12 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

private fun getErrorIntent(context: Context, throwable: Throwable): PendingIntent {
val intent = Intent(context, UpgradeToHelloWorldPro::class.java)
intent.action = "widgetError"
// [START_EXCLUDE]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add silent to the tag so ... doesn't show up in the visible snippet on DAC?

// [START_EXCLUDE silent]

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done ✅

@kkuan2011
kkuan2011 requested a review from alabiaga August 14, 2026 20:49

@alabiaga alabiaga left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

initial pass, will look again.

// [START android_compose_e2e_enable]
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, ".".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants