Tuesday 22 April 2014

Sliding drawer with its Function

Sliding drawer with its Function

XML Layout


<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
   android:background="@drawable/bgtwo"
    tools:ignore="MergeRootFrame" >
    
    
    <SlidingDrawer
        android:id="@+id/SlidingDrawer01"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:content="@+id/LinearLayout01"
        android:handle="@+id/Button05"
        android:orientation="vertical"
        android:padding="10dip" >

        <Button
            android:id="@+id/Button05"
            android:layout_width="100dp"
            android:layout_height="90dp"
            android:background="@drawable/arrow_up" />

        <LinearLayout
            android:id="@+id/LinearLayout01"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:orientation="horizontal" >

            <Button
                android:id="@+id/sendme"
                android:layout_width="200dp"
                android:layout_height="200dp"
                android:layout_margin="10dp"
                android:background="@drawable/sendme" />

            <Button
                android:id="@+id/sendall"
                android:layout_width="200dp"
                android:layout_height="200dp"
                android:layout_margin="10dp"
                android:background="@drawable/sendall" />

            <Button
                android:id="@+id/position"
                android:layout_width="200dp"
                android:layout_height="200dp"
                android:layout_marginLeft="100dp"
                android:background="@drawable/position" />
        </LinearLayout>
    </SlidingDrawer>
 </FrameLayout>




Add caption







Java Class




public class HomeActivity extends ActionBarActivity {
SlidingDrawer slidingDrawer;



protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);



slidingDrawer.setOnDrawerOpenListener(new OnDrawerOpenListener() {
public void onDrawerOpened() {
Button05.setBackgroundResource(R.drawable.arrow_down);
}
});



slidingDrawer.setOnDrawerCloseListener(new nDrawerCloseListener() {
public void onDrawerClosed() {
Button05.setBackgroundResource(R.drawable.arrow_up);
}
});
}



}


No comments:

Post a Comment

How to do text writing animation?  In Android Development we do not have the option to use any other custom font in our default Tex...