Skip to content

aaironman/StretchPanelDemo

Repository files navigation

StretchPanelDemo

The layout that can stretch with animation.

Instruction

The layout that can stretch with animation.You can add the listener of the animation and deal with what you want.

Usage

##Layout

<com.example.widget.StretchPanel
        xmlns:stretch="http://schemas.android.com/apk/res-auto"
        android:id="@+id/stretchPanel"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_marginTop="10dp"
        stretch:contentView="@layout/view_content"
        stretch:stretchView="@layout/view_stretch"
        android:padding="2dip" >
    </com.example.widget.StretchPanel>

##Init with code

 // if no ids of the view in xml
    final StretchPanel panel = (StretchPanel) findViewById(R.id.stretchPanel);
    final View contentView = View.inflate(this, R.layout.view_content, null);
    final View stretchView = View.inflate(this, R.layout.view_stretch, null);
    panel.setStretchView(stretchView);
    panel.setContentView(contentView);
    panel.setStretchAnimationDuration(200);
    panel.setHandleClikeEventOnThis(contentView);//set the view response the click event
 // have the id in xml
    final StretchPanel panel = (StretchPanel) findViewById(R.id.stretchPanel);
    panel.setHandleClikeEventOnThis(panel.getContentView());

About

The layout that can stretch with animation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages