-
Notifications
You must be signed in to change notification settings - Fork 59
updating to alpha04 #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @amyZepp, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
Summary of Changes
Hello team, Gemini here to provide a summary of this pull request. The primary goal of this PR, as indicated by the title and description, is to update the project's dependencies to the alpha04 versions of the AndroidX XR libraries. This update also includes some minor adjustments to the UI layout, specifically affecting the 'orbiters' or UI components, and involves increasing the minimum supported SDK version.
Highlights
- Dependency Updates: The core AndroidX XR dependencies (
arcore,compose,scenecore) have been updated from1.0.0-alpha01to1.0.0-alpha04. Theimpressdependency has also been removed. - Minimum SDK Increase: The minimum SDK version required to run the application has been increased from 23 to 24 in the
build.gradle.ktsfile. - XR API Changes: Updates to the
alpha04libraries necessitated changes in how theSpatialEnvironmentis accessed (now viasession.scene) and howGltfModelinstances are created (GltfModel.createinstead ofsession.createGltfResourceAsync). TheSession.createmethod now returns aSessionCreateSuccessobject which needs to be cast to access the session. - Manifest Updates: The
AndroidManifest.xmlfile has been updated to remove a commented-outtools:overrideLibraryline and add auses-featuredeclaration forandroid.software.xr.api.spatialwithrequired="false". - UI Layout Adjustments: Minor UI changes were made, including adjusting spatial layout modifiers in
HelloAndroidXRApp.kt(fillMaxSize,fillMaxWidth, fixed widths) and applying fixed sizes to buttons inEnvironmentControls.kt. TheSearchBarlayout was simplified by removing spatial-specific padding logic and adjusting its size.
Changelog
Click here to see the changelog
- app/build.gradle.kts
- Increased
minSdkfrom 23 to 24. - Removed the
implementation(libs.impress)dependency.
- Increased
- app/src/main/AndroidManifest.xml
- Removed commented-out
uses-sdk tools:overrideLibraryline. - Added
uses-feature android:name="android.software.xr.api.spatial" android:required="false".
- Removed commented-out
- app/src/main/java/com/example/helloandroidxr/environment/EnvironmentController.kt
- Updated import for
Sessionfromscenecoretoruntime. - Added import for
androidx.xr.scenecore.scene. - Updated calls to access
SpatialEnvironmentviaxrSession.scene.spatialEnvironment. - Changed
GltfModelcreation fromxrSession.createGltfResourceAsynctoGltfModel.create.
- Updated import for
- app/src/main/java/com/example/helloandroidxr/ui/HelloAndroidXRApp.kt
- Updated imports for spatial layout modifiers (
fillMaxSize,fillMaxWidthadded,fillMaxHeightremoved). - Modified
SpatialRowto usefillMaxWidth(). - Added a fixed width modifier to
SpatialColumn. - Adjusted modifiers for
SpatialPanels, changing the main panel to usefillMaxSize()instead of fixed width andfillMaxHeight().
- Updated imports for spatial layout modifiers (
- app/src/main/java/com/example/helloandroidxr/ui/components/EnvironmentControls.kt
- Added import for
androidx.compose.foundation.layout.size. - Updated import for
Sessionfromscenecoretoruntime. - Added import for
androidx.xr.runtime.SessionCreateSuccess. - Updated
Session.createcall to handle theSessionCreateSuccessresult and use alazydelegate. - Added
.size(56.dp)modifier to theSetVirtualEnvironmentButton,SetPassthroughButton, andRequestHomeSpaceButtoncomposables.
- Added import for
- app/src/main/java/com/example/helloandroidxr/ui/components/SearchBar.kt
- Updated imports (
heightadded,Spacerandsizeremoved). - Removed import for
LocalSpatialCapabilities. - Removed spatial-specific layout logic (checking
uiIsSpatializedand addingSpacers/conditional padding). - Adjusted the
modifierforSearchTextBoxto use fixedwidthandheightinstead ofsize.
- Updated imports (
- gradle/libs.versions.toml
- Updated versions for
arcore,compose, andscenecoreto1.0.0-alpha04. - Removed the
impressversion definition. - Removed the
impresslibrary definition.
- Updated versions for
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Alpha code is new,
Dependencies updated,
UI looks better.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
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 primarily focuses on updating Android XR dependencies to alpha04 versions, which includes arcore, compose, and scenecore. Correspondingly, the impress library has been removed. The changes also involve migrating code to adapt to new APIs from these updated libraries, increasing the minSdk to 24, and making some minor UI refinements for orbiters and other components.
Overall, the dependency updates and API migrations seem to be handled correctly. However, there's a critical issue regarding an unsafe cast during XR session creation that needs to be addressed to prevent potential runtime crashes.
Summary of Findings
- Unsafe Cast in Session Creation: An unsafe cast
as SessionCreateSuccessis used when creating the XR session inEnvironmentControls.kt. IfSession.create()returns a failure state, this will lead to aClassCastExceptionand crash the application. This should be handled safely. (Commented withcriticalseverity) - Dependency Updates to alpha04: Core XR libraries (arcore, compose, scenecore) were updated to
1.0.0-alpha04, and theimpresslibrary was removed. This aligns with the PR's stated goal. (Not commented due to review settings) - API Migration for XR Libraries: The codebase was adapted to API changes introduced in the
alpha04versions of XR libraries, particularly concerningandroidx.xr.runtime.Sessionusage andGltfModelcreation. (Not commented due to review settings) - UI Adjustments and Refinements: Minor UI tweaks were implemented, such as standardizing button sizes in
EnvironmentControls, adjusting theSearchBarheight, and refining layout modifiers (e.g.,fillMaxWidth,fillMaxSize) inHelloAndroidXRApp. (Not commented due to review settings) - Android Manifest Configuration: The
minSdkwas increased from 23 to 24. Thetools:overrideLibrarydirective forandroidx.xr.scenecoreandandroidx.xr.composewas removed, likely because the underlying issue is resolved with the SDK update. The<uses-feature android:name="android.software.xr.api.spatial" android:required="false" />was added, which is a good practice for XR applications. (Not commented due to review settings) - Code Simplification in SearchBar: The
SearchBarcomponent was simplified by removing conditional logic related touiIsSpatializedfor its padding and layout. (Not commented due to review settings)
Merge Readiness
This pull request makes necessary updates to XR dependencies and adapts the code accordingly. However, due to the critical issue identified with the unsafe cast during XR session creation in EnvironmentControls.kt, I recommend that this issue be addressed before merging to prevent potential runtime crashes. Once the unsafe cast is handled, the PR should be in a much better state for merging. As a reviewer, I am not authorized to approve the pull request; please ensure further review and approval from other maintainers after addressing the feedback.
updating to alpha04 and minor ui changes for orbiters