Coder Social home page Coder Social logo

msoftware / animated-expanding-listview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from leonardocardoso/animated-expanding-listview

0.0 2.0 0.0 898 KB

Animated Expanding ListView provides a fancy animation on expanding or collapsing the content of a listview item.

Home Page: android.leocardz.com/animated-expanding-listview/

License: Apache License 2.0

Java 100.00%

animated-expanding-listview's Introduction

Animated-Expanding-ListView

Build Status Android Arsenal

Developed by @LeonardoCardoso.

Animated Expanding ListView provides a fancy animation on expanding or collapsing the content of a listview item.

It works in all version of Android and it's very easy to adapt to your project.

How to use with Gradle

Simply add the repository to your build.gradle file:

repositories {
	jcenter()
	maven { url 'https://github.com/leonardocardoso/mvn-repo/raw/master/maven-deploy' }
}

And you can use the artifacts like this:

dependencies {
	compile 'com.leocardz:aelv:1.1@aar'
	// ...
}

Important

  • Your list adapter must extend ArrayAdapter<? yourListItem ?>
  • Your listview item must extend from AelvListItem
    • Right after you create your listview item, you need to call yourItem.setUp(int collapsedHeight, int expandedHeight, boolean isOpen); to setup the dimensions.
  • Your listview item view holder must extend from AelvListViewHolder
    • Right after you instantiate your view holder you need to call yourHolder.setViewWrap(viewWrap); and tell adapter that you are updating the item size calling holder.getViewWrap().setLayoutParams(new AbsListView.LayoutParams(AbsListView.LayoutParams.MATCH_PARENT, listItem.getCurrentHeight()));.
    • Right before you return the view on your custom adapter, you must call yourItem.setHolder(yourHolder);
  • You need to instantiate Aelv aelv = new Aelv(isAccordion, animationDuration, yourListItems, yourListView, yourAdapter); right after you setup your listview.
  • Last thing: your must implement listview.setOnItemClickListener(); and insert this aelv.toggle(view, position); inside the listener and voilà!

Just check the app example to see it clearly.

For more details, visit http://android.leocardz.com/animated-expanding-listview/

Normal Accordion
Normal Accordion

Contact

If you are using this lib, let me know contacting me at [email protected] then I add your app here in a list

License

Copyright 2014 Leonardo Cardoso

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.

animated-expanding-listview's People

Contributors

leonardocardoso avatar

Watchers

Michael jentsch 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.