Giter Site home page Giter Site logo

praveer-rai / swipelistview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from davidtpate/swipelistview

0.0 2.0 0.0 300 KB

An enhanced ListView for Android providing swiping capabilities for items for Android 2.2+

License: Apache License 2.0

Shell 1.69% Java 98.31%

swipelistview's Introduction

SwipeListView Build Status

SwipeListView is a standalone library that is designed to facilitate using swipe motions in an Android ListView to reveal something behind the item.

For usage instructions please see the website.

Continuous integration is provided by Travis CI.

Gradle

repositories {
    mavenCentral()
}

dependencies {
    compile('com.davidtpate:swipelistview:0.+@aar')
}

Maven

Downloadable .jars can be found on Maven.

You can also depend on the .jar through Maven:

<dependency>
    <groupId>com.davidtpate</groupId>
    <artifactId>swiplistview</artifactId>
    <version>(insert latest version)</version>
</dependency>

Usage

List

<com.davidtpate.swipelistview.SwipeListView
        xmlns:swipeListView="http://schemas.android.com/apk/res-auto"
        android:id="@+id/list"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        swipeListView:frontViewId="@+id/front"
        swipeListView:backViewId="@+id/back"
        swipeListView:closeAllWhenScrolling="[true | false]"
        swipeListView:openOnLongPress="[true | false]"
        swipeListView:swipeDirection="[both | left | right]"/>
  • frontViewId - Required - The generated id of the front of the list item.
  • backViewId - Required - The generated id of the back of the list item to be revealed.
  • closeAllWhenScrolling - Optional - Enable/disable closing all currently revealed items when the list is scrolled. Default - true
  • openOnLongPress - Optional - Enable/disable long press revealing and hiding the list item that was long pressed. Default - true
  • swipeDirection - Optional - Enable/disable directional gestures. Setting this to left only allows swiping items left, etc. Default - both

List Item

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:descendantFocusability="blocksDescendants">

    <LinearLayout
        android:id="@+id/back"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="horizontal"
        android:visibility="gone">

        <ImageButton
            android:id="@+id/ib_view"
            android:src="@drawable/ic_action_picture"/>

        <ImageButton
            android:id="@+id/ib_save"
            android:src="@drawable/ic_action_save"/>

        <ImageButton
            android:id="@+id/ib_share"
            android:src="@drawable/ic_action_share"/>

        <ImageButton
            android:id="@+id/ib_open"
            android:src="@drawable/ic_action_globe"/>

    </LinearLayout>

    <LinearLayout
        android:id="@+id/front"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="horizontal">
        <TextView
            android:id="@+id/tv_text"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:padding="15dp"/>

    </LinearLayout>
</FrameLayout>

Developed By

License

Copyright 2014 David Pate

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

swipelistview's People

Contributors

davidtpate avatar

Watchers

James Cloos avatar Praveer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.