Holo theme missing while using Transucent activity

dsirio75

Member
Licensed User
Longtime User
Hi all, i have a little problem with an app:

I target to sdk 15 and all works fine, holo theme on android 4 devices is there, but not for one of my activities.

I edited manifest file to get transparent activity like this
B4X:
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="15"/>
...
SetActivityAttribute(myActivity, android:theme, @android:style/Theme.Translucent.NoTitleBar)

This works but all the objects on the activity looks Gingerbread like.
How can i get Holo style with transparent activities?

Thanks
 

Ian Garton

Member
Licensed User
Longtime User
I discovered this issue today, and solved it by doing the following --

1/ Create a text file called styles.xml in ..\objects\res\values
2/ Paste in the following code --
B4X:
<?xml version="1.0" encoding="utf-8"?>
<resources>
  <style name="Theme.Transparent" parent="android:Theme.Holo.Light">
    <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>

3/ Save and make the file read-only.

4/ In your b4a project's manifest editor, use the following --
B4X:
SetActivityAttribute(YourActivityName, android:theme, @style/Theme.Transparent)
 

corwin42

Expert
Licensed User
Longtime User

tdocs2

Well-Known Member
Licensed User
Longtime User
I discovered this issue today, and solved it by doing the following --

1/ Create a text file called styles.xml in ..\objects\res\values
2/ Paste in the following code --
B4X:
<?xml version="1.0" encoding="utf-8"?>
<resources>
  <style name="Theme.Transparent" parent="android:Theme.Holo.Light">
    <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>

3/ Save and make the file read-only.

4/ In your b4a project's manifest editor, use the following --
B4X:
SetActivityAttribute(YourActivityName, android:theme, @style/Theme.Transparent)

Thank you, Ian.

Please see this thread:

http://www.b4x.com/android/forum/th...cts-behavior-of-some-views.44932/#post-275212

Best regards.

Sandy
 
Top