
The main detail is to set the correct android:theme for your activity in the AndroidManifest.xml. For Tech Buzz Widget we used android:theme="@android:style/Theme.Translucent.NoTitleBar"
So the activity looked like this:
<activity android:name=".FullArticleView" class=".FullArticleView"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:configChanges="orientation|keyboardHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
Once you've done that you you'll see that any elements of your layout that are transparent or unfilled will show through onto the underlying application or desktop. To make this more obvious in Tech Buzz we put a margin around the entire layout.
The exact details of all the activity themes available in the current Android platform are available in the Android source here: http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/res/res/values/themes.xml
Search for Theme.Translucent and you'll get the idea. There are fullscreen themes as well if you want to get rid of the notification bar. You can also define your own themes in a similar way.
No comments:
Post a Comment