-
Notifications
You must be signed in to change notification settings - Fork 15
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: Image selector anchor - WPB-11605 #2100
base: release/cycle-3.114
Are you sure you want to change the base?
fix: Image selector anchor - WPB-11605 #2100
Conversation
@@ -96,23 +107,13 @@ class ImagePickerManager: NSObject { | |||
imagePickerController.cameraDevice = .front | |||
imagePickerController.modalTransitionStyle = .coverVertical | |||
case .photoLibrary, .savedPhotosAlbum: | |||
if viewController.isIPadRegular() { | |||
if viewController.isIPad() { |
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.
isIPadRegular
isn't sufficient. We need to use a popover on any iPad size
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.
I think correct would be to check if the split view controller's layout is collapsed, which is true for iPhones and for iPads when the window is resized so that the horizontal size class is compact.
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.
Agreed with @caldrian here. Is it possible to be done in this PR @samwyndham?
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.
But won't that mean that it is possible to present this on iPad without using a popover? Won't that crash?
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.
I'll see if there is a iPad at work to test this with
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.
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.
@caldrian You mean you tested there was no crash?
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.
No crash and the presentation seems to be correct.
Test Results 2 files 288 suites 3m 32s ⏱️ Results for commit b013ec3. ♻️ This comment has been updated with latest results. |
This abstract type is not referenced and it's conformance limits flexibility fixing this bug
Also ensure a popover is always used for iPad
This variable is not read
8086ba2
to
a9a55f9
Compare
wire-ios/Wire-iOS/Sources/Managers/Image/ImagePickerManager.swift
Outdated
Show resolved
Hide resolved
@@ -96,23 +107,13 @@ class ImagePickerManager: NSObject { | |||
imagePickerController.cameraDevice = .front | |||
imagePickerController.modalTransitionStyle = .coverVertical | |||
case .photoLibrary, .savedPhotosAlbum: | |||
if viewController.isIPadRegular() { | |||
if viewController.isIPad() { |
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.
I think correct would be to check if the split view controller's layout is collapsed, which is true for iPhones and for iPads when the window is resized so that the horizontal size class is compact.
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.
Left some comments and questions regarding a PopoverPresentationControllerConfiguration
and how to check if it's iPad by checking if SplitViewController
layout is collapsed.
wire-ios/Wire-iOS/Sources/Managers/Image/ImagePickerManager.swift
Outdated
Show resolved
Hide resolved
@@ -96,23 +107,13 @@ class ImagePickerManager: NSObject { | |||
imagePickerController.cameraDevice = .front | |||
imagePickerController.modalTransitionStyle = .coverVertical | |||
case .photoLibrary, .savedPhotosAlbum: | |||
if viewController.isIPadRegular() { | |||
if viewController.isIPad() { |
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.
Agreed with @caldrian here. Is it possible to be done in this PR @samwyndham?
@@ -96,23 +107,13 @@ class ImagePickerManager: NSObject { | |||
imagePickerController.cameraDevice = .front | |||
imagePickerController.modalTransitionStyle = .coverVertical | |||
case .photoLibrary, .savedPhotosAlbum: | |||
if viewController.isIPadRegular() { | |||
if viewController.isIPad() { |
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.
# Conflicts: # wire-ios/Wire-iOS/Sources/Managers/Image/ImagePickerManager.swift # wire-ios/Wire-iOS/Sources/Managers/Image/ProfileImagePickerManager.swift # wire-ios/Wire-iOS/Sources/UserInterface/SelfProfile/SelfProfileViewController.swift # wire-ios/Wire-iOS/Sources/UserInterface/Settings/CellDescriptors/SettingsCellDescriptor.swift # wire-ios/Wire-iOS/Sources/UserInterface/Settings/CellDescriptors/SettingsCellDescriptorFactory+Account.swift
Issue
Currently on the navigation overhaul epic branch the popover
UIImagePickerController
is not properly anchored as it doesn't have a suitablesourceView
set.This PR:
SettingsExternalScreenCellDescriptorType
, allowing more flexibility when creatingSettingsAppearanceCellDescriptor
, and thus allowing thesender
of the settings screen to be forwarded to theUIImagePickerController
s picker.ImagePickerManager.showActionSheet(on:completion:)
to accept apopoverSourceView
which gets set on the popover controller.UIImagePickerController
on any iPad, not just regular size classes as is necessary for apples API.Testing
Setting
Profile Picture
Choose from Library
Choose from Library
Also try rotating the device to check things are working
NOTE:
After selecting a photo there is a know issue that is not fixed in this PR: https://wearezeta.atlassian.net/browse/WPB-11929
Checklist
[WPB-XXX]
.