Is it possible to change the taskbar color when fullscreen
is set to 0
in buildozer.spec
file?
I already tried changing Window.clearcolor
value but hence taskbar is not part of Window
when fullscreen
is 0
, taskbar color doesn't change.
How does one do that?
Asked
Active
Viewed 674 times
1

Amin Etesamian
- 3,363
- 5
- 27
- 50
-
2You probably want to find the Android API for this setting and call it from python using pyjnius. – inclement Feb 19 '17 at 16:20
1 Answers
1
I believe this is the answer for Java, therefore (as inclement said) you need to use pyjnius to access the Java functions from Python and then wrap the code mentioned in the linked answer to something usable from Kivy.
Example (not tested):
from jnius import autoclass
WindowManager = autoclass('android.view.WindowManager')
R = autoclass('android.R')
activity = autoclass('<your.app.name>.PythonActivity').mActivity
window = activity.getWindow();
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
window.setStatusBarColor(activity.getResources().getColor(R.color.my_statusbar_color));
I think only these colors are available, but feel free to try other values. I've seen some issues with android.R
importing in Java, so you might want to just use the raw values instead of fetching them from android.R
module.

Community
- 1
- 1

Peter Badida
- 11,310
- 10
- 44
- 90