Add FXIOS-6238 - ShareTo Extension Changes To Light or Dark Theme When iOS Appearance Is Changed #20290
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📜 Tickets
Jira ticket
Github issue
💡 Description
ShareTo extension updated so that it now responds to the light/dark mode appearance setting in iOS.
LightTheme()
orDarkTheme()
from Firefox theme is applied to the corresponding appearance settting.InstructionsView
import Common
to get access to Firefox themes.@Environment(\.colorScheme) var colorScheme
property to track changes to iOS appearance setting.useSystemLightDarkMode
property to enable or disable view responding to iOS appearance setting. Property is set to false by default to allow for backwards compatibility to other parts of the app that also use this view.mainView
property to allow for re-use.body
property so toolbar background is modified if iOS16 or greater.InstructionsView
extension. Helper functions will apply the appropriate theme colors ifuseSystemLightDarkMode
is true, else the view property colors as set when the view was created are applied.DevicePickerViewController
tabTitleLabel
property and code for setting the nav bar title intosetNavBarTitle()
so it is re-usable.setNavBarAppearance()
to configure the nav bar backgound colors.SendToDevicePickerViewController: DevicePickerViewController
. Subclass has delegatetraitCollectionDidChange()
that responds to iOS appearance changes.SendToDeviceHelper
InstructionsView()
call intogetInstructionsView()
so subclass can override.DevicePickerViewController()
call intogetDevicePickerViewController()
so subclass can override.SendToExtensionHelper: SendToDeviceHelper
to passuseSystemLightDarkMode
flag toInstructionsView
and call subclassSendToDevicePickerViewController
instead ofDevicePickerViewController
SendToDevice
SendToExtensionHelper
instead ofSendToDeviceHelper
and passuseSystemLightDarkMode: true
flag.ShareViewController
currentTheme()
to usetraitCollection.userInterfaceStyle
to set the appropriate theme in response to changes in appearance setting.traitCollectionDidChange()
that responds to iOS appearance changes.📝 Checklist
You have to check all boxes before merging
@Mergifyio backport release/v120
)