{"id":17065970,"url":"https://github.com/jingyeoh/fragmentrigger","last_synced_at":"2025-04-08T00:37:07.518Z","repository":{"id":136144323,"uuid":"110928109","full_name":"JingYeoh/FragmentRigger","owner":"JingYeoh","description":":boom:A powerful library powered by AOP to manage Fragments.（一个基于AOP设计的Fragment管理框架）","archived":false,"fork":false,"pushed_at":"2019-09-18T07:28:38.000Z","size":5857,"stargazers_count":2253,"open_issues_count":31,"forks_count":264,"subscribers_count":59,"default_branch":"master","last_synced_at":"2025-03-31T23:33:55.225Z","etag":null,"topics":["activity-fragment","android","android-library","aop","aspectj","fragment","fragments","swipeback"],"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/JingYeoh.png","metadata":{"files":{"readme":"README-CN.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-16T05:38:53.000Z","updated_at":"2025-03-07T05:31:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"f3039e4b-7899-4439-a1ee-e7d843c353fb","html_url":"https://github.com/JingYeoh/FragmentRigger","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JingYeoh%2FFragmentRigger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JingYeoh%2FFragmentRigger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JingYeoh%2FFragmentRigger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JingYeoh%2FFragmentRigger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JingYeoh","download_url":"https://codeload.github.com/JingYeoh/FragmentRigger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247755560,"owners_count":20990620,"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":["activity-fragment","android","android-library","aop","aspectj","fragment","fragments","swipeback"],"created_at":"2024-10-14T11:05:29.810Z","updated_at":"2025-04-08T00:37:07.496Z","avatar_url":"https://github.com/JingYeoh.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FragmentRigger\n![R](/images/rr.png)\n![i](/images/i.png)\n![g](/images/g.png)\n![g](/images/g.png)\n![e](/images/e.png)\n![r](/images/r.png)\n\n:boom:一个强大的Fragment框架。\n\n![Platform](https://img.shields.io/badge/platform-Androd-green.svg)\n![Download](https://api.bintray.com/packages/jkb/maven/fragment-rigger/images/download.svg)\n![SDK](https://img.shields.io/badge/SDK-12%2B-green.svg)\n![Build](https://img.shields.io/badge/Powered%20by-AsPectJ-blue.svg)\n[![AsPectJ](https://img.shields.io/badge/license-MIT-yellowgreen.svg)](https://github.com/HujiangTechnology/gradle_plugin_android_aspectjx)\n[![JingYeoh](https://img.shields.io/badge/author-JustKiddingBaby-red.svg)](http://blog.justkiddingbaby.com/)\n\n**这可能是使用成本最低的Fragment框架。**  \n**无需继承！！！无需继承！！！无需继承！！！** 重要的话说三遍！！   \n在使用`FragmentRigger`的时候，使用成本只有一行注解！！！  \n**原理：** 是把`Fragment`/`Activity`生命周期相关方法定义为切点，通过ASpectJ绑定并使用代理类进行操作。\n\n### 演示\n\u003e本项目支持常见场景下的`Fragment`操纵方式，如有不支持的场景，欢迎提交[Issues](https://github.com/JustKiddingBaby/FragmentRigger/issues)或者[Email me](mailto:yangjing9611@foxmail.com)\n\n|Stack manager|Show|Lazy loading|Replace|\n|:-----------:|:-----:|:---------:|:------:|\n|\u003cimg src=\"/images/start.gif\" width = \"200px\"/\u003e|\u003cimg src=\"/images/show.gif\" width = \"200px\"/\u003e|\u003cimg src=\"/images/lazyload.gif\" width = \"200px\"/\u003e|\u003cimg src=\"/images/replace.gif\" width = \"200px\"/\u003e|\n\n### 目标\n* 让Fragment的使用更简单.\n* 以最低的成本去使用Fragment.\n\n### Wiki\n#### 开始\n* [安装](https://github.com/JustKiddingBaby/FragmentRigger/wiki/首页)\n* [开始使用](https://github.com/JustKiddingBaby/FragmentRigger/wiki/开始使用)\n* [Fragment的操纵](https://github.com/JustKiddingBaby/FragmentRigger/wiki/Fragment的操纵)\n* [自定义Fragment tag](https://github.com/JustKiddingBaby/FragmentRigger/wiki/%E8%87%AA%E5%AE%9A%E4%B9%89Fragment-tag)\n* [懒加载](https://github.com/JustKiddingBaby/FragmentRigger/wiki/懒加载)\n* [转场动画](https://github.com/JustKiddingBaby/FragmentRigger/wiki/转场动画)\n* [onBackPressed拦截](https://github.com/JustKiddingBaby/FragmentRigger/wiki/onBackPressed拦截)\n* [startFragmentForResult方法](https://github.com/JustKiddingBaby/FragmentRigger/wiki/startFragmentForResult方法)\n* [滑动退出Activity/Fragment](https://github.com/JustKiddingBaby/FragmentRigger/wiki/滑动边缘退出)\n* [如何在library module中使用](https://github.com/JustKiddingBaby/FragmentRigger/wiki/如何在library-module中使用)\n#### 信息\n* [gradle错误](https://github.com/JustKiddingBaby/FragmentRigger/wiki/gradle%E4%BE%9D%E8%B5%96%E9%97%AE%E9%A2%98)\n* [代码混淆](https://github.com/JustKiddingBaby/FragmentRigger/wiki/代码混淆)\n* [版本日志](https://github.com/JustKiddingBaby/FragmentRigger/wiki/版本日志)\n\n### 特性\n- [x] **超强大Api支持**\n- [x] **足够多的英文注释**\n- [x] **严格的异常抛出**\n- [x] **解决Fragment中常见的异常及Bug**\n- [x] **事务提交永不丢失**\n- [x] **扩展原生方法，添加`onBackPressed`等常见的方法支持**\n- [x] **当前栈成员树状图打印**\n- [x] **Fragment懒加载**\n- [x] **Fragment转场动画**\n- [x] **自定义Fragment tag**\n- [x] **为非栈内的Fragment添加onBackPressed支持**\n- [x] **滑动边缘退出Activity/Fragment**\n- [ ] **配置Fragment启动模式的选项**\n- [ ] **Fragment间共享元素转场动画**\n- [ ] **支持DialogFragment**\n\n### 解决的问题\n* ~~Fragment界面重叠~~\n* ~~Fragment多级嵌套~~\n* ~~Fragment栈的管理问题~~\n* ~~Fragment事务提交失败~~\n* ~~Activity在非onResume状态下提交事务~~\n* ~~Fragment事务提交不能立即执行导致两次提交事件冲突~~\n* ~~`内存重启`时的一系列异常~~\n* ~~屏幕翻转时的数据保存及恢复~~\n* ~~Can not perform this action after onSaveInstanceState~~\n* ~~在ViewPager中的懒加载及其他场景下的懒加载~~\n* ~~不同场景下转场动画不执行问题~~\n\n### 使用样例\n\u003e本框架提供了强大的Api支持。  \n和已有的大部分`Fragment`框架不同，**不需要继承任何父类**，只需要添加一行注解即可。  \n在操纵`Fragment`的时候只需要通过代理类来操作，本框架完全采用一种**插入式** 的方式来降低使用成本。\n\n**1、声明为框架的支持类**\n\u003e在需要使用本框架的`Activity/Fragment`上添加注解`@Puppet`即可。\n\n```java\n//MainActivity.java\n@Puppet(containerViewId = R.id.atyContent)//containerViewId是你需要操纵的Fragment在add时候的container view\npublic class MainActivity extends AppCompatActivity\n```\n```java\n//TestFragment.java\n@Puppet\npublic class TestFragment extends Fragment\n```\n\n**2、使用框架操纵`Fragment`**\n\u003e添加`@Puppet`注解之后，在使用框架提供的`Fragment`操纵的方法的时候通过代理类`Rigger`来操纵。\n\n```java\n@Puppet(containerViewId = R.id.atyContent)\npublic class MainActivity extends AppCompatActivity{\n  ...\n  //add并show一个Fragment并添加至栈中，此时添加的Fragment是在@Puppet中的containerViewId中的\n   Rigger.getRigger(this).startFragment(TestFragment.newInstance());\n}\n```\n\n\n**3、Activity/Fragment 滑动退出**\n\u003e在需要滑动边缘退出的`Activity/Fragment`上添加`Swiper`注解.\n\n```java\n@Swiper\n@Puppet\npublic class MainActivity extends AppCompatActivity{\n    // swiper 只可以使用在有 puppet 注解的类上.\n}\n```\n```java\n@Swiper\n@Puppet\npublic class TestFragment extends Fragment{\n   // swiper 只可以使用在有 puppet 注解的类上.\n}\n```\n\n### License\n![](https://upload.wikimedia.org/wikipedia/commons/thumb/f/f8/License_icon-mit-88x31-2.svg/128px-License_icon-mit-88x31-2.svg.png)\n\n本项目遵循MIT开源协议. 浏览[LICENSE](https://opensource.org/licenses/MIT)查看更多信息.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjingyeoh%2Ffragmentrigger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjingyeoh%2Ffragmentrigger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjingyeoh%2Ffragmentrigger/lists"}