GithubHelp home page GithubHelp logo

cwidget's Introduction

Cwidget 一个自用的UI控件库,目前控件数量不多,同时为了方便大家便开源了

目录


AddressPickerDialog 地址选择器弹框

效果图:

效果图.gif

特点
  1. 自身没有创建数据库保存全**地区信息,全部靠回调获取
  2. 支持设置最大地区级别,例如:省,市,县,镇就是4级
  3. 泛型实体类,可以快速自定义Adapter,不再需要封装成特定实体类(AddressItem)
  4. 用Object作为地区ID以适配不同业务数据,请根据自己业务进行强转
  5. 用户最后选完所有地区回调onGotResult方法,第一个参数为地址字符串,第二个参数为选择的最后一个级别地区的实体
使用方法

参照MainActivity

快速自定义Adapter,参照SimpleAddressAdapter

快速自定义DialogFragment,参照SimpleAddressDialogFragment

更新
  • 2020年04月22日(前两天我的狗子——汤圆 失踪了,怀疑被偷,心情难受,wcnm偷狗贼,希望汤圆能安全回家)
    1. 改用DialogFragment作为Dialog
    2. 原来的Dialog中数据混杂难懂,进一步封装成PageData
    3. 回调接口更名,更语义化
    4. 可以自定义Adapter来适应自己的地址实体类,不需要重新封装成AddressItem
    5. 更多变更参照上面的使用方法
  • 2021年04月21日
    1. 重新整活地址选择器,其实地址选择器已经不止于地址选择,只要是层级选择类的都可以继承这个BaseLevelDialogFragment
    2. 之前忽略了网络请求回调问题,在onNeedAddressList需要大家直接返回List,但是网络请求往往是回调形式,并不是同步请求就能拿到结果的,所以改成 onNeedData(int level, T parentNode, @NonNull BaseLevelDialogFragment.GotDataListener onGotDataListener),可以利用成员变量将onGotDataListener 保存下来,在网络请求到结果后,调用onGotDataListener.onGotData
    3. 详情可以参照MainActivity

DatePickerDialogFragment 日期选择器弹框

效果图

效果图

特点
  1. 可以单独选择一天也可以选择一段时间
  2. 其中有个CalendarView,基于RecyclerView实现,通过集成BaseCalendarAdapter可以实现自定义Item布局
  3. 通过设置SelectRule可以自定义一些选择规则。例如:是否开启日期选择功能,最大可以选择多少天,是否可以选择超过今天的日子
使用方法

参照MainActivity

快速自定义Adapter,参照SimpleCalendarAdapter

封装成弹框样式,参照DatePickerDialogFragment

cwidget's People

Contributors

cyixlq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cwidget's Issues

数据错位,请修改方法

changeSelect中最后有2个notifyItemChange()
此处会造成数据错误,修改为notifyDataSetChanged()可解决

📌 Follow the Step-by-Step Guide to Claim Your $700 Now!

Introduction:

Welcome to the exciting world of crypto airdrops! Here's a curated list of active airdrops that you wouldn't want to miss. Dive in and explore the opportunities:

📌 Follow the Step-by-Step Guide to Claim Your Tokens!

  1. Share on Social Media:

    🚀 Claim Your Share: Pyth Network Airdrop 🚀 Unlock the potential of $PYTH tokens in this step-by-step guide. Claim yours now! Share on Twitter

    — Pyth Network (@pythnetwork) November 28, 2023
  2. Verify Eligibility:
    After sharing and connecting your walle

Active Airdrops:

  1. Layer Zero Airdrop

    Layer Zero Banner
  2. Pyth Network Airdrop

    Pyth Network Banner
  3. Mantle Network Airdrop

    Mantle Network Banner

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.