You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/10/20 22:14:14 UTC

[GitHub] [cordova-android] jcesarmobile commented on issue #747: Dark Mode Support Android Q

jcesarmobile commented on issue #747: Dark Mode Support Android Q
URL: https://github.com/apache/cordova-android/issues/747#issuecomment-544298418
 
 
   You can check if the device has dark mode enabled and only force the WebView into dark mode in that case, something like
   
   ```
       int nightModeFlags = getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;
       if (nightModeFlags == Configuration.UI_MODE_NIGHT_YES) {
         if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.Q) {
           webSettings.setForceDark(WebSettings.FORCE_DARK_ON);
         }
       }
   ```
   
   But doesn't seem to be possible to get light media query.
   
   Looks like an Android bug to me.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org