{"id":13643156,"url":"https://github.com/rantianhua/AssembleEssay","last_synced_at":"2025-04-20T21:33:10.905Z","repository":{"id":80066824,"uuid":"73807880","full_name":"rantianhua/AssembleEssay","owner":"rantianhua","description":"自定义LayoutManager实现一个展示文章的View，支持拖动插入以及相应的动画展示。","archived":false,"fork":false,"pushed_at":"2018-06-12T02:48:59.000Z","size":11062,"stargazers_count":132,"open_issues_count":2,"forks_count":22,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T03:43:09.506Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/rantianhua.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-11-15T11:38:58.000Z","updated_at":"2025-02-22T13:40:07.000Z","dependencies_parsed_at":"2024-01-14T11:20:04.960Z","dependency_job_id":null,"html_url":"https://github.com/rantianhua/AssembleEssay","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rantianhua%2FAssembleEssay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rantianhua%2FAssembleEssay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rantianhua%2FAssembleEssay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rantianhua%2FAssembleEssay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rantianhua","download_url":"https://codeload.github.com/rantianhua/AssembleEssay/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249965566,"owners_count":21352926,"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:42.719Z","updated_at":"2025-04-20T21:33:08.920Z","avatar_url":"https://github.com/rantianhua.png","language":"Java","funding_links":[],"categories":["布局"],"sub_categories":[],"readme":"[![Release](https://jitpack.io/v/rantianhua/AssembleEssay.svg)](https://jitpack.io/#rantianhua/AssembleEssay)\n\n# AssembleEssay\n自定义 LayoutManager 实现一个流动布局，可以用作文章展示，也可以用作标签展示，并且可以很方便地为其添加布局动画，示例代码里添加了拖拽插入的动画，如效果图。\n\n对齐方式可选4中：\n\n1. 向左对齐\n2. 向右对齐\n3. 居中对齐\n4. 两边对齐\n\n默认是两边对齐的布局方式\n\n# 效果图\n![image](https://raw.githubusercontent.com/rantianhua/AssembleEssay/master/app/images/Flow_Drag_Essay_View.gif)\n\n# 使用方式\n1. 先添加 jitpack \n```\nallprojects {\n  repositories {\n\t ...\n\t maven { url 'https://jitpack.io' }\n  }\n}\n```\n2. 在 module 对应得 build.gradle 文件中添加\n```\nimplementation 'com.github.rantianhua:AssembleEssay:v1.0.0'\n```\n3. 示例代码\n```\nrecyclerView = (RecyclerView) findViewById(R.id.recycler_view);\nrecyclerView.setLayoutManager(new FlowDragLayoutManager());\n```\n# 设置/更改对齐方式\n```\n//初始化是设置\n//向左对齐\nFlowDragLayoutManager layoutManager = new FlowDragLayoutManager(FlowDragLayoutConstant.LEFT);\n//居中对齐\nFlowDragLayoutManager layoutManager = new FlowDragLayoutManager(FlowDragLayoutConstant.CENTER);\n//向右对齐\nFlowDragLayoutManager layoutManager = new FlowDragLayoutManager(FlowDragLayoutConstant.RIGHT);\n//居中对齐\nFlowDragLayoutManager layoutManager = new FlowDragLayoutManager(FlowDragLayoutConstant.TWO_SIDE);\n\n//动态更改\nlayoutManager.setAlignMode(FlowDragLayoutConstant.LEFT);\nlayoutManager.setAlignMode(FlowDragLayoutConstant.CENTER);\nlayoutManager.setAlignMode(FlowDragLayoutConstant.RIGHT);\nlayoutManager.setAlignMode(FlowDragLayoutConstant.TWO_SIDE);\n```\n\n# 优点\n1. 当标签很多的时候，可以重用视图，不会一次性产生过多对象\n2. 基于 RecyclerView 的 LayoutManager , 使用方便，而且添加动画效果也很容易\n3. 对齐方式灵活，目前四种应该n可以满足大部分的需求了\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frantianhua%2FAssembleEssay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frantianhua%2FAssembleEssay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frantianhua%2FAssembleEssay/lists"}