Is it possible to set the color of the (phone) statusbar in Android? Tokyo provides a property on the form for the iOS statusbar. I can't seem to find a working solution for Android.

Comments

  1. The corresponding Delphi code from the link provided by Dalija, is:

    uses
    Androidapi.Helpers, Androidapi.JNI.GraphicsContentViewText;

    procedure TForm1.FormCreate(Sender: TObject);
    var
    LWindow: JWindow;
    begin
    LWindow := TAndroidHelper.Activity.getWindow;
    LWindow.clearFlags(TJWindowManager_LayoutParams.JavaClass.FLAG_TRANSLUCENT_STATUS);
    LWindow.addFlags(TJWindowManager_LayoutParams.JavaClass.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
    LWindow.setStatusBarColor(TJColor.JavaClass.BLUE);
    end;

    Except it doesn' t seem to work on my Nexus 5X (Android 8). When it does, it should work on a device with Android 5 or higher.

    ReplyDelete
  2. It's possible with Tokyo if I'm correct. Sarina Dupont showed that in a quick example:
    community.embarcadero.com - Previewing FireMonkey Features in RAD Studio 10.2

    ReplyDelete

Post a Comment