首页 » Andorid » 临时分类 » 正文

ToggleExpandLayout

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:







if yout want to use more than one togglelayouts with drop and rise animation, use 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

下载 (0)

发表评论