0

I am trying to use SlidingPaneLayout , I am having this weird behavior that i can slide the left panel as well which is the ListView , I thought it is something wrong in my code but turned out that even the API demos have the same issue. This issue occurs on phone but not on tablets.

Any ideas ?

Edit: I have S4 and when running the API Demos on it it works with no issues, and I have S1 the demos having the issue above. In my implementation I am using two FrameLayout that I place Fragment in.

Moh Sakkijha
  • 2,705
  • 1
  • 14
  • 19

2 Answers2

3

I figured the issue out , I have set the width of the left pane which contains the list to a width greater than the available width, and that was causing the issue, setting a smaller width fixed my issue.

Moh Sakkijha
  • 2,705
  • 1
  • 14
  • 19
  • +1*infinity for you Saksak. You made my day! I had to make my left pane fill with width with MATCH_PARENT instead of giving it a width. – Jimmy Ilenloa May 18 '14 at 01:45
0

This is a default behaviour of the SlidingPaneLayout, when you swipe from the extreme left of your screen towards the middle. Check out the Hangouts app as the example.

It's designed that the layout will try and show up as much of the views a it can. So for example when on landscape on the Nexus 7 and greater it will show the conversations and the detail view at the same time. At this point the swipe left-to-right wouldn't make sense. But when you move down to a smaller screen device such as a portait Nexus 7 or phone then the conversation pane is obscured. As a result at that point you want to be able to swipe the detail pane out of the way from the conversation view.

This Big Nerd Ranch post has more details.

Take a look at this question for an approach to disable it.

Community
  • 1
  • 1
marcus.ramsden
  • 2,633
  • 1
  • 22
  • 33
  • I thought Gmail & Google Play Store uses DrawerLayout not the slidingpanelayout , if it is the default behaviour why it is not happenning on tablets ? – Moh Sakkijha Jan 14 '14 at 21:04
  • and by the way overriding the interceptTouchListener will disable the whole sliding experience even for the right side which I want it to be sliddable – Moh Sakkijha Jan 14 '14 at 21:10
  • in my case when on phone and conversations pane is shown and visible, I can slide it to the right even though it should not be slidable because the slidable view is the details view, got me or I am not making things clear ? – Moh Sakkijha Jan 14 '14 at 21:19
  • Ah ok, I understand now. That is odd. – marcus.ramsden Jan 14 '14 at 21:21
  • yeah it is, try it out with the support demo it has the same issue – Moh Sakkijha Jan 14 '14 at 21:22