Giter VIP home page Giter VIP logo

expandablelayout's Introduction

ExpandableLayout

A expandable Layout to save space and reduce jump between Activity and Fragment ####

USE

Project

It had been used in project KnowWeather,you can learn more.

SimpleUse

intro

Use in RecyclerView

parent view scroll automatically if the view expand out of device screen,

(当展开时如果超过屏幕的高度时父控件自动上移)

intro

Use in ListView

parent view not scroll automatically if the view expand out of device screen

(当展开时如果超过屏幕的高度时父控件不自动上移)

intro

(It runs smoothly, but gif is not appear well) sample.apk

Attention

scroll automatically function not perform well in listview so far.but it perform well in RecyclerView

Adding to your project

This library is available through JitPack.

Step 1. Add the JitPack repository to your build file

gradle

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

maven

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

Step 2. Add the dependency

gradle

compile 'com.github.SilenceDut:ExpandableLayout:1.2.0'

maven

<dependency>
    <groupId>com.github.SilenceDut</groupId>
    <artifactId>ExpandableLayout</artifactId>
    <version>{latest-version}</version>
</dependency>

Basic Usage

Supported Attributes

attr default mean
expDuration 300 expand duration.
expWithParentScroll false parent view should scroll automatically if the view expand out of device screen(当展开时如果超过屏幕的高度是父控件否自动上移).
expExpandScrollTogether false parent view should scroll together with view expanding.
ExpandableLayout inherited from LinearLayout,and the default Orientation is VERTICAL
<com.silencedut.expandablelayout.ExpandableLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    app:expWithParentScroll="true"
    app:expDuration = "300"
    app:expExpandScrollTogether = "false"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <layout1
    ...
    />
    
    <layout2
    ...
    />

</com.silencedut.expandablelayout.ExpandableLayout>

License

Copyright 2015-2016 SilenceDut

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.

expandablelayout's People

Contributors

silencedut avatar tomafc330 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.