Android UI widget
Clone or download
Latest commit 1c18d7a Nov 22, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
gradle/wrapper Migrate to Android X Nov 13, 2018
swipe-layout bump version Nov 21, 2018
testapp Migrate to Android X Nov 13, 2018
.gitignore init commit Jan 19, 2016
CHANGELOG.MD bump version Nov 21, 2018
README.md bump version Nov 21, 2018
build.gradle Migrate to Android X Nov 13, 2018
gradle.properties Migrate to Android X Nov 13, 2018
gradlew update dependencies Jun 30, 2018
gradlew.bat init commit Jan 19, 2016
settings.gradle init commit Jan 19, 2016

README.md

Swipe Layout

Flexible Android Widget

sample

Download

Download via Gradle:

implementation 'ru.rambler.android:swipe-layout:1.0.17'

Usage

Swipe Layout may contain up to 3 children with left, right or center gravity attributes.

You could disable swipe completely calling method setSwipeEnabled(false) or using XML-attribute 'app:swipe_enabled="false'

To disable swipe from one of the side you could use methods setLeftSwipeEnabled(false) and setRightSwipeEnabled(false) or via XML:

<ru.rambler.libs.swipe_layout.SwipeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="@dimen/item_height"
    app:left_swipe_enabled="false"
    app:right_swipe_enabled="true"/>

Full list of widget attributes can be found here.

<ru.rambler.libs.swipe_layout.SwipeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="@dimen/item_height">

    <!--CENTER. app:gravity="center" - is default value -->
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        
        ...
    </LinearLayout>

    <!--RIGHT-->
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:gravity="right"
        app:bring_to_clamp="150dp"
        app:clamp="self"        
        app:sticky="100dp">

        ...
    </LinearLayout>

    <!--LEFT-->
    <FrameLayout
        android:layout_width="200dp"
        android:layout_height="match_parent"
        app:gravity="left"
        app:bring_to_clamp="100dp"
        app:clamp="self"        
        app:sticky="none">

        ...
    </FrameLayout>
</ru.rambler.libs.swipe_layout.SwipeLayout>

License

Licensed under the Apache License, Version 2.0 (the "License");

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