Skip to content

Latest commit

 

History

History
66 lines (53 loc) · 1.73 KB

README.md

File metadata and controls

66 lines (53 loc) · 1.73 KB

SwipeSectorLayout

The inspiration for this project comes from Dima Panchenko's post on Dribbble.

Screenshots

alt tag

Gradle

compile 'tw.lychee:SwipeSectorLayout:1.1.0'

Usage

layout

<tw.lychee.swipecurvelayout.SwipeSectorLayout
      android:layout_width="match_parent"
      android:layout_height="300dp"
      android:id="@+id/container"
      app:item_width="80dp"
      app:degree="100"
      >
      <!--Custom Semi-circular -->
      <ImageView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentBottom="true"
          android:layout_centerHorizontal="true"
          android:src="@drawable/circle"
          android:layout_marginBottom="-680dp"
          android:layout_marginLeft="-200dp"
          android:layout_marginRight="-200dp"
          />
</tw.lychee.swipecurvelayout.SwipeSectorLayout>

code

SwipeSectorLayout swipeSectorLayout = (SwipeSectorLayout) findViewById(R.id.container);
swipeSectorLayout.setAdapter(new ImageAdapter() {
    @Override
    public void setItemView(int position, ImageView view) {

    }

    @Override
    public void setBackgroundView(int position, ImageView view) {

    }

    @Override
    public int getCount() {
        return 0;
    }
});

swipeSectorLayout.setOnPageChangeListener(new SwipeSectorLayout.OnPageChangeListener() {
    @Override
    public void onPageSelected(int position) {
        
    }
});

You can find complete demo code here