Repository navigation
Migrate App resources snippets - #1157
Open
djubinville wants to merge 1 commit into
Open
djubinville wants to merge 1 commit into
djubinville wants to merge 1 commit into
Conversation
djubinville
force-pushed
the
djubinville/app-resources-snippets
branch
4 times, most recently
from
October 15, 2026 18:16
e32a62b to
7c0ac0b
Compare
djubinville
marked this pull request as ready for review
October 15, 2026 18:20
djubinville
force-pushed
the
djubinville/app-resources-snippets
branch
from
October 15, 2026 18:55
7c0ac0b to
f0efb63
Compare
Contributor
Author
|
Addressed review feedback across commit
|
djubinville
force-pushed
the
djubinville/app-resources-snippets
branch
from
October 16, 2026 15:40
f0efb63 to
ba9369d
Compare
djubinville
force-pushed
the
djubinville/app-resources-snippets
branch
from
October 16, 2026 20:33
ba9369d to
e16dfd7
Compare
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Code snippets are for:
compose/snippets/src/main/res/animator/property_animator.xml(android_resources_animation_property_animator) is a migrated XML snippet, andcompose/snippets/src/main/res/values/strings.xmlcontains supporting resource declarations (R.bool.screen_small,R.integer.max_speed,R.array.bits,R.array.icons, andR.array.colors) alongsidecolors.xml(R.color.opaque_red) anddimens.xml(R.dimen.font_size) because the tagged Kotlin snippets inMoreResources.ktreference those resource IDs and will not build without them. Existing repository resourcesR.string.hello_world(inProvidingResources.kt) andR.drawable.cupcake(reused in place ofR.drawable.myimageinDrawableResources.ktand in<array name="icons">instrings.xmlin place ofhome/settings/logout) are reused to avoid adding duplicate assets or colliding string keys.List of modifications:
ProvidingResources.ktand added a terminal period to the inline comment.RuntimeChanges.kt.Internationalization.kt.AnimatorInflatersnippet intoAnimationResources.kt, added an explicitas AnimatorSetcast soAnimatorInflater.loadAnimatorcompiles withAnimatorSet, and extracted theres/animator/property_animator.xmlXML snippet (android_resources_animation_property_animator), addingxmlns:android="http://schemas.android.com/apk/res/android"on the root<set>element soaapt2compiles the resource.ResourcesCompat.getDrawablesnippet intoDrawableResources.kt, reusing existing drawable assetR.drawable.cupcakein place ofR.drawable.myimage.MoreResources.kt, updated the deprecated one-argumentresources.getColor(R.color.opaque_red)overload toresources.getColor(R.color.opaque_red, null)(D2modernization; prose does not specify the overload), and madeval drawable: Drawable? = icons.getDrawable(0)nullable to match the SDK return type.Snippets not migrated:
<resources>XML syntax/example blocks on a reference-doc-like page left hardcoded on the guide page.AndroidManifest.xml<activity>configuration blocks.ImageView/findViewByIdView-based snippets, and XML animation syntax/example blocks on a reference-doc-like page left hardcoded on the guide page.findViewByIdView-based snippets (ImageButton,ImageView,TextView), and XML drawable syntax/example blocks on a reference-doc-like page left hardcoded on the guide page.Activity.showDialog/onCreateDialogsnippets, and XML resource syntax/example blocks on a reference-doc-like page left hardcoded on the guide page.