{"id":20609635,"url":"https://github.com/blankj/swipepanel","last_synced_at":"2025-04-06T05:17:20.820Z","repository":{"id":109048985,"uuid":"178357537","full_name":"Blankj/SwipePanel","owner":"Blankj","description":"Android 侧划，如斯优雅","archived":false,"fork":false,"pushed_at":"2020-12-10T15:26:52.000Z","size":236,"stargazers_count":490,"open_issues_count":1,"forks_count":58,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-03-30T04:09:01.607Z","etag":null,"topics":["anroid","swipeback","swipebackactivity","swipebackhelper","swipebacklayout"],"latest_commit_sha":null,"homepage":"https://blankj.com/2019/04/24/swipe-panel/","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/Blankj.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-29T07:46:25.000Z","updated_at":"2025-03-25T18:41:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"dde56a13-e799-4a9f-82a4-3e9deab4da04","html_url":"https://github.com/Blankj/SwipePanel","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/Blankj%2FSwipePanel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blankj%2FSwipePanel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blankj%2FSwipePanel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blankj%2FSwipePanel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Blankj","download_url":"https://codeload.github.com/Blankj/SwipePanel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247436290,"owners_count":20938533,"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":["anroid","swipeback","swipebackactivity","swipebackhelper","swipebacklayout"],"created_at":"2024-11-16T10:14:05.882Z","updated_at":"2025-04-06T05:17:20.797Z","avatar_url":"https://github.com/Blankj.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SwipePanel（侧划控件）\n\n## Background\n\n对市面上实现的侧划返回不是很满意（仿微信，QQ 通过修改窗口透明坑太多），最终决定还是亲手写一个高实用性的吧，效果如下所示，换个图标，更多划动功能可以由你自己解锁，总共一个 600 多行代码的类，推荐通过阅读源码，你肯定会收获很多哈。\n\n\n## Preview\n\n![layout](https://raw.githubusercontent.com/Blankj/SwipePanel/master/art/layout.png) ![back](https://raw.githubusercontent.com/Blankj/SwipePanel/master/art/back.gif)\n\n\n## Download\n\nGradle:\n```groovy\nimplementation 'com.blankj:swipe-panel:1.2'\n```\n\n\n## How to use\n\n### 动态\n\n```java\nfinal SwipePanel swipePanel = new SwipePanel(this);\nswipePanel.setLeftEdgeSize(SizeUtils.dp2px(100));// 设置左侧触发阈值 100dp\nswipePanel.setLeftDrawable(R.drawable.base_back);// 设置左侧 icon\nswipePanel.wrapView(findViewById(R.id.rootLayout));// 设置嵌套在 rootLayout 外层\nswipePanel.setOnFullSwipeListener(new SwipePanel.OnFullSwipeListener() {// 设置完全划开松手后的监听\n    @Override\n    public void onFullSwipe(int direction) {\n        finish();\n        swipePanel.close(direction);// 关闭\n    }\n});\n```\n\n### 静态\n\n```xml\n\u003ccom.blankj.swipepanel.SwipePanel\n        xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        xmlns:tools=\"http://schemas.android.com/tools\"\n        xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n        android:id=\"@+id/swipePanel\"\n        android:background=\"@color/mediumGray\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        tools:context=\".LayoutSwipePanelActivity\"\n        app:isLeftCenter=\"false\"\n        app:leftEdgeSize=\"100dp\"\n        app:leftSwipeColor=\"@color/colorPrimary\"\n        app:leftDrawable=\"@drawable/base_back\"\u003e\n\n    ...\n\n\u003c/com.blankj.swipepanel.SwipePanel\u003e\n```\n\n\n## API\n\n|方法名                                |属性名                                 |说明|\n|:---:                                |:---:                                 |:---:|\n|setLeft(Top, Right, Bottom)SwipeColor|app:left(top, right, bottom)SwipeColor|设置左（上、右、下）侧颜色|\n|setLeft(Top, Right, Bottom)EdgeSize  |app:left(top, right, bottom)EdgeSize  |设置左（上、右、下）侧触发阈值|\n|setLeft(Top, Right, Bottom)Drawable  |app:left(top, right, bottom)Drawable  |设置左（上、右、下）侧 icon|\n|setLeft(Top, Right, Bottom)Center    |app:isLeft(Top, Right, Bottom)Center  |设置左（上、右、下）侧是否居中|\n|setLeft(Top, Right, Bottom)Enabled   |app:isLeft(Top, Right, Bottom)Enabled |设置左（上、右、下）侧是否可用|\n|wrapView                             |---                                   |设置嵌套在该 view 的外层|\n|setOnFullSwipeListener               |---                                   |设置完全划开松手后的监听|\n|setOnProgressChangedListener         |---                                   |设置进度变化的监听|\n|isOpen                               |---                                   |判断是否被划开|\n|close                                |---                                   |关闭|\n\n\n## [Change Log](https://github.com/Blankj/SwipePanel/blob/master/CHANGELOG.md)\n\n\n## 打个小广告\n\n欢迎加入我的小专栏「**[基你太美](https://xiaozhuanlan.com/Blankj)**」一起学习。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblankj%2Fswipepanel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblankj%2Fswipepanel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblankj%2Fswipepanel/lists"}