materialExpansionPanel

Expansion panels contain creation flows and allow lightweight editing of an element.

Github星跟踪图

Material Expansion Panel, Expansion panels contain creation flows and allow lightweight editing of an element., , ----------------------------------------------------------------------------------------------, -----------, Android Arsenal API Download

Setup

Gradle:

Add following line of code to your module(app) level gradle file

    implementation 'com.robertlevonyan.view:MaterialExpansionPanel:2.0.7'

Maven:

<dependency>
  <groupId>com.robertlevonyan.view</groupId>
  <artifactId>MaterialExpansionPanel</artifactId>
  <version>2.0.7</version>
  <type>pom</type>
</dependency>

Usage

<com.robertlevonyan.views.expandable.Expandable
        android:id="@+id/expandable"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <include
            android:id="@+id/header"
            layout="@layout/header_view" />

        <include
            android:id="@+id/content"
            layout="@layout/content_view" />
</com.robertlevonyan.views.expandable.Expandable>
```, ![alt text](https://github.com/robertlevonyan/materialExpansionPanel/blob/master/Images/collapsed.jpg), ![alt text](https://github.com/robertlevonyan/materialExpansionPanel/blob/master/Images/expanded.jpg), ----------------------------------------------------------------------------------------------, -----------, Material Expansion Panel in action

![alt text](https://github.com/robertlevonyan/materialExpansionPanel/blob/master/Images/process.gif)

### Attributes, Custom Atributes, Description, --------------------------------, ----------------------------------------------------------, `app:exp_icon`, Icon for Expandable Header, `app:exp_iconStyle`, Set style for header icon: square, circle or roundedSquare, `app:exp_animateExpand`, Animate expand of layout, `app:exp_backgroundColor`, Set a custom background color for layout, `app:exp_expandIndicator`, Select custom drawable for expand indicator, ### Setting Listeners

```kotlin
    val expandable = findViewById(R.id.expandable);

Set expand listener

Kotlin

    expandable.doOnExpand {
        //some stuff on expand
    }

    expandable.doOnCollapse {
        //some stuff on collapse
    }

Java

    expandable.setExpandingListener(new ExpandingListener() {
            @Override
            public void onExpanded() {
                //some stuff on expand
            }

            @Override
            public void onCollapsed() {
                //some stuff on collapse
            }
        });

Customizing Expandable from code

    expandable.icon = myIconDrawable // Icon for Expandable Header
    expandable.iconStyle = ExpandableIconStyles.SQUARE // Set style for header icon: square, circle or roundedSquare
    expandable.animateExpand = true // Animate layout expanding
    expandable.backgroundColor = myBackgroundColor // Set a custom background color for layout
    expandable.expandIndicator = myExpandDrawable // Select custom drawable for expand indicator

Versions

2.0.1 - 2.0.7

Several bug fixes

2.0.0

New version of the library. Fully rewritten with Kotlin and AndroidX ready ?

1.2.0

RecyclerView issue fixed

1.1.0

New version with bug fixes

1.0.0

First version of library

Contact

Licence

    Material Expansion Panel©
    Copyright 2017 Robert Levonyan
    Url: https://github.com/robertlevonyan/materialExpansionPanel

    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.

主要指标

概览
名称与所有者robertlevonyan/material-expansion-panel
主编程语言Kotlin
编程语言Kotlin (语言数: 1)
平台
许可证Apache License 2.0
所有者活动
创建于2017-10-03 07:16:51
推送于2023-10-27 12:28:10
最后一次提交2023-10-27 16:27:33
发布数0
用户参与
星数140
关注者数8
派生数28
提交数55
已启用问题?
问题数13
打开的问题数2
拉请求数0
打开的拉请求数0
关闭的拉请求数0
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?