2

I am using sliding panel foursquare library and as i open the panel activity i found panel to be expanded by default but i wan to set it to be collapse by default so please tell me how to do that?

As i slide down the panel or collapse it sliding layout get of 40 DP in height but i want it to be of 100 DP minimum.

So please tell me how and where to make changes to have these two things in my app?

what i have tried so far is that changed attributes these field in the sliding panel widget but none of them is working for me

collapseMap();
slidingUpPanelLayout.hidePane()
slidingUpPanelLayout.collapsePane();


app:paralaxOffset="@dimen/paralax_offset"
 app:shadowHeight="0dp"
 app:dragView="@+id/sliding_container"
 app:panelHeight="40dp"
Edward
  • 139
  • 3
  • 9
  • Where did you set the states; inside `onCreate()`? Maybe you can read the wiki at the original SlidingUpPanelLayout from Umano https://github.com/umano/AndroidSlidingUpPanel – ecle Jul 11 '15 at 07:02
  • @eee i have resolved my one problem regarding setting sliding panel layout to be collapsed by default but please tell me how to change the height of the collapsed panel – Edward Jul 11 '15 at 07:09

2 Answers2

3

sliding panel foursquare library is actually implementing this library:https://github.com/umano/AndroidSlidingUpPanel

and i have used this AndroidSlidingUpPanel library and for this I used mSlideLayout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);

So i hope this code will help you.

Amit Vaishnava
  • 306
  • 3
  • 15
2

You can set the default state from the layout xml file itself. Add the below attributes to the com.sothree.slidinguppanel.SlidingUpPanelLayout

app:umanoInitialState="collapsed"

For collapsed panel height

app:umanoPanelHeight="100dp"
Samuel Robert
  • 10,106
  • 7
  • 39
  • 60