Note that there are some explanatory texts on larger screens.

plurals
  1. POCombining NavigationDrawer and SlidingPaneLayout - SlidingPaneLayout from the right possible?
    primarykey
    data
    text
    <p>I'm using a <code>NavigationDrawer</code> as main menu in my app. Some of my fragments use the <code>SlidingPaneLayout</code>.</p> <p>At the moment, I show the <code>NavigationDrawer</code> on the right and the <code>SlidingPaneLayout</code>on the left, always a little bit visible.</p> <p>But I would like to have the <code>NavigationDrawer</code> on the left side and the <code>SlidingPaneLayout</code> on the right side (like in Hangouts) always a little bit visible.</p> <p><strong>Question:</strong></p> <p>I know how to get the <code>NavigationDrawr</code> to the other side, but I can't find out how (if possible) to move the <code>SlidingPaneLayout</code> to the right side? So that it slides in from the right...</p> <p><strong>my solution</strong></p> <pre><code>&lt;android.support.v4.widget.SlidingPaneLayout android:id="@+id/sliding_pane_layout" android:layout_width="match_parent" android:layout_height="match_parent" &gt; &lt;LinearLayout android:id="@+id/fragment_main_container" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="left" android:layout_marginRight="0dp" android:orientation="vertical" &gt; &lt;include android:layout_width="match_parent" android:layout_height="wrap_content" layout="@layout/card_toast_container" /&gt; &lt;FrameLayout android:id="@+id/fragment_main" android:layout_width="match_parent" android:layout_height="match_parent" /&gt; &lt;/LinearLayout&gt; &lt;!-- marginLeft: set it to width - 150 in your code!!! --&gt; &lt;FrameLayout android:id="@+id/fragment_slider" android:layout_width="150dp" android:layout_height="match_parent" android:layout_gravity="right" android:layout_marginLeft="0dp" /&gt; &lt;/android.support.v4.widget.SlidingPaneLayout&gt; </code></pre> <p>and use some wrapping methods like for example following, for easier and more readable code:</p> <pre><code>public boolean isSliderMenuShown() { return !mSlidingLayout.isOpen(); } public static void openSlider(boolean isSliderLeft, MySlidingPaneLayout slidingLayout) { slidingLayout.closePane(); } public static void closeSlider(boolean isSliderLeft, MySlidingPaneLayout slidingLayout) { slidingLayout.openPane(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload