How change background OUTSIDE application window in Android?
-
wrote on 23 Nov 2016, 19:58 last edited by
I create aplication for Android using QMainWindow. All works fine but if I run application on device with screen resolution greater than window has - outside this window clean white field appears. I did not find the way how change this color. Later I will make scaling window but now I need make this field black. Anybody knows how change color OUTSIDE application window?
Or just better - how make it transparent? On my Android tablet I use Calculator++. It can appear as small window in upper left screen corner. Not as applet but as window exactly. Other descktop part remains visible and responsible for taps. Can I get similar behaviuor in application based on QMainWindow?
-
I create aplication for Android using QMainWindow. All works fine but if I run application on device with screen resolution greater than window has - outside this window clean white field appears. I did not find the way how change this color. Later I will make scaling window but now I need make this field black. Anybody knows how change color OUTSIDE application window?
Or just better - how make it transparent? On my Android tablet I use Calculator++. It can appear as small window in upper left screen corner. Not as applet but as window exactly. Other descktop part remains visible and responsible for taps. Can I get similar behaviuor in application based on QMainWindow?
@Gourmet Why is your app not full-screen?
-
wrote on 26 Nov 2016, 18:28 last edited by
Cause I do not need full screen. On large tablet it looks ugly.
-
@Gourmet Non-fullscreen apps are actually unusual on mobiles and tablets (cannot remember any). I don't know how to change the background, I guess it is handled by the OS.
-
wrote on 28 Nov 2016, 14:37 last edited by Gourmet
I know some Android apps with "windows" smaller than screen size. They work fine and they confirm - this can be done. I'm sure not the OS but application defines how it is visible on Android screen.
-
wrote on 30 Nov 2016, 10:26 last edited by
Adding of android:theme="@android:style/Theme.Translucent" to <activity...> tag in AdroidManifest.xml makes entire screen black. Including background of application "window". This looks much better than entire white screen. I can fill "window" background by any needed picture. Outside it screen will remain black. But I expected get transparent background outside "window" - I wanna see other application activity there. How can I do that?
By the way - this theme setting forces standrard controls on screen look "Androidish". For example progress bar appeared like default Android progress bar - grey strip on yellow background and without border. In QtDesigner I tuned it's look differently but all my settings were lost. Buttons look different too. I afraid if I will set skins for buttons - they will be lost with theme setting. How can I force controls look as I requested but use theme for just app background? In other words - How can I force controls skinning appear AFTER Android theme applied?
-
wrote on 16 Feb 2021, 08:21 last edited by
anyone cen help me with this same issue pls?
-
wrote on 16 Feb 2021, 08:59 last edited by
found it finally :D
u need to add add this
android:theme="@android:style/Theme.Translucent"
to <application...> section of AndroidManifest.xml.
then add this to your class:
this->setPalette(Qt::transparent);
source : https://bugreports.qt.io/browse/QTBUG-57394
thx @Gourmet a lot