Code Monkey home page Code Monkey logo

Comments (12)

tokudu avatar tokudu commented on September 23, 2024

By default, the sliding content part doesn't overlap the main content. The main content actually has a bottom margin of the height of the sliding panel. So what you are seeing is the white background of your outer relative layout - try changing that.

from androidslidinguppanel.

josomers avatar josomers commented on September 23, 2024

Can someone provide an example? I can't figure this out. I get a solid background color for my dragger view, but transparency won't work...

from androidslidinguppanel.

felipe-silvestre-morais avatar felipe-silvestre-morais commented on September 23, 2024

I have the same problem. I tried change to transparent color all views, but didn't work.
When fixed, please let me know.

from androidslidinguppanel.

MrXo avatar MrXo commented on September 23, 2024

A sample would indeed be very helpful.

Is the manipulation of the view margin part of the DragViewHelper or do you manually calculate the bounds of the main view?

from androidslidinguppanel.

tokudu avatar tokudu commented on September 23, 2024

Post your layout, it would be easier to notice what you are doing wrong.

The bounds of the main view are manually calculated based on the height of the sliding panel.

from androidslidinguppanel.

MrXo avatar MrXo commented on September 23, 2024

Based on your hint I fixed it myself. For everyone interested in drawing behind the slider, simply change the protected boolean drawChild(final Canvas canvas, final View child, final long drawingTime) method to not clip the bounds of the canvas:

if (!mDrawBehind && mCanSlide && !lp.slideable && mSlideableView != null) {
            // Clip against the slider; no sense drawing what will immediately be covered.
            canvas.getClipBounds(mTmpRect);
            mTmpRect.bottom = Math.min(mTmpRect.bottom, mSlideableView.getTop());
            canvas.clipRect(mTmpRect);
            if (mSlideOffset < 1) {
                drawScrim = true;
            }
        }

The new mDrawBehind variable allows to always draw the background when set to true.

from androidslidinguppanel.

ShakeJ avatar ShakeJ commented on September 23, 2024

Thanks you for your open Source!

Have a plan support 'Transparent'?

********* I reslove.
in XML, layout Backgorund transparent color change,
I edit slidingUpPanelLayout.java
protected boolean drawChild(Canvas canvas, View child, long drawingTime)

canvas.clipRect(mTmpRect); <~ this line delete
And Trasparent well. Thanks.

from androidslidinguppanel.

sagarwanojwar01 avatar sagarwanojwar01 commented on September 23, 2024

Hi I have commented the line
canvas.clipRect(mTmpRect); in my code, but the layout bcomes transparent only when its expanded.

When the layout is collapsed it is not transparent.

I have modified the code so that the panel slides to 0.5f. i.e half of the screen

Why so???

Please refer the images.
Thanks in Advance.
screenshot_2013-10-10-10-09-47
screenshot_2013-10-10-10-09-52

from androidslidinguppanel.

sagarwanojwar01 avatar sagarwanojwar01 commented on September 23, 2024

Please refer the above images.

from androidslidinguppanel.

sagarwanojwar01 avatar sagarwanojwar01 commented on September 23, 2024

Hi ,
SlidingUpPanelLayout needs to have 2 children . My requirement is that the PeekingOut height of 2nd child should be transparent. This works fine if the first child is an Imageview or Text view, but if the first child is LinearLayout with its own children then we get a white background for the PeekingOut height as can be seen from the images i have uploaded before.

Can anyone help me to find a solution to make that white background transparent.
Thanks in advance!

from androidslidinguppanel.

sagarwanojwar01 avatar sagarwanojwar01 commented on September 23, 2024

Thanks ShakeJ.

Actually the margin for 1st child was causing the problem.
Resolved it by removing the margin.

from androidslidinguppanel.

tokudu avatar tokudu commented on September 23, 2024

Transparency support has been added in da90ba7. You should simply set overlay to true, and then change the background color of the sliding child to whatever you desire.

from androidslidinguppanel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.