Skip to content
A togglelayout that can be used in setting interface
Java
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
demo add DropDownLayout Sep 2, 2015
gradle/wrapper first commit Aug 30, 2015
library add DropDownLayout Sep 2, 2015
.gitignore
LICENSE add license and update readme Aug 30, 2015
README.md Fix broken Markdown headings Apr 18, 2017
build.gradle first commit Aug 30, 2015
gradle.properties
gradlew
gradlew.bat
settings.gradle Update settings.gradle Aug 31, 2015

README.md

ToggleExpandLayout

Android Arsenal

A togglelayout that can be used in setting interface. Originally designed by dribbble. And the author said that's why he designed this:

I never liked how some settings are disabled by default and not tappable until another settings has been turned on/off.

My concept is to hide these disabled settings behind their "master toggle" and then have them transition out as they become active - making the list cleaner, with less clutter and ultimately easier to use.

Preview

toggleexpandlayout

Usage

  • XML

if yout just use one togglelayout:

 <com.fenjuly.mylibrary.ToggleExpandLayout
        android:id="@+id/toogleLayout"
        android:layout_marginTop="15dp"
        android:layout_marginLeft="15dp"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        >

        <View
            android:id="@+id/view1"
            android:layout_width="300dp"
            android:layout_height="80dp"
            android:background="#ffffff"
            android:elevation="2dp"
            android:outlineProvider="bounds"
            >
        </View>
        <View
            android:id="@+id/rootView"
            android:layout_width="300dp"
            android:layout_height="80dp"
            android:background="#ffffff"
            android:elevation="2dp"
            android:outlineProvider="bounds"
            >
        </View>
    </com.fenjuly.mylibrary.ToggleExpandLayout>

if yout want to use more than one togglelayouts with drop and rise animation, use DropDownLayout:

 <com.fenjuly.mylibrary.DropDownLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="15dp"
        android:layout_marginLeft="15dp"
        >

    <com.fenjuly.mylibrary.ToggleExpandLayout
        android:id="@+id/toogleLayout"
        android:layout_marginTop="15dp"
        android:layout_marginLeft="15dp"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        >
        ...
    </com.fenjuly.mylibrary.ToggleExpandLayout>
    
    <com.fenjuly.mylibrary.ToggleExpandLayout
        android:id="@+id/toogleLayout"
        android:layout_marginTop="15dp"
        android:layout_marginLeft="15dp"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        >
        ...
    </com.fenjuly.mylibrary.ToggleExpandLayout>
    </com.fenjuly.mylibrary.DropDownLayout>
  • JAVA

two methods public void open() and public void close()

layout.setOnToggleTouchListener(new ToggleExpandLayout.OnToggleTouchListener() {
            @Override
            public void onStartOpen() {
            }

            @Override
            public void onOpen() {
            }

            @Override
            public void onStartClose() {
            }

            @Override
            public void onClosed() {
            }
        });

###Get into your build

repositories {
    maven {
        url "https://jitpack.io"
    }
}

dependencies {
    compile 'com.github.fenjuly:ToggleExpandLayout:774e497692'
}

###License

MIT

You can’t perform that action at this time.