Skip to content
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

Fix #184: Incorrect tap area for Right-to-Left languages #194

Merged
merged 11 commits into from
Mar 20, 2024

Conversation

aokj4ck
Copy link
Contributor

@aokj4ck aokj4ck commented Mar 19, 2024

Description

Fixes #184

  • CategoriesFavoritesSegmentControl was missing Right-to-Left language support
  • Tested with Right-to-left pseudo language
  • Add PreviewCategoriesFavoritesSegmentControl.swift to fix previews in Xcode 14
  • Fix xib errors for CategoriesFavoritesSegmentControl

Checklist

  • Update CHANGELOG

Screenshots

Xcode Right-to-left pseudo language

Edit Scheme > App language > change to Right-to-left pseudolanguage
Screenshot 2024-03-19 at 17 42 58

Updated behavior
Left-to-right Right-to-left
Simulator Screen Recording - iPhone 15 Pro - 2024-03-19 at 17 44 13 Simulator Screen Recording - iPhone 15 Pro - 2024-03-19 at 17 44 50
SwiftUI Previews
Screenshot 2024-03-20 at 13 18 34 Screenshot 2024-03-20 at 13 18 31 Screenshot 2024-03-20 at 13 18 29
Right to Left behavior
With Results Dark mode categories Dark mode favorites
Simulator Screenshot - iPhone 15 Pro - 2024-03-20 at 13 20 33 Simulator Screenshot - iPhone 15 Pro - 2024-03-20 at 13 22 37 Simulator Screenshot - iPhone 15 Pro - 2024-03-20 at 13 22 39

aokj4ck added 10 commits March 12, 2024 14:36
…ix preview

- Add assignment of configuration var, this was failing the assertion
- Moving to a separate file fixed the other errors, see:
> SwiftUI preview: error: '__designTimeInteger(_:fallback:)' is only available in iOS 13.0 or newer - https://forums.developer.apple.com/forums/thread/716922?answerId=733210022#733210022
- First need to detect the current tab, and in RTL mode find that it is favorites, but it should be categories, then manually perform a scroll to the default categories tab
- Expand out branches in CategoriesFavoritesSegmentControl.Tab.init(scrollViewPageProgress: direction:) to be explicit and clear
…ncorrect-tap-area-for-right-to-left-languages
@aokj4ck aokj4ck linked an issue Mar 19, 2024 that may be closed by this pull request
@aokj4ck aokj4ck marked this pull request as ready for review March 19, 2024 21:58
@aokj4ck aokj4ck requested review from a team as code owners March 19, 2024 21:58
@aokj4ck aokj4ck requested review from mapbox-danny, a user, kried and azarovalex March 19, 2024 21:58
azarovalex
azarovalex previously approved these changes Mar 20, 2024
@aokj4ck aokj4ck merged commit 7a28521 into main Mar 20, 2024
4 checks passed
@aokj4ck aokj4ck deleted the 184-incorrect-tap-area-for-right-to-left-languages branch March 20, 2024 18:28
aokj4ck added a commit that referenced this pull request Apr 5, 2024
### Description
Fixes GitHub issue #184 

- CategoriesFavoritesSegmentControl was missing Right-to-Left language support
- Tested with Right-to-left pseudo language
- Add PreviewCategoriesFavoritesSegmentControl.swift to fix previews in Xcode 14
- Fix xib errors for CategoriesFavoritesSegmentControl

### Checklist
- [x] Update `CHANGELOG`

### Screenshots

##### Xcode Right-to-left pseudo language

Edit Scheme > App language > change to Right-to-left pseudolanguage
<img width="942" alt="Screenshot 2024-03-19 at 17 42 58" src="https://github.com/mapbox/mapbox-search-ios/assets/384288/10ecfadf-e26b-48b1-9275-3f399d67c304">

##### Updated behavior

| Left-to-right | Right-to-left |
| -- | -- |
| ![Simulator Screen Recording - iPhone 15 Pro - 2024-03-19 at 17 44 13](https://github.com/mapbox/mapbox-search-ios/assets/384288/b3254b52-8127-4e2e-92a5-a3b207d1f3f0) | ![Simulator Screen Recording - iPhone 15 Pro - 2024-03-19 at 17 44 50](https://github.com/mapbox/mapbox-search-ios/assets/384288/d0225339-5888-467a-9dcf-5401445ff240) | 

###### SwiftUI Previews
<img width="1677" alt="Screenshot 2024-03-20 at 13 18 34" src="https://github.com/mapbox/mapbox-search-ios/assets/384288/d8e4ddfa-c4bc-45b5-9d30-7002bd180c27">
<img width="1677" alt="Screenshot 2024-03-20 at 13 18 31" src="https://github.com/mapbox/mapbox-search-ios/assets/384288/35d4cecb-4329-47f7-bf28-41384d8c723c">
<img width="1677" alt="Screenshot 2024-03-20 at 13 18 29" src="https://github.com/mapbox/mapbox-search-ios/assets/384288/21b6db61-335d-417d-8930-ba595d90683f">

###### Right to Left behavior

| With Results | Dark mode categories | Dark mode favorites |
| -- | -- | -- |
| ![Simulator Screenshot - iPhone 15 Pro - 2024-03-20 at 13 20 33](https://github.com/mapbox/mapbox-search-ios/assets/384288/9ecf021c-cab3-4847-93b9-b61adb7a9d8a) | ![Simulator Screenshot - iPhone 15 Pro - 2024-03-20 at 13 22 37](https://github.com/mapbox/mapbox-search-ios/assets/384288/0f976a7e-a9d3-46e5-b00d-95f8fac06aaa) | ![Simulator Screenshot - iPhone 15 Pro - 2024-03-20 at 13 22 39](https://github.com/mapbox/mapbox-search-ios/assets/384288/736355eb-2892-42a8-b3bc-1eaecf4f5ae4) |
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.

Incorrect tap area for right-to-left languages
2 participants