tolu360 / react-native-google-places

iOS/Android Google Places Widgets (Autocomplete Modals) and API Services for React Native Apps
566 stars 289 forks source link

IOS 13.0+ dark mode displays white text color for openAutocompleteModal queries on a light gray background #264

Open Wmeng98 opened 4 years ago

Wmeng98 commented 4 years ago

Makes the text unreadable in this case. Maybe we could change the background color for the modal depending on theme to support IOS 13.0+?

Thanks!

AlexBlake commented 4 years ago

Can confirm from a TesFlight build: Device: iPhone XR iOS Version: 13.1.3

white_text

AlexBlake commented 4 years ago

Looking into things, the SDK for IOS provides properties for controlling display colour, to further @Wmeng98's suggestion, would it make sense to allow control of these properties through the options provided to openAutocompleteModal ref properties: https://developers.google.com/places/ios-sdk/reference/interface_g_m_s_autocomplete_view_controller.html#properties Thoughts @tolu360?

Ive been playing around with a solution and am happy to submit PR if it makes sense, though it would be IOS only options as (to my knowledge) the android side would need a custom layout to apply this kind of control.

Happy to PR if it makes sense to add this feature.

janva255 commented 4 years ago

I'm having this problem too, with dark mode

dimaportenko commented 4 years ago

I've created PR with solution from https://stackoverflow.com/a/59071909/923497

anurag91jain commented 4 years ago

Can we please have either #267 or #274 merged?

aditya-lg commented 4 years ago

@tolu360 please look at merging either #267 or #274, changes helpful for dark-mode on iOS 13+

MarcoSpeziali commented 4 years ago

What is the status of this issue? Has the PR been merged? Because I'm having the same issue even with the latest version

dimaportenko commented 4 years ago

@MarcoSpeziali looks like it's stuck. But you can use https://www.npmjs.com/package/patch-package, a great tool for patching your node_modules dependencies. Here is a video with a usage example.

ArturoTorresMartinez commented 3 years ago

Any updates here?

ckOfor commented 3 years ago

I've created PR with solution from https://stackoverflow.com/a/59071909/923497

Based on this answer, steps to fix

  1. Open XCode
  2. Find the file RNGooglePlacesViewController
  3. Add this to line 38 directly below GMSAutocompleteViewController *viewController = [[GMSAutocompleteViewController alloc] init]; It should look like Uploading Screenshot 2021-03-23 at 00.29.46.png…

        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;
        }
    }```
ishabhattt commented 3 months ago

React Native Google Places themeing issue fix in IPhone 13+ A detailed description given on how to create custom objective file and attach it to fix the theming in React Native and get a whole data object as you get from RNGooglePlaces in return

Have A Great Day!!

https://github.com/tolu360/react-native-google-places/pull/267#issuecomment-2238517707

https://github.com/ishabhattt/RNCustomGooglePlaces