Change The StatusBar Color Property For FireMonkey In Delphi 10 Berlin On Android

statusbarcolorDeveloper ZuBy has made some demo code available for changing the StatusBar color on Android in your apps. The status bar is the bar at the top of your device with the various icons and other information in it. In a Java based Android app to change StatusBar color you can do it either by modifying the styles.xml file and adding the following line: <item name=”android:statusBarColor”>@color/color_primary</item> or by changing at runtime (implementations may differ) through code using window.setStatusBarColor(activity.getResources().getColor(R.color.my_statusbar_color)). However, in FireMonkey you must use the JNI (Java Native Interface). JNI enables Java code running in a Java Virtual Machine (JVM) to call and be called by native applications (programs specific to a hardware and operating system platform) and libraries written in other languages. Thus, you can call JNI Java code from Delphi 10 Berlin with FireMonkey and make the necessary changes. In order to make use of this change, make sure you are using Android 5 (Lollipop) and above. This code does not apply to Windows, IOS, or OSX. Notice that the code bellow is very similar to the Java implementation on Android.

Head over to checkout the full demo on how to change the StatusBar color in Delphi 10 Berlin with FireMonkey

Edit: For changing the StatusBar color on IOS check out this Github code.

Have Delphi Firemonkey questions? Ask and get answers on StackOverflow.

Change The StatusBar Color Property For FireMonkey In Delphi 10 Berlin On Android by Delphi XE5 XE6 XE7 XE8 10 Seattle Berlin Firemonkey, Delphi Android, Delphi IOS is licensed under a Creative Commons Attribution 4.0 International License.

2 Responses to Change The StatusBar Color Property For FireMonkey In Delphi 10 Berlin On Android

  1. ZuBy says:

    Full Source for Android and iOS on my GitHub
    https://github.com/rzaripov1990/StatusBar

Leave a Reply

Show Buttons
Hide Buttons
Read previous post:
Delphi 10 Berlin HID Component Library Firemonkey Windows OSX
Access Human Interface Devices Via USB For FireMonkey In Delphi 10 Berlin On Windows And OSX

Developer WinSoft has released a powerful library for HID devices that is now available for FireMonkey in Delphi 10 Berlin....

Close