xmuSistone / ViewpagerTransition

viewpager with parallax pages, together with vertical sliding (or click) and activity transition
3.04k stars 508 forks source link

Is there an option to expand/collapse the draglayout by calling a method manually? #7

Closed anitaa1990 closed 7 years ago

anitaa1990 commented 7 years ago

Hi,

I would like to be able to expand the draglayout without any click function. Please let me know if this is possible at the moment and if so, how would I go about doing that?

Thanks for the awesome library!! You rock!

xmuSistone commented 7 years ago

Yeah, it is easy to expand the draglayout. Wrap the onClick function into a new public method, hope that helps.

anitaa1990 commented 7 years ago

Hi, I checked it out and had a doubt. How do we collapse the draglayout? In the clickListener there is an option to expand the draglayout and then open the detail screen. No option to collapse the layout.

Could you please guide on how to do this?

xmuSistone commented 7 years ago

add a new method as follows:

public void collapse() {
      if (mDragHelper.smoothSlideViewTo(topView, originX, originY)) {
                ViewCompat.postInvalidateOnAnimation(DragLayout.this);
      }
}
iman2420 commented 5 years ago

dragLayout.performClick(); not work! how to expand manually?