Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Transparent panel with Umano SlidingUpPanel

I have created a sliding layout using the Umano code: https://github.com/umano/AndroidSlidingUpPanel

It works perfectly, but I have one problem. My panel should be partly transparent, so the original view is still visible when it's up.

The view background is set properly to #64000000, but it is still completely opaque and nothing can be seen behind it.

Here's the code:

<com.sothree.slidinguppanel.SlidingUpPanelLayout
            android:id="@+id/sliding_up_panel"
            android:layout_height="match_parent"
            android:layout_width="match_parent">

    <ImageView
            android:layout_height="match_parent"
            android:layout_width="match_parent"
            android:scaleType="fitCenter"
            android:id="@+id/images_gallery_image" />

    <RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="match_parent"
            android:background="#64000000">

            <!-- MY STUFF (transparent stuff) -->

    </RelativeLayout>
</com.sothree.slidinguppanel.SlidingUpPanelLayout>

I thought maybe the issue is caused by hiding of UI elements underneath the expanded panel, so I tried to play around in the library code, but it doesn't seem to be related.

While debugging, I have noticed that hasOpaqueBackground(View v) in line 355 of the library does return false, as expected - but the view still is opaque.

like image 835
Josh Liberty Avatar asked Dec 25 '22 17:12

Josh Liberty


1 Answers

The support for this has been added in the library. Just set overlay attribute to true, and set the color of the panel to transparent.

like image 137
tokudu Avatar answered Dec 31 '22 14:12

tokudu