Wish Option for translucent (or whatever) <SOLVED>

Peter Simpson

Expert
Licensed User
Longtime User
This is not easy to explain, but I'll try.

On an Android tablet or phone it's not visible, but on Android Wear it is, I'm running the latest AW V2.6.

When I tap to open an Activity like a settings screen, AW first starts off by changing its own background color to a dark grey colour (this does not happen on tablets or phones, well I've not noticed it as all my phone activities are white). This is the HUGE issue, when I tap on my watch face to open an activity there's always a quick flash of white on the loading of my activity screen before it finishes loading. I'm guessing that the white flash I'm seeing is the background colour behind the animation or just behind my loading activity, but I really have no idea. If need be I can send you the APK file so that you can see the white flash for yourself. I can send you the actual source code and you can clearly see what's happening on an emulator or on an actual watch as it happens on both.

Is there a way to change that strange white background to translucent thus there will be no white flash and it should only see the AW dark grey background that AW creates before opening activities on watch faces. The only reason why I can see the white activity background flash is because both my activity and panel background colors are dark grey. When my activity and panel were white I couldn't see the flash because the flash is also white, but now my settings panel are dark gray. Other wears faces on my watch opens up the exact same way as my activity but their activities do not flash up with a white background before actually starting.

Thank you, and I hope that I managed to explain my issue sufficiently enough...
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
I'm pretty sure that you can solve it by setting the activity style in the manifest editor.

Example of creating an activity with a red window (the app starts with a red background):
B4X:
SetApplicationAttribute(android:theme, "@style/LightTheme")
CreateResource(values, theme.xml,
<resources>
   <color name="clr">#ff0000</color>
  <style name="LightTheme" parent="@android:style/Theme.Material.Light">
  <item name="android:windowBackground">@color/clr</item>
  </style>
</resources>
)
 

Peter Simpson

Expert
Licensed User
Longtime User
Good morning @Erel,
Okay you have me there Erel, I did previous look at style sheets but none of mine have "android:windowBackground" inside them, actually I've never seen that one before and that's why I posted this under wish/but and not question.

Yes you were correct, it worked perfect perfect.

I'm now reading this https://developer.android.com/guide/topics/ui/look-and-feel/themes.html.

Thank you again.
 
Last edited:
Top