0

I'm using SlidingPaneLayout to make a Custom drawer menu, I need to disable the draggable event to only display my costume Drawer by making click on my toolbar navigation button, the structure of my activity_main is:

Main Activity

<android.support.v4.widget.SlidingPaneLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/slidingPaneLayout"
    android:clickable="false"
    android:scrollbarAlwaysDrawHorizontalTrack="false"
    tools:context=".MainActivity.MainActivity">

    <!--Costume Drawer fragment-->
    <fragment
        android:name="com.epcon.pdhgto.android.MenuFragment.MenuFragment"
        android:layout_width="80dp"
        android:layout_height="match_parent"
        android:id="@+id/menu_master"
        android:elevation="10dp">
    </fragment>
    <!--Fragment-->
    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:clickable="true"
        android:id="@+id/mainFrameLayout"
        >

    </FrameLayout>

</android.support.v4.widget.SlidingPaneLayout>

In other words I need to disable horizontal scroll on my main activity. I have tried this already: https://stackoverflow.com/a/36447209/6308377 and I have also implemented on my xml android:scrollbarAlwaysDrawHorizontalTrack but this isn't working.

Manuel Miranda
  • 105
  • 1
  • 1
  • 7

1 Answers1

0

try this in your mainactivity

view.setHorizontalScrollBarEnabled(false);

or put this in your xml file

android:scrollbars="none"

Also if you want to make a custom menu for your app you should check out navigation drawer

Joaquín
  • 1,116
  • 1
  • 10
  • 26