A togglelayout that can be used in setting interface

Overview

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

Comments
  • gradle build failed

    gradle build failed

    Error:(48, 13) Failed to resolve: com.github.fenjuly:ToggleExpandLayout:9de3036 Show in File Show in Project Structure dialog

    my Project level gradle: buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:1.3.0' classpath 'com.google.gms:google-services:1.4.0-beta3' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } }

    allprojects { repositories { maven { url "https://jitpack.io" } jcenter() mavenCentral() } }

    My modul level gradle: dependencies { compile 'com.github.fenjuly:ToggleExpandLayout:774e497692' }

    opened by akashk1992 5
  • something lost

    something lost

    the 774e497692(com.github.fenjuly:ToggleExpandLayout:774e497692),when i build,find something lost.

    the class(com.fenjuly.mylibrary.DropDownLayout) never find.

    opened by ligenxun 4
  • java.lang.NoSuchMethodError: android.view.View.setElevation

    java.lang.NoSuchMethodError: android.view.View.setElevation

    Demo app is crashing log is here

    Process: com.fenjuly.toggleexpandlayout, PID: 4599 java.lang.NoSuchMethodError: android.view.View.setElevation at com.fenjuly.toggleexpandlayout.MainActivity$1.onOpen(MainActivity.java:36) at com.fenjuly.mylibrary.ToggleExpandLayout$1.onAnimationEnd(ToggleExpandLayout.java:93)

    opened by mfpolat 4
  • Simple ClassNotFoundException

    Simple ClassNotFoundException

    If I try the DEMO example I get an exception. See trace.

    My layout.xml looks like this:

    `

      <com.fenjuly.mylibrary.ToggleExpandLayout
            android:id="@+id/toogleLayout1"
            android:layout_marginTop="15dp"
            android:layout_marginLeft="15dp"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            >
    
            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                >
                <TextView
                    android:id="@+id/menu"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="8dp"
                    android:layout_marginLeft="8dp"
                    android:text="Automatic date and time"
                    />
                <TextView
                    android:layout_below="@+id/menu"
                    android:layout_marginTop="4dp"
                    android:layout_marginLeft="8dp"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="Use network provide time"
                    android:textColor="#cccccc"/>
                <com.kyleduo.switchbutton.SwitchButton
                    android:id="@+id/switch_button"
                    android:layout_alignParentRight="true"
                    android:layout_marginRight="10dp"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:padding="16dp"/>
            </RelativeLayout>
    
        </com.fenjuly.mylibrary.ToggleExpandLayout>
    
    </com.fenjuly.mylibrary.DropDownLayout>
    

    `

    Trace:

    ` FATAL EXCEPTION: main Process: com.artursworld.nccn, PID: 2427 android.view.InflateException: Binary XML file line #37: Binary XML file line #37: Error inflating class com.fenjuly.mylibrary.DropDownLayout Caused by: android.view.InflateException: Binary XML file line #37: Error inflating class com.fenjuly.mylibrary.DropDownLayout Caused by: java.lang.ClassNotFoundException: Didn't find class "com.fenjuly.mylibrary.DropDownLayout" on path: DexPathList[[zip file "/data/app/com.artursworld.nccn-2/base.apk"],nativeLibraryDirectories=[/data/app/com.artursworld.nccn-2/lib/x86, /system/lib, /vendor/lib]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) at java.lang.ClassLoader.loadClass(ClassLoader.java:380) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) at android.view.LayoutInflater.createView(LayoutInflater.java:609) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:787) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727) at android.view.LayoutInflater.rInflate(LayoutInflater.java:858) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821) at android.view.LayoutInflater.inflate(LayoutInflater.java:518) at android.view.LayoutInflater.inflate(LayoutInflater.java:426) at android.view.LayoutInflater.inflate(LayoutInflater.java:377) at com.afollestad.materialdialogs.MaterialDialog$Builder.customView(MaterialDialog.java:1068) at com.artursworld.nccn.view.user.UserStartConfiguration.showConfigurationDialog(UserStartConfiguration.java:29) at com.artursworld.nccn.view.StartMenu.onNavigationItemSelected(StartMenu.java:55) at android.support.design.widget.NavigationView$1.onMenuItemSelected(NavigationView.java:151) at android.support.v7.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:810) at android.support.v7.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:152) at android.support.v7.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:957) at android.support.design.internal.NavigationMenuPresenter$1.onClick(NavigationMenuPresenter.java:318) at android.view.View.performClick(View.java:5610) at android.view.View$PerformClick.run(View.java:22260) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6077) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)

    `

    Do you have any ideas?

    opened by lidox 2
  • DropDownLayout not scrolling

    DropDownLayout not scrolling

    I'm using com.fenjuly.mylibrary.DropDownLayout which contains 10 ToggleExpandLayout. It is not scrolling. How can I enable scrolling so that I can use more number of ToggleExpandLayout in the activity.

    opened by vino4all 2
  • Fix broken headings in Markdown files

    Fix broken headings in Markdown files

    GitHub changed the way Markdown headings are parsed, so this change fixes it.

    See bryant1410/readmesfix for more information.

    Tackles bryant1410/readmesfix#1

    opened by bryant1410 0
  • Expansion Layout is clipped when added in scrollview.

    Expansion Layout is clipped when added in scrollview.

    When I add the DropDownLayout in scrollview the hidden layout clips at bottom on expansion.

    The clipped size is same as the header size(visible view).

    opened by ghost 1
Owner
Rongchan Liu
Rongchan Liu
Android library used to create an awesome Android UI based on a draggable element similar to the last YouTube graphic component.

Draggable Panel DEPRECATED. This project is not maintained anymore. Draggable Panel is an Android library created to build a draggable user interface

Pedro Vicente Gómez Sánchez 3k Jan 5, 2023
Android library used to create an awesome Android UI based on a draggable element similar to the last YouTube New graphic component.

Please switch to DragView, for the best support, thank you DraggablePanel Download allprojects { repositories { ... maven { url 'https://jitp

Hoàng Anh Tuấn 103 Oct 12, 2022
SwipeBack is an android library that can finish a activity by using gesture.

SwipeBack SwipeBack is a android library that can finish a activity by using gesture. You can set the swipe direction,such as left,top,right and botto

Eric 1.7k Nov 21, 2022
A 3D Layout for Android,When you use it warp other view,it can became a 3D view,一秒让你的view拥有3D效果!

ThreeDLayout A 3D Layout,When you use it warp other view,it can became a 3D view 中文文档 preview USAGE 1.compile library allprojects { repositories {

androidwing 490 Oct 27, 2022
Make Android DrawerLayout can be dragged out in real-time within the range of fullscreen

FullDraggableDrawer Make the DrawerLayout can be dragged/pulled out in real-time within the range of fullscreen, like Pure Writer: * Full demo video:

Pure Writer 264 Nov 29, 2022
Draftsman is an on device layout inspector which can be embedded in your android app.

Draftsman Draftsman is an on-device layout inspector for Android apps. It allows you to view various properties of rendered Android Views such as widt

Gojek 243 Dec 22, 2022
A util for setting status bar style on Android App.

StatusBarUtil A util for setting status bar style on Android App. It can work above API 19(KitKat 4.4). 中文版点我 Sample Download StatusBarUtil-Demo Chang

Jaeger 8.8k Jan 7, 2023
Customizable Item Setting View Android

ItemSettingView Simple ItemSettingView and Custom Installation Add it in your root build.gradle at the end of repositories: allprojects { reposito

Andhika Yuana 15 Aug 19, 2022
A util for setting status bar style on Android App.

StatusBarUtil A util for setting status bar style on Android App. It can work above API 19(KitKat 4.4). 中文版点我 Sample Download StatusBarUtil-Demo Chang

Jaeger 8.8k Jan 6, 2023
Custom & highly configurable seek slider with sliding intervals, disabled state and every possible setting to tackle!

LabeledSeekSlider Custom & highly configurable seek slider with sliding intervals, disabled state and every possible setting to tackle! Minimum target

Edgar Žigis 78 Sep 27, 2022
Android project setup files when developing apps from scratch. The codebase uses lates jetpack libraries and MVVM repository architecture for setting up high performance apps

Android architecture app Includes the following Android Respository architecture MVVM Jepack libraries Carousel view Kotlin Kotlin Flow and Livedata P

null 2 Mar 31, 2022
Kotlin Gradle plugins for conveniently setting up Kotlin projects (JVM/MPP), publishing, Dokka, etc

Arrow Gradle config Add basic config to a Kotlin Multiplatform project In an Arrow KMP project, just add to the plugin block: plugins { kotlin("mu

ΛRROW 8 Aug 3, 2022
Helmet secures your spring Webflux or MVC app by setting various HTTP headers

Helmet Helmet secures your spring Webflux or MVC app by setting various HTTP headers. This is a 1:1 copy of Helmet.js Quick start Add https://jitpack.

Dušan 1 Oct 28, 2021
Skip the process of setting up a new android project!

Android-Project-Template Skip the process of setting up an android app by using this template. Prerequisites Have an idea about: Clean Architecture De

Kibet 7 Aug 1, 2022
MiscQS - Some random custom Quick Setting tiles

MiscQS Provides custom Quick Setting tiles for three system settings: Dynamic Br

null 0 Jan 6, 2022
Open as default - A flutter plugin that allows setting up your flutter app to open files as default

open_as_default A flutter plugin that allows setting up your flutter app to open

LuisDeLaValier 3 Nov 15, 2022
A setting library for Jetpack Compose with Material You design

ComposeSetting This is a basic Compose setting library that provides a basic Material3 setting components It also provides a persistent state system b

RE 13 Nov 10, 2022