a.black13
a.black13

Reputation: 2157

SlidingUpPanelLayout how make not draggable

i'm develop app & use in my project custom view SlidingUpPanelLayout (https://github.com/umano/AndroidSlidingUpPanel) In my case at one of functions moment panel must be don't draggable (in case that content is in full screen mode). How i can make this?

Thanks

Upvotes: 2

Views: 2235

Answers (3)

Shahab Rauf
Shahab Rauf

Reputation: 3931

Use slidingUpPanelLayout.setTouchEnabled(false); to disable the dragging.

Upvotes: 5

a.black13
a.black13

Reputation: 2157

My solution:

 public void changeFullScreenMode(int visible) {
        if (visible == View.VISIBLE) {
            isFullScreen = true;
            getSupportActionBar().hide();
            dragViewLayParams = drawView.getLayoutParams();
            dragViewLayParams.height = 0;
            drawView.setLayoutParams(dragViewLayParams);
        } else {
            isFullScreen = false;
            getSupportActionBar().show();
            dragViewLayParams = drawView.getLayoutParams();
            dragViewLayParams.height = absoluteDragViewHeight;
            drawView.setLayoutParams(dragViewLayParams);
        }
    }

Upvotes: 0

user1923305
user1923305

Reputation: 51

Use the setSlidingEnabled(false) when you don't want the panel to be able to slide. This also prevents dragging.

Upvotes: 0

Related Questions