{"id":13644323,"url":"https://github.com/wenhuaijun/EasyTagDragView","last_synced_at":"2025-04-21T07:30:50.796Z","repository":{"id":92687327,"uuid":"59800379","full_name":"wenhuaijun/EasyTagDragView","owner":"wenhuaijun","description":"仿网易新闻app下拉标签选择菜单，长按拖动排序，点击增删标签控件","archived":false,"fork":false,"pushed_at":"2019-03-15T06:22:46.000Z","size":659,"stargazers_count":428,"open_issues_count":4,"forks_count":97,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-11-09T16:44:19.190Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wenhuaijun.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-05-27T03:12:36.000Z","updated_at":"2024-07-15T09:13:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"53e9519a-f06e-4a0c-9742-c9d663f5c861","html_url":"https://github.com/wenhuaijun/EasyTagDragView","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/wenhuaijun%2FEasyTagDragView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wenhuaijun%2FEasyTagDragView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wenhuaijun%2FEasyTagDragView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wenhuaijun%2FEasyTagDragView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wenhuaijun","download_url":"https://codeload.github.com/wenhuaijun/EasyTagDragView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250014584,"owners_count":21360979,"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:02:01.289Z","updated_at":"2025-04-21T07:30:50.002Z","avatar_url":"https://github.com/wenhuaijun.png","language":"Java","funding_links":[],"categories":["TagView"],"sub_categories":[],"readme":"# 2020届阿里巴巴实习生内推，招聘客户端、Java、前端、测试、算法等岗位。\n# 需要内推的投简历到huaijun.whj@alibaba-inc.com（备注 姓名+手机号+岗位）\n\n# EasyTagDragView\n仿网易新闻app下拉标签选择菜单，长按拖动排序，点击增删标签控件\n\n##示例\n![introduce.gif](introduce.gif)\n\n\n##EasyTagDragView的使用\n\n    在layout布局里添加：\n    \u003ccom.wenhuaijun.easytagdragview.EasyTipDragView\n       android:id=\"@+id/easy_tip_drag_view\"\n       android:background=\"@android:color/white\"\n       android:layout_width=\"match_parent\"\n       android:layout_gravity=\"center\"\n       android:layout_height=\"match_parent\"/\u003e\n       \n    在java代码中：\n        给EasyTagDragView添加标签数据，包括已添加的标签数据和可添加的标签数据。\n        添加的数据bean需继承SimpleTitleTip类，可自由增加成员属性。如没特殊需求，可直接使用提供的SimpleTitleTip类。\n        注意每个tip的id必须唯一，不然拖拽会有bug\n        \n        //设置已添加的的标签数据\n        easyTipDragView.setDragData(TipDataModel.getDragTips());\n        \n        //设置可以添加的标签数据\n        easyTipDragView.setAddData(TipDataModel.getAddTips());\n        \n        //显示EasyTagDragView\n        easyTipDragView.open();\n        \n        //在easyTipDragView处于非编辑模式下点击item的回调（编辑模式下点击item作用为删除item）\n        easyTipDragView.setSelectedListener(new TipItemView.OnSelectedListener() {\n            @Override\n            public void onTileSelected(Tip entity, int position, View view) {\n                toast(((SimpleTitleTip) entity).getTip());\n            }\n        });\n        \n        //设置每次数据改变后的回调（例如每次拖拽排序了标签或者增删了标签都会回调）\n        easyTipDragView.setDataResultCallback(new EasyTipDragView.OnDataChangeResultCallback() {\n            @Override\n            public void onDataChangeResult(ArrayList\u003cTip\u003e tips) {\n                Log.i(\"heheda\", tips.toString());\n            }\n        });\n        \n        //设置点击“确定”按钮后最终数据的回调\n        easyTipDragView.setOnCompleteCallback(new EasyTipDragView.OnCompleteCallback() {\n            @Override\n            public void onComplete(ArrayList\u003cTip\u003e tips) {\n                toast(\"最终数据：\" + tips.toString());\n            }\n        });\n        \n    注：当已经显示EasyTagDragView的时候，需监听返回键，\n        在编辑模式下点击返回键取消编辑模式。非编辑模式下则关闭EasyTagDragView\n        \n        \n        @Override\n        public boolean onKeyDown(int keyCode, KeyEvent event) {\n            switch (keyCode){\n                //点击返回键\n                case KeyEvent.KEYCODE_BACK:\n                    //判断easyTipDragView是否已经显示出来\n                    if(easyTipDragView.isOpen()){\n                        if(!easyTipDragView.onKeyBackDown()){\n                            btn.setVisibility(View.VISIBLE);//自己的业务逻辑\n                        }\n                        return true;\n                    }\n                    //....自己的业务逻辑\n\n                    break;\n            }\n            return super.onKeyDown(keyCode, event);\n        }\n        \n\n\n**后期增加更多自定义属性和一些API,将View放入popupWindow，增加过渡动画**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwenhuaijun%2FEasyTagDragView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwenhuaijun%2FEasyTagDragView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwenhuaijun%2FEasyTagDragView/lists"}