How to create sliding drawer in both sides opposite to one another?

谁说胖子不能爱 提交于 2019-12-05 18:08:57

I got the answer here statically its not exactly possible to create sliding ,and we cant use android:rotation=180 ,as because it will display error as no resource found, We have to create it programatically.it needs to add view in layout.

In case of single side its simple by using widget only no need any views..But the views are needed when you want to slide in multiple direction.

<SlidingDrawer
  android:id="@+id/drawer"
  android:layout_width="match_parent"
     android:layout_height="match_parent"
  android:orientation="horizontal"
  android:handle="@+id/handle"
  android:content="@+id/content">
  <ImageView 
   android:id="@+id/handle"
   android:layout_width="wrap_content"
   android:layout_height="fill_parent" 
   android:src="@drawable/tag"/>

  <LinearLayout
      android:id="@+id/content"
      android:layout_width="wrap_content"
      android:layout_height="fill_parent"
      android:background="@drawable/slidimage"
      android:orientation="vertical"
      android:padding="10dp" >
 <TextView
            android:id="@+id/text1"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_marginTop="15dp"
            android:layout_marginLeft="51dp"
            android:text="SIGN-UP"
            android:textColor="#000000"
            android:textSize="28dp"
            android:textStyle="bold" />

  </LinearLayout>
 </SlidingDrawer>

activity.java:

@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.slider);

}
mark.kedzierski

I've created a replacement widget for SlidingDrawer, it works in all directions. See This answer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!