I'm using Delphi 10.1 Berlin for developing Android mobile application. And I need to change the tittle bar color of the Android app and while searching internet I have found some of the sample links: Android Material design implementation and Stack overflow Question. But I have not found any links to implement this using Delphi. Please help me to proceed further.
Asked
Active
Viewed 2,455 times
4 Answers
1
Deploy the styles.xml
in the ./res folder
Example of a content of this file :
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme.EditTextStyle" parent="@android:style/Widget.Holo.Light.EditText">
<item name="android:background">@null</item>
</style>
<style name="AppTheme" parent="@android:style/Theme.Holo.Light.NoActionBar">
<item name="android:editTextStyle">@style/AppTheme.EditTextStyle</item>
<item name="android:colorPrimary">#ff2b2e38</item>
<item name="android:colorAccent">#ff0288d1</item>
<item name="android:windowBackground">@android:color/black</item>
<!-- <item name="android:windowTranslucentStatus">true</item> -->
</style>
</resources>
after edit the androidmanifest and in <application ..>
tag add android:theme="@style/AppTheme"
instead of android:theme="%theme%"

zeus
- 12,173
- 9
- 63
- 184
-
I have tried by changing the black colour to green but only default black colour appears. Is it working for Delphi 10.1 Seattle? – test12345 May 06 '17 at 06:11
1
This will only work with the Include Splash Image option enabled
check this http://blog.rzaripov.kz/2016/12/android-ios.html (Russian) https://github.com/rzaripov1990/FMX.StatusBar (demo project)
styles.xml
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="AppTheme" parent="@android:style/Theme.Holo.Light">
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">false</item>
<item name="android:windowBackground">@drawable/splash_image_def</item>
<item name="android:windowNoTitle">true</item>
</style>
</resources>
deployment
- Remote Name = styles.xml
- Remote path = \res\values-v21\

ZuBy
- 31
- 1
-
In the XML where should we need to mention the color? As you have mentioned remote path as "\res\values-v21\" and should I need to mention the android base version. – test12345 Jun 06 '17 at 10:01
0
You can change the system bars colors (status bar or navigation bar) with my code in github:
https://github.com/viniciusfbb/fmx_tutorials/tree/master/delphi_system_bars
Extra: You can even make it semi transparent with VisibilityOverlapping and have an image behind them. All examples are in repository.

vfbb
- 611
- 7
- 15
-1
SharedActivity.getWindow.addFlags(TJWindowManager_LayoutParams.JavaClass.FLAG_FULLSCREEN);
Works on 10.3.3

David Buck
- 3,752
- 35
- 31
- 35
-
Welcome to Stack Overflow. Please post only in English on Stack Overflow. There is a Spanish site at [es.so] – David Buck Jun 26 '20 at 23:34