Skip to content

Commit

Permalink
Code changes for issue tolu360#264 iOS 13 Dark Mode UI Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zaka5192 committed Feb 7, 2020
1 parent 4473689 commit c2614ae
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions ios/RNGooglePlacesViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,21 @@ - (void)openAutocompleteModal: (GMSAutocompleteFilter *)autocompleteFilter
_reject = reject;

GMSAutocompleteViewController *viewController = [[GMSAutocompleteViewController alloc] init];
///////////// Updates for the UI fix for Dark Mode /////////////////////////////
if (@available(iOS 13.0, *)) {
if(UIScreen.mainScreen.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark ){
viewController.primaryTextColor = UIColor.whiteColor;
viewController.secondaryTextColor = UIColor.lightGrayColor;
viewController.tableCellSeparatorColor = UIColor.lightGrayColor;
viewController.tableCellBackgroundColor = UIColor.darkGrayColor;
} else {
viewController.primaryTextColor = UIColor.blackColor;
viewController.secondaryTextColor = UIColor.lightGrayColor;
viewController.tableCellSeparatorColor = UIColor.lightGrayColor;
viewController.tableCellBackgroundColor = UIColor.whiteColor;
}
}
/////////////////////////////////////////////////////////////////////////////
viewController.autocompleteFilter = autocompleteFilter;
viewController.autocompleteBounds = autocompleteBounds;
viewController.autocompleteBoundsMode = autocompleteBoundsMode;
Expand Down

0 comments on commit c2614ae

Please sign in to comment.