Skip to content

fix: handle exercise configuration changes - #348

Open
arpitagarwal1301 wants to merge 1 commit into
android:mainfrom
arpitagarwal1301:fix/329-handle-config-changes
Open

fix: handle exercise configuration changes#348
arpitagarwal1301 wants to merge 1 commit into
android:mainfrom
arpitagarwal1301:fix/329-handle-config-changes

Conversation

@arpitagarwal1301

Copy link
Copy Markdown

What

Declare the size and orientation configuration changes handled by ExerciseSampleCompose's MainActivity.

Why

MainActivity hosts a Compose UI, which can recompose for size-based configuration changes without recreating the activity. Avoiding recreation helps retain the ongoing exercise UI and activity-scoped state through those changes.

How

Add the size-specific configuration set from the current Android guidance:

android:configChanges="screenSize|smallestScreenSize|orientation|screenLayout"

Fixes #329

Validation

  • XML parsing and git diff --check
  • :app:processDebugMainManifest
  • :app:testDebugUnitTest
  • :app:verifyRoborazziDebug
  • :app:assembleDebug
  • packaged-manifest inspection with aapt2 confirmed config mask 0x0d80

The local repository's Spotless and lint checks currently fail on pre-existing Kotlin/test formatting and indentation findings outside this XML-only change. A Wear runtime check was not available because no Wear system image or AVD is installed locally.

AI disclosure

This focused manifest correction was prepared and independently reviewed with AI assistance.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the AndroidManifest.xml file in the ExerciseSampleCompose application to add the configChanges attribute (handling screenSize, smallestScreenSize, orientation, and screenLayout) to MainActivity. This prevents the activity from being restarted during these configuration changes. There are no review comments, and we have no additional feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

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.

ExerciseSampleCompose should handle configChanges

1 participant