{"id":13642518,"url":"https://github.com/yanbober/SlideLayout","last_synced_at":"2025-04-20T16:32:35.743Z","repository":{"id":92868534,"uuid":"78316305","full_name":"yanbober/SlideLayout","owner":"yanbober","description":"一个超级迷你轻量级全方向完美侧滑控件，兼容各种嵌套与被嵌套滑动控件。","archived":false,"fork":false,"pushed_at":"2017-01-13T12:33:03.000Z","size":454,"stargazers_count":268,"open_issues_count":2,"forks_count":41,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-11-09T13:39:04.645Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yanbober.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-01-08T02:14:54.000Z","updated_at":"2024-11-02T04:51:04.000Z","dependencies_parsed_at":"2023-04-23T11:17:05.327Z","dependency_job_id":null,"html_url":"https://github.com/yanbober/SlideLayout","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/yanbober%2FSlideLayout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yanbober%2FSlideLayout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yanbober%2FSlideLayout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yanbober%2FSlideLayout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yanbober","download_url":"https://codeload.github.com/yanbober/SlideLayout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249926487,"owners_count":21346572,"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":[],"created_at":"2024-08-02T01:01:32.510Z","updated_at":"2025-04-20T16:32:35.428Z","avatar_url":"https://github.com/yanbober.png","language":"Java","readme":"# SlideLayout\n\n纯手工超级迷你轻量级全方向完美滑动处理侧滑控件（比官方 support v4 包 SlidingPaneLayout 控件更加 Q 迷你，累计代码不足 300 行），支持上下左右有各种侧拉，可配置侧拉松手临界距离，支持单独使用、ListView、GridView、RecycleView、ScrollView、ViewPager 等各种嵌套（作为 item 使用或者作为以上所有控件的父容器使用），具体不同配置展示效果如下图。\n\n\u003cdiv\u003e\u003cimg src=\"art/demo.gif\" width=\"350\"\u003e\u003c/div\u003e\n\n# 说明文档\n\n如下是关于 SlideLayout 的相关使用方式、属性说明、拓展自定义的解释说明。\n\n### 使用样例\n\n实现类似手机 QQ 侧滑效果，ListView 向右侧滑拉出侧边栏。\n```xml\n\u003ccn.yan.library.SlideLayout\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    app:slideDirection=\"fromLeft\"\n    app:slideCriticalValue=\"50dp\"\u003e\n    \u003cListView\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:entries=\"@array/demo_array\"/\u003e\n\n    \u003cTextView\n        android:background=\"@android:color/holo_red_light\"\n        android:layout_width=\"100dp\"\n        android:layout_height=\"match_parent\"\n        android:text=\"我是侧滑区域\"/\u003e\n\u003c/cn.yan.library.SlideLayout\u003e\n```\n\n实现类似手机 QQ ListView 聊天列表任意 item 向左滑动呼出删除按钮效果。\n```xml\n\u003ccn.yan.library.SlideLayout\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"80dp\"\u003e\n    \u003cTextView\n        android:id=\"@+id/content_id\"\n        android:gravity=\"center\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"/\u003e\n\n    \u003cLinearLayout\n        android:layout_width=\"200dp\"\n        android:layout_height=\"match_parent\"\n        android:orientation=\"horizontal\"\u003e\n        \u003cTextView\n            android:id=\"@+id/slide_id\"\n            android:background=\"@android:color/holo_blue_dark\"\n            android:layout_width=\"100dp\"\n            android:layout_height=\"match_parent\"\n            android:text=\"删除\"/\u003e\n\n        \u003cTextView\n            android:id=\"@+id/slide1_id\"\n            android:background=\"@android:color/holo_green_dark\"\n            android:layout_width=\"100dp\"\n            android:layout_height=\"match_parent\"\n            android:text=\"收藏\"/\u003e\n    \u003c/LinearLayout\u003e\n\u003c/cn.yan.library.SlideLayout\u003e\n```\n\n### 已实现类说明\n\n| 类别 | 类名 | 说明 |\n| ----- | ----- | ----- |\n| library | SlideLayout | 支持配置各种方向侧滑和各种嵌套或者被嵌套的侧滑控件。 |\n\n### 属性说明\n\n| 属性 | 含义 |\n| ----- | ----- |\n|app:slideCriticalValue | SlideLayout 任意方向侧滑拉出多大距离后松手敏感距离，譬如侧滑大于 50dp 后松手则自动滑开，小于 50 dp 内松手则自动收起；不设置默认为 SlideLayout 控件第二个子成员 width 的二分之一。|\n|app:slideDirection | 侧滑从哪边拉出，默认为从右侧拉出，可取值为 fromRight、fromLeft、fromTop、fromBottom。 |\n\n### SlideLayout 提供方法说明\n\n| 方法 | 说明 |\n| ----- | ----- |\n| int getSlideState() | 获取当前侧滑控件所处状态，STATE_CLOSE、STATE_SLIDING、STATE_OPEN。 |\n| void smoothCloseSlide() | 平滑的收起侧滑。 |\n| void smoothOpenSlide() | 平滑的打开侧滑。 |\n\n### SlideLayout 使用注意事项\n\nSlideLayout 控件有且必须包含两个子控件，第一个为 content 布局，默认撑满整个 SlideLayout，第二个为 slide 布局，默认不可见；切记两个子控件所处顺序，子控件层级不限，具体模板如下：\n\n```\n\u003ccn.yan.library.SlideLayout\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\u003e\n    \u003c控件一（Content），不限嵌套层级等，默认可见/\u003e\n\n    \u003c控件二（slide），不限嵌套层级等，默认不可见/\u003e\n\u003c/cn.yan.library.SlideLayout\u003e\n```\n\n# License 声明\n\nMIT License\n\nCopyright (c) 2016 yanbo\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","funding_links":[],"categories":["滑动删除"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyanbober%2FSlideLayout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyanbober%2FSlideLayout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyanbober%2FSlideLayout/lists"}