Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 27, 2025

  • Analyze existing codebase structure
  • Add OrientationEventListener to DisplayAdapter for physical orientation detection
  • Add new PhysicalOrientation enum to capture physical device orientation
  • Add new constraint types for physical orientation (PHYSICAL_ORIENTATION_PORTRAIT, PHYSICAL_ORIENTATION_LANDSCAPE, etc.)
  • Modify ConstraintId to include new physical orientation constraint IDs
  • Update Constraint.kt with new ConstraintData types for physical orientation
  • Update ConstraintEntity.kt with new physical orientation type constants
  • Update ConstraintSnapshot.kt to detect physical orientation constraints
  • Update DetectConstraintsUseCase to handle physical orientation changes
  • Update ConstraintUtils.kt with UI labels and icons for new constraint types
  • Update ConstraintUiHelper.kt with display titles for new constraints
  • Update ChooseConstraintViewModel.kt to handle new constraint selection with single-select dialog
  • Update ConstraintDependency to track physical orientation changes
  • Add string resources for new constraint types
  • Update TestConstraintSnapshot to support testing physical orientation constraints
  • Run code review and address feedback
  • Run CodeQL security analysis
  • Consolidate orientation constraints into "Screen orientation" and "Physical orientation" with single-select dialogs
  • Rename ORIENTATION_* to DISPLAY_ORIENTATION_*
  • Remove SCREEN_ORIENTATION and PHYSICAL_ORIENTATION group ConstraintIds
  • Rename ConstraintData.PhysicalOrientationConstraint to ConstraintData.PhysicalOrientation
Original prompt

This section details on the original issue you should resolve

<issue_title>Constraint for physical orientation of the phone</issue_title>
<issue_description>### Have you checked if an issue already exists for this feature request?

  • Nobody else has requested this feature before

What feature would you like added?

TODO

  • Use OrientationEventListener in DisplayAdapter
  • Consolidate the orientation constraints into two types: PhysicalOrientation, ScreenOrientation. Only these two will be shown in the constraints list, and tapping one will show a single-select dialog to choose which orientation. The ConstraintEntity should not be modified, only modify Constraint data class.

App version

No response

Device model and manufacturer

No response

Extra info

  • My device is rooted</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 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.

Copilot AI changed the title [WIP] Add constraint for physical phone orientation Add physical orientation constraint using OrientationEventListener Nov 27, 2025
Copilot AI requested a review from sds100 November 27, 2025 13:14
Copy link
Collaborator

@sds100 sds100 left a 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.

Copy link
Contributor Author

Copilot AI commented Nov 27, 2025

@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 Orien...

Done in e000b00. Now the constraint list shows only "Screen orientation" and "Physical orientation" entries. Tapping either one shows a DialogModel.SingleChoice dialog to select the specific orientation.

Copilot AI requested a review from sds100 November 27, 2025 14:00
Copy link
Collaborator

@sds100 sds100 left a 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,
Copy link
Collaborator

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.

Copy link
Contributor Author

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 ->
Copy link
Collaborator

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

Copy link
Contributor Author

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]>
Copilot AI requested a review from sds100 November 27, 2025 14:41
@sds100 sds100 marked this pull request as ready for review December 2, 2025 19:40
@sds100 sds100 merged commit 9b80a8c into develop Dec 2, 2025
1 check failed
@sds100 sds100 deleted the copilot/add-phone-orientation-constraint branch December 13, 2025 19:20
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.

Constraint for physical orientation of the phone

2 participants