Skip to content

Instantly share code, notes, and snippets.

@DelphiWorlds
Created July 23, 2020 13:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DelphiWorlds/86313c1f94cbe21e29e1e5a38adbc208 to your computer and use it in GitHub Desktop.
Save DelphiWorlds/86313c1f94cbe21e29e1e5a38adbc208 to your computer and use it in GitHub Desktop.
Check Android for dark mode (untested)
uses
Androidapi.JNI.GraphicsContentViewText, Androidapi.Helpers;
function IsDarkMode: Boolean;
var
LMode: Integer;
begin
LMode := TAndroidHelper.Context.getResources.getConfiguration.uiMode and TJConfiguration.JavaClass.UI_MODE_NIGHT_MASK;
Result := LMode = TJConfiguration.JavaClass.UI_MODE_NIGHT_YES;
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment