GithubHelp home page GithubHelp logo

tanwu520 / expandablelistviewexample Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hexianqiao3755/expandablelistviewexample

0.0 2.0 0.0 2.62 MB

ExpandableListView简单实现商品列表折叠

Java 100.00%

expandablelistviewexample's Introduction


##一、简介 在日常开发,有可能会遇到需要一些可以展开的列表,比如QQ的好友列表。但是,用Android的该怎么做呢?其实在我没有接触过ExpandableListView类之前,都是自定义控件继承于ListView或者ListView嵌套ListView来实现的, 当然也不推荐大家这样使用, 这样使用会降低app页面的加载速度和性能. 然后,后来发现了Android也给我们提供了ExpandableListView类,完美实现这样类似的需求, 极大的方便了我们开发.

##二、使用

引用, AndroidStudio使用Gradle构建添加依赖(推荐)

  • compile 'com.facebook.fresco:fresco:0.9.0'
  • compile 'com.zhy:autolayout:1.4.5'

使用到的第三方框架

Demo来自某个线上电商app的页面, 使用前先看看效果图 demo演示

####1. 如果子条目需要响应click事件,必需返回true

    @Override
    public boolean isChildSelectable(int groupPosition, int childPosition) {
        return true;
    }

####2. 去除掉默认的关闭和打开状态的图片(系统默认的不好看)

android:groupIndicator="@null"

####3. 解决无法正常展开问题

//HorizontalScrollView
hsv_goods_list.setFocusable(false)

expandablelistviewexample's People

Contributors

hexianqiao3755 avatar

Watchers

James Cloos 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.