Giter VIP home page Giter VIP logo

cartlayout's Introduction

CartLayout(严格说应该叫 CartAdapter 的,现在将错就错吧 😀)

GitHub issues   GitHub forks   GitHub stars

使用纯原生 RecyclerView 实现购物车效果(高仿京东购物车、淘宝购物车、天猫购物车)。不要问我为什么不使用 ExpandableListView (爱过,被坑的次数多了,就不爱了)。

Demo 中主要实现以下功能(基本上购物车的功能全实现了):

  • 商品列表通过店铺进行分组显示;
  • 勾选店铺,联动店铺下的所有商品勾选;勾选商品,联动店铺的勾选;
  • 全选功能实现:联动商品、店铺的勾选按钮,反向联动亦然;
  • 实现编辑购物车商品的功能:点击编辑 > 删除勾选的商品;
  • 实现商品 item 长按弹出选项菜单,进行单个商品删除等操作功能;
  • 支持列表头部添加 tips ;
  • 统计勾选商品的个数、勾选商品价格等。

Version Code

CartAdapter效果图

使用方法:

To get a Git project into your build:

Step 1. Add the JitPack repository to your build file

Add it in your root build.gradle at the end of repositories:

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

Step 2. Add the dependency

dependencies {
        implementation 'com.github.OCNYang:CartLayout:v1.0.1'
}

更详细的使用方法请查看 Demo,Demo中实现方式和各方法的作用在注释中写的很详细。

APK下载地址

cartlayout's People

Contributors

ocnyang 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.