Repository navigation
Migrate App resources for Views (providing, runtime changes, localization, strings) snippets - #1194
Open
djubinville wants to merge 2 commits into
Open
djubinville wants to merge 2 commits into
djubinville wants to merge 2 commits into
Conversation
djubinville
force-pushed
the
djubinville/app-resources-views-pages-snippets
branch
from
October 16, 2026 17:07
5b7cf5b to
09569a6
Compare
djubinville
marked this pull request as ready for review
October 16, 2026 18:48
djubinville
force-pushed
the
djubinville/app-resources-views-pages-snippets
branch
2 times, most recently
from
October 19, 2026 11:49
45ba209 to
1f0c02c
Compare
Contributor
Author
|
Addressed review feedback on PR #1194 and companion CL cl/1000932997:
Documented Rule Bypasses & Rulebook Recommendations
|
djubinville
force-pushed
the
djubinville/app-resources-views-pages-snippets
branch
2 times, most recently
from
October 20, 2026 18:47
cbfae1d to
1ddfa7f
Compare
djubinville
force-pushed
the
djubinville/app-resources-views-pages-snippets
branch
from
October 21, 2026 17:46
1ddfa7f to
6acbe3c
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:
Companion DAC CL: cl/1000932997
views/src/main/res/values/strings.xmldeclares untagged supporting resources (R.string.hello,R.string.world,R.string.welcome_messages,R.string.title,R.array.planets_array,R.plurals.numberOfSongsAvailable, and<item name="permanent_marker" type="font" />forR.font.permanent_marker) because the tagged Kotlin regions inStringResourceViews.kt(android_resources_string_views_get_string,android_resources_string_views_get_string_array,android_resources_string_views_get_quantity_string,android_resources_string_views_format_string,android_resources_string_views_from_html,android_resources_string_views_html_encode,android_resources_string_views_spannable_chain, andandroid_resources_string_views_annotation_typeface) reference those resource IDs and cannot compile without them (D27). Note onD11bypass:<item name="permanent_marker" type="font" />is retained as a compilation stand-in forR.font.permanent_marker(android_resources_string_views_annotation_typeface) so:views:compileDebugKotlinsucceeds without committing a binary.ttf/.otffont file intoviews/src/main/res/font/.List of modifications:
RuntimeChangesViews.ktandroid_resources_runtime_changes_views_keyboardConfiguration.KEYBOARDHIDDEN_YESandConfiguration.KEYBOARDHIDDEN_NObranches soKEYBOARDHIDDEN_NOdisplays"Keyboard available"andKEYBOARDHIDDEN_YESdisplays"No keyboard"KEYBOARDHIDDEN_YES("hardware keyboard is hidden") toasted"Keyboard available"andKEYBOARDHIDDEN_NO("hardware keyboard is not hidden") toasted"No keyboard".ArrayAdapterKotlin snippet intoviews/src/main/java/com/example/example/snippet/views/resources/ProvidingResourcesViews.kt(android_resources_providing_views_list_adapter).onConfigurationChangedKotlin snippet intoviews/src/main/java/com/example/example/snippet/views/resources/RuntimeChangesViews.kt(android_resources_runtime_changes_views_keyboard), fixed invertedKEYBOARDHIDDEN_NO/KEYBOARDHIDDEN_YESbranches (D24), and added a trailing full stop to the inline comment (D29).views/src/main/java/com/example/example/snippet/views/resources/LocalizationViews.kt(android_resources_localization_views_primary_locale).views/src/main/java/com/example/example/snippet/views/resources/StringResourceViews.kt(android_resources_string_views_get_string,android_resources_string_views_get_string_array,android_resources_string_views_get_quantity_string,android_resources_string_views_format_string,android_resources_string_views_from_html,android_resources_string_views_html_encode,android_resources_string_views_spannable_helpers,android_resources_string_views_spannable_styles,android_resources_string_views_spannable_chain,android_resources_string_views_annotation_typeface,android_resources_string_views_annotation_parcel_send, andandroid_resources_string_views_annotation_parcel_receive), stripped inline HTML<code><a href="...">link markup from<pre>blocks (android_resources_string_views_get_string,android_resources_string_views_get_string_array,android_resources_string_views_get_quantity_string, andandroid_resources_string_views_html_encode), added trailing full stops to natural-language comments (D29), and formatted with Spotless.Snippets not migrated:
findViewById/getStringexample blocks inside<section>tabs (lines 650–653 and 688–706) left hardcoded withSNIPPET_GITHUBbecause they reference 8 hypothetical resources across 4 resource types (R.id.myimageview,R.drawable.myimage,R.drawable.my_background_image,R.string.main_title,R.layout.main_screen,R.anim.hyperspace_in,R.id.msg,R.string.hello_message) not defined on the page (D1/D11— unlike the migratedArrayAdapterblock which uses platformandroid.R.layout.simple_list_item_1and a single<string-array name="planets_array">resource); obsolete Java duplicates (lines 657–661, 710–728, and 887–889, removed perD15); and short XML View layout fragments (<merge>,<Button>,<EditText>) and resource/alias syntax examples (<drawable>,<color>/<string>,<bitmap>) left hardcoded on the guide page (D1).D15).D15).D15);<dl class="xml">syntax templates containing HTML anchor tags (<string>,<string-array>,<plurals>);<TextView>View layout XML fragment (D1); and<string>,<string-array>, and<plurals>XML resource example blocks left hardcoded withSNIPPET_GITHUBbecause each block is a complete standalone<?xml version="1.0" encoding="utf-8"?><resources>...</resources>file template (including a localizedres/values-pl/strings.xmlPolish variant) that cannot be nested inside the module's singleviews/src/main/res/values/strings.xml<resources>root without omitting the XML declaration and<resources>wrapper shown on the page.