-
-
Notifications
You must be signed in to change notification settings - Fork 224
Add physical orientation constraint using OrientationEventListener #1911
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
…entListener Co-authored-by: sds100 <[email protected]>
Co-authored-by: sds100 <[email protected]>
Co-authored-by: sds100 <[email protected]>
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.
@copilot Can you show only one "Physical orientation" constraint in the choose constraint screen, then clicking on it shows a DialogModel.SingleChoice to select which one. Do the same for normal Orientation constraints too.
Co-authored-by: sds100 <[email protected]>
Done in e000b00. Now the constraint list shows only "Screen orientation" and "Physical orientation" entries. Tapping either one shows a |
sds100
left a comment
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.
| SCREEN_OFF, | ||
|
|
||
| SCREEN_ORIENTATION, | ||
| ORIENTATION_PORTRAIT, |
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.
@copilot rename all these to DISPLAY_ORIENTATION_*. Do not add constraintids for general SCREEN_ORIENTATION and PHYSICAL_ORIENTATION. Refactor the ChooseConstraintViewModel to still only show the 2 orientation list items, and no more.
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.
Done in f1a7566. Renamed all orientation constraints to DISPLAY_ORIENTATION_*. Removed SCREEN_ORIENTATION and PHYSICAL_ORIENTATION ConstraintIds. The ChooseConstraintViewModel now uses synthetic list item IDs (display_orientation, physical_orientation) for the consolidated items in the UI, while still showing only the 2 orientation entries.
| orientation == Orientation.ORIENTATION_0 || | ||
| orientation == Orientation.ORIENTATION_180 | ||
|
|
||
| is ConstraintData.PhysicalOrientationConstraint -> |
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.
@copilot Just call it ConstraintData.PhysicalOrientation
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.
Done in f1a7566. Renamed ConstraintData.PhysicalOrientationConstraint to ConstraintData.PhysicalOrientation.
… PhysicalOrientationConstraint to PhysicalOrientation Co-authored-by: sds100 <[email protected]>
OrientationEventListenertoDisplayAdapterfor physical orientation detectionPhysicalOrientationenum to capture physical device orientationPHYSICAL_ORIENTATION_PORTRAIT,PHYSICAL_ORIENTATION_LANDSCAPE, etc.)ConstraintIdto include new physical orientation constraint IDsConstraint.ktwith newConstraintDatatypes for physical orientationConstraintEntity.ktwith new physical orientation type constantsConstraintSnapshot.ktto detect physical orientation constraintsDetectConstraintsUseCaseto handle physical orientation changesConstraintUtils.ktwith UI labels and icons for new constraint typesConstraintUiHelper.ktwith display titles for new constraintsChooseConstraintViewModel.ktto handle new constraint selection with single-select dialogConstraintDependencyto track physical orientation changesTestConstraintSnapshotto support testing physical orientation constraintsOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.