Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action bar shows as white when alpha is 0. #3

Open
inktomi opened this issue Jun 19, 2013 · 1 comment
Open

Action bar shows as white when alpha is 0. #3

inktomi opened this issue Jun 19, 2013 · 1 comment

Comments

@inktomi
Copy link

inktomi commented Jun 19, 2013

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>
@thebaddie
Copy link

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants