FadingActionBar-Native
FadingActionBar-Native copied to clipboard
Action bar shows as white when alpha is 0.
On Android 4.2.2 this action bar shows as white, rather than transparent. It does fade in when the user scrolls the content down, but it fades in from White rather than from Transparent.
FadingActionBarHelper helper = new FadingActionBarHelper()
.actionBarBackground(R.drawable.ab_solid_tinsel)
.headerLayout(R.layout.fragment_profile_header)
.contentLayout(R.layout.fragment_profile)
.lightActionBar(false);
setContentView(helper.createView(this));
helper.initActionBar(this);
Here is the profile_header:
<?xml version="1.0" encoding="utf-8"?>
<ImageView android:id="@+id/profile_avatar"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:contentDescription="@string/content_desc_avatar"/>
And here is the main contentLayout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/windowBackground"
android:orientation="vertical">
<!-- TextViews here -->
</LinearLayout>
The action bar style is:
<style name="ActionBar.Solid.Tinsel" parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
<item name="android:background">@drawable/ab_solid_tinsel</item>
<item name="android:backgroundStacked">@drawable/ab_stacked_solid_tinsel</item>
<item name="android:backgroundSplit">@drawable/ab_bottom_solid_tinsel</item>
<item name="android:progressBarStyle">@style/ProgressBar.Tinsel</item>
</style>
Maybe the problem is on how you are loading Cyril's Translucent theme.
Using AppTheme as theme name be sure to modifiy your AndroidManifest as follow:
<application
...
android:theme="@style/AppTheme" >
...
<activity
android:name=".YourActivity"
android:theme="@style/AppTheme.TranslucentActionBar" >
</activity>
</application>