Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.
walkingice edited this page May 31, 2012 · 6 revisions

This project tries to provide a demo of widget AnimationLayout since I saw a question from StackOverflow. The widget, AnimationLayout, works like Facebook Android app, it placed a sliding sidebar in left side.

How to build this demo app

if you use command line to build android app

$ git clone git://github.com/walkingice/gui-sliding-sidebar.git
$ cd gui-sliding-sidebar
$ android update project -p .
$ ant debug install

How to use the widget

  1. Add ids.xml to res/values directory of your repository
  2. Add AnimationLayout.java to your repository
  3. update statment "import org.zeroxlab.demo.R;" of AnimationLayout.java according to your namespace. (i.e. import my.app.R;)
  4. apply AnimationLayout to your layout xml
  5. define view @id/animation_layout_sidebar and @id/animatino_layout_content

Layout xml

<?xml version="1.0" encoding="utf-8"?>
<org.zeroxlab.widget.AnimationLayout
  xmlns:android="http://schemas.android.com/apk/res/android">
    <MySidebarView android:id="@id/animation_layout_sidebar ">
        ....
    </MySidebarView>

    <MyContentView android:id="@id/animation_layout_content">
        ....
    </MyContentView>
</org.zeroxlab.widget.AnimationLayout>

Functions

You could use these functions to control AnimationLayout

  • public boolean isOpening
  • public void openSidebar
  • public void closeSidebar
  • public void toggleSidebar: open sidebar if it is closing. close sidebar if it is opening.
  • public void setListener

and you can implement AnimationLayout.Listener to monitor status of Sidebar

Clone this wiki locally