{"id":13644019,"url":"https://github.com/dreamlivemeng/HotImg","last_synced_at":"2025-04-21T06:32:40.650Z","repository":{"id":163654223,"uuid":"60593562","full_name":"dreamlivemeng/HotImg","owner":"dreamlivemeng","description":"图片不规则区域点击事件处理","archived":false,"fork":false,"pushed_at":"2016-06-12T02:05:33.000Z","size":2177,"stargazers_count":291,"open_issues_count":2,"forks_count":75,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-09T16:43:37.822Z","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/dreamlivemeng.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-06-07T07:54:04.000Z","updated_at":"2024-10-08T13:53:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"4ec4fbec-0647-49e6-8e51-84664f859a2c","html_url":"https://github.com/dreamlivemeng/HotImg","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/dreamlivemeng%2FHotImg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dreamlivemeng%2FHotImg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dreamlivemeng%2FHotImg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dreamlivemeng%2FHotImg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dreamlivemeng","download_url":"https://codeload.github.com/dreamlivemeng/HotImg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250008258,"owners_count":21359954,"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:56.522Z","updated_at":"2025-04-21T06:32:35.638Z","avatar_url":"https://github.com/dreamlivemeng.png","language":"Java","funding_links":[],"categories":["图片"],"sub_categories":[],"readme":"# HotImg\n图片不规则区域点击事件处理\n# HotImg是基于对一张图片进行不规则区域点击响应不同事件。  \n![](images/xiaoguo.gif) \n\n# 基本内容  \n 1.对图片的部分区域进行可响应事件  \n 2.对图片进行缩放后,仍可响应区域点击事件  \n 3.对图片进行移动后.仍可响应区域点击事件  \n 4.当图片移出边界区域后,可进行回弹.  \n \n# 如何使用  \n1、 xml配置  \n```java\n    \u003ccom.dreamlive.hotimglibrary.view.HotClickView\n        android:id=\"@+id/a_main_hotview\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        /\u003e\n```\n2、 禁止缩放  \n\n```java\n       mHotView.setCanScale(false);\n```\n3、 禁止滑动  \n\n```java\n       mHotView.setCanMove(false);\n```\n4、 设置监听事件  \n```java\n        mHotView.setOnClickListener(new HotClickView.OnClickListener() {\n            @Override\n            public void OnClick(View view, HotArea hotArea) {\n                Toast.makeText(MainActivity.this, \"你点击了\" + hotArea.getDesc(), Toast.LENGTH_SHORT).show();\n            }\n        });\n```\n5、 图片点击区域的设置  \n将图片中每个点击区域的像素坐标点配置assets文件下的xml中，例如一张图片像素800X600，在其坐上方（从左上方顶点开始）有一个50x50的正方形点击区域，那么他们pts为{0,0,0,50,50,50,50,0}也就是正方形的四个区域。  \n\n# Thanks  \nEveryone who has contributed code and reported issues and pull requests!  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdreamlivemeng%2FHotImg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdreamlivemeng%2FHotImg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdreamlivemeng%2FHotImg/lists"}