Git Product home page Git Product logo

gamefilterdemo's Introduction

GameFilterDemo

模仿ExpandListView展开效果,并且实现单选和多选

1最近在开发一个电竞项目,在赛事列表中一个个筛选的功能, 实现的效果: (1)、选择游戏 比赛类型 比赛状态,比赛热点,这些都是动态展示。 (2)、要求每项数据如果是大于3项,则显示右方伸展箭头,如果小于3,则 不显示箭头。点击箭头时候可以自由伸展数据。 (3)、筛选项可以单选或者多选。 (4)、默认赛选项数据显示第一行。如果数据大于3,也默认只显示第一行。

传统的ExpandListVieww我尝试了,满足不了产品要实现的效果。于是乎,我就另辟蹊径,采用动态添加方式,添加每个筛选类型的数据。具体实现思路如下: (1)、采用RecycleView或者listView用来展示列表数据,然后在adapter进行判断每项数据的大小。adapter中添加一个linearlayout布局,然后在里面动态添加每一行的数据。 (2)、在添加数据的时候,对长度进行求余,以及除数运算,用来设置最后一行数据显示几个数据。 (3)、单选多选时候,先给没想数据设置一个额外的参数ischecked=false,单选点击时候,刷新单选列表中的其他项,多选时候,给该选项设置true.

gamefilterdemo's People

Contributors

yyz1218 avatar

Watchers

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