Android Question Translucent Theme affects behavior of some views

tdocs2

Well-Known Member
Licensed User
Longtime User
Greetings, all. Thank you in advance for answering my question.

Objective: Want some transparent activities.
Obviously want consistency in appearance and UI through all of the activities.

Target: Android v4+
Views: Progress Bar, Spinner, Toggle button
B4X:
Manifest Editor:
SetActivityAttribute(main, android:theme, "@android:style/Theme.Translucent")

The Progress Bar goes back to pre V4 behavior.
The Spinner goes back to pre V4 behavior.
The Toggle button text cannot be centered vertically - it appears towards the top no matter the setting.

Any and all help will be welcomed.

Best regards.

Sandy
 

barx

Well-Known Member
Licensed User
Longtime User
try

B4X:
@android:style/Theme.Holo.Light.Panel
 
Upvote 0

tdocs2

Well-Known Member
Licensed User
Longtime User
try

B4X:
@android:style/Theme.Holo.Light.Panel

Thank you, BarX.

The solution addresses the Progress Bar and the Toggle button.

It raises other issues - color of Msgbox (now white previously black), EditText, the spinners do drop down but do not show the underline and dropdown arrow. The spinners are color black text black; dropdown white dropdown text black.

Any other suggestions?

I have to test further.

Best regards.

Sandy
 
Upvote 0

tdocs2

Well-Known Member
Licensed User
Longtime User

Thank you, Erel.

I will take a look at the link and report back.

REPORT
I changed the xml a bit to add NoActionBar to the Theme
B4X:
<?xml version="1.0" encoding="utf-8"?>
<resources>
  <style name="Theme.Transparent" parent="android:Theme.Holo.Light.NoActionBar">
    <item name="android:windowNoTitle">true</item>
    <item name="android:background">@android:color/transparent</item>
    <item name="android:windowBackground">@android:color/transparent</item>
    <item name="android:colorBackgroundCacheHint">@null</item>
    <item name="android:windowIsTranslucent">true</item>
    <item name="android:windowAnimationStyle">@android:style/Animation</item>
  </style>
</resources>

There are some behavioral UI differences similar to BarX first solution.

Msgbox is white background, black letters. I happen to like the reverse, but all other apps show white background, black letters.
Edit Box is black background and black letters by default.
Progressbar behaves 4.+ style.
Spinners same issue - it is good enough - it does drop down.
REPORT END

I think the behavioral differences are easy to correct or in the case of the Msgbox colr scheme, easy to accept. I know I could get Corwin's or NJDude (although they are non-modal) Msgboxes - always an option.

Thank you, Erel, for the help that you give us.

My thanks also to BarX and to Ian Garton, who posted the response in Erel's link.


Best regards.

Sandy
 
Last edited:
Upvote 0
Top