{"id":20497402,"url":"https://github.com/wuhenzhizao/android-sku","last_synced_at":"2025-10-24T05:16:45.231Z","repository":{"id":45979627,"uuid":"101844421","full_name":"wuhenzhizao/android-sku","owner":"wuhenzhizao","description":"🔥 Android Sku属性选择器, 类似于淘宝，天猫，京东，支持MVVM，直接使用","archived":false,"fork":false,"pushed_at":"2021-11-23T08:49:19.000Z","size":3026,"stargazers_count":549,"open_issues_count":5,"forks_count":82,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-29T13:09:01.367Z","etag":null,"topics":["android","android-sku","selector","sku"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wuhenzhizao.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-30T06:12:26.000Z","updated_at":"2025-02-05T05:59:52.000Z","dependencies_parsed_at":"2022-07-20T04:18:07.031Z","dependency_job_id":null,"html_url":"https://github.com/wuhenzhizao/android-sku","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wuhenzhizao%2Fandroid-sku","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wuhenzhizao%2Fandroid-sku/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wuhenzhizao%2Fandroid-sku/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wuhenzhizao%2Fandroid-sku/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wuhenzhizao","download_url":"https://codeload.github.com/wuhenzhizao/android-sku/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247345853,"owners_count":20924102,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-sku","selector","sku"],"created_at":"2024-11-15T18:10:58.653Z","updated_at":"2025-10-24T05:16:40.193Z","avatar_url":"https://github.com/wuhenzhizao.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sku\nAndroid Sku选择器, 类似于淘宝，天猫，京东，支持多维属性，购物车动画，支持MVVM架构，可以直接使用\n\n[Demo下载](https://fir.im/seyb)\n\n功能描述\n=======\n1. 支持多维属性，库存为空判断；\n2. 支持设置选中指定的sku；\n3. 支持手动输入数量；\n\n\u003cdiv style=\"float:left;border:solid 1px 000;margin:5px;\"\u003e\n\t\u003cimg src=\"screenshots/20171201_131459.gif\" alt=\"screenshot\" title=\"20171201_131459.gif\" width=\"300\"\u003e\n\t\u003cimg src=\"screenshots/20171201_131516.gif\" alt=\"screenshot\" title=\"20171201_131516.gif\" width=\"300\"\u003e\n\u003c/div\u003e\n\n添加依赖\n=======\n[![Download](https://api.bintray.com/packages/wuhenzhizao/maven/sku/images/download.svg) ](https://bintray.com/wuhenzhizao/maven/sku/_latestVersion)\n\n```xml\nbuildscript {\n    allprojects {\n        repositories {\n            jcenter()\n        }\n    }\n}\n\ndependencies {\n    compile 'com.wuhenzhizao:sku:1.0.4'\n}\n```\n\n绑定数据\n-------\n\n```java\nSkuSelectScrollView.setSkuList(List\u003cSku\u003e skuList);\n```\n\n设置选中的sku(一个sku时，默认选中）\n-------\n\n```java\nSkuSelectScrollView.setSelectedSku(Sku sku);\n```\n\n\n设置监听\n-------\n\n```java\nSkuSelectScrollView.setListener(new OnSkuListener() {\n    /**\n     * 属性取消选中\n     *\n     * @param unselectedAttribute\n     */\n    public void onUnselected(SkuAttribute unselectedAttribute) {}\n\n    /**\n     * 属性选中\n     *\n     * @param selectAttribute\n     */\n    public void onSelect(SkuAttribute selectAttribute) {}\n\n    /**\n     * sku选中\n     *\n     * @param sku\n     */\n    public void onSkuSelected(Sku sku) {});\n```\n\n使用MVVM架构 \n---------- \n  \n组件提供[SkuViewDelegate](library/src/main/java/com/wuhenzhizao/sku/view/SkuViewDelegate.java)来对MVVM模式下的交互进行支持 \n\n```xml\n\u003cSkuSelectScrollView\n    xmlns:sku=\"http://schemas.android.com/apk/res-auto\"\n    android:id=\"@+id/sku_databinding\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\"\n    android:layout_marginTop=\"50dp\"\n    sku:skuList=\"@{vm.skuList}\"\n    sku:skuViewDelegate=\"@{vm.delegate}\" /\u003e\n```\n\n技术交流\n======\n|QQ交流群|\n|:---:|\n|\u003cimg src=\"screenshots/qq_group.jpeg\" alt=\"screenshot\"  width=\"200\"\u003e|\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwuhenzhizao%2Fandroid-sku","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwuhenzhizao%2Fandroid-sku","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwuhenzhizao%2Fandroid-sku/lists"}