Using SlidingPaneLayout from the right-hand side?
Asked Answered
I

2

8

Is it possible to somehow use Android's SlidingPaneLayout to do exactly what it does except from the opposite side?

I.e. I want to bezel swipe the right-hand side of the screen instead of the left-hand side to expose the second pane, and it slides in from the right instead of the left.

Ideally I'm looking for a way to do it with this layout, or a modification of it.

Infidel answered 5/8, 2013 at 13:30 Comment(2)
Hi saimonjingai, did get any solution for moving SlidingPaneLayout to right.. pls help me out if u have found...Teens
Did any of you figure this out?Brian
C
0

i think it is possible, just as this one did it from the bottom. check the difference between it and the original code, and you will know how to do it.

Christinchristina answered 12/9, 2013 at 17:19 Comment(2)
That's not Slidingpanelayout, that's a new library.Simulacrum
true. still, it has plenty of features and is the only one that worked fine for me.Christinchristina
E
0

I have not tried it yet but i dont see why it would't work with something like this:

<android.support.v4.widget.SlidingPaneLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/sliding_pane_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<fragment
    android:id="@+id/content_pane"
    android:name="package.DetailFragment"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_weight="1"
    android:paddingLeft="16dp"
    android:paddingRight="16dp"
    android:layout_marginRight="60dp"

    />

<fragment
    android:id="@+id/list_pane"
    android:name="package.MyListFragment"
    android:layout_width="300dp"
    android:layout_height="match_parent"
    android:layout_gravity="left"
    />

This way you would have the ListFragment on the right side. Now which one you want to have opened first is up to you. If you wanted to have the left side showing first you'd need to have something like this in the onCreate method of your MainActivity:

    private SlidingPaneLayout mSlidingLayout;
    mSlidingLayout = (SlidingPaneLayout) findViewById(R.id.sliding_pane_layout);

    mSlidingLayout.setPanelSlideListener(new SliderListener());
    mSlidingLayout.openPane();

even tho i'm late i hope this helps.

Emlen answered 2/9, 2014 at 6:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.