{"id":20009213,"url":"https://github.com/samlss/lighter","last_synced_at":"2025-04-13T06:36:08.564Z","repository":{"id":201738169,"uuid":"154760980","full_name":"samlss/Lighter","owner":"samlss","description":"💡A highlight \u0026 guide library for android.","archived":false,"fork":false,"pushed_at":"2019-04-11T02:03:07.000Z","size":12104,"stargazers_count":296,"open_issues_count":8,"forks_count":44,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-24T10:45:32.164Z","etag":null,"topics":["android","guide","highlight"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samlss.png","metadata":{"files":{"readme":"README.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}},"created_at":"2018-10-26T01:42:09.000Z","updated_at":"2025-03-07T05:37:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"bb20d72c-3fa5-4153-922c-401db16a147b","html_url":"https://github.com/samlss/Lighter","commit_stats":null,"previous_names":["samlss/lighter"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samlss%2FLighter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samlss%2FLighter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samlss%2FLighter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samlss%2FLighter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samlss","download_url":"https://codeload.github.com/samlss/Lighter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248675268,"owners_count":21143763,"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":["android","guide","highlight"],"created_at":"2024-11-13T07:14:40.317Z","updated_at":"2025-04-13T06:36:08.540Z","avatar_url":"https://github.com/samlss.png","language":"Java","readme":"# Lighter\n[![Download](https://api.bintray.com/packages/samlss/maven/lighter/images/download.svg)](https://bintray.com/samlss/maven/lighter/_latestVersion)   [![Api reqeust](https://img.shields.io/badge/API-14+-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=14#l14)    [![Apache License 2.0](https://img.shields.io/hexpm/l/plug.svg)](https://github.com/samlss/Lighter/blob/master/LICENSE)  [![Blog](https://img.shields.io/badge/samlss-blog-orange.svg)](https://blog.csdn.net/Samlss) \u003ca href=\"https://996.icu\"\u003e\u003cimg src=\"https://img.shields.io/badge/link-996.icu-red.svg\" alt=\"996.icu\"\u003e\u003c/a\u003e\n\n [中文](https://github.com/samlss/Lighter/blob/master/README_CN.md)\n\n### Support use in:\n- Android native layout(Such as RelativeLayout, FragmentLayout)\n- RecyclerView \u0026 ListView \u0026 GridView \u0026 ScrollView\n- ViewPager\n- Dialog\n- Fragment\n\n### Features:\n\n- One or more highlighted views can be displayed at one time\n- Customizing the paint for highlighting the view\n- Customize the shape of the highlighted view and the size of the shape\n- Customized tip view display animation\n- Custom relative position of the tip view\n- Chained display code, simple to use\n\n### Screenshots\n\n![Lighter](https://github.com/samlss/Lighter/blob/master/screenshots/screenshot1.gif)\n\n\u003cbr\u003e\n\n![Lighter](https://github.com/samlss/Lighter/blob/master/screenshots/screenshot2.gif)\n\n\u003cbr\u003e\n\n![Lighter](https://github.com/samlss/Lighter/blob/master/screenshots/screenshot3.gif)\n\n\u003cbr\u003e\n\n![Lighter](https://github.com/samlss/Lighter/blob/master/screenshots/screenshot4.gif)\n\n\u003cbr\u003e\n\n![Lighter](https://github.com/samlss/Lighter/blob/master/screenshots/screenshot5.png)\n\n------\n### Usage\n\n#### Gradle\nAdd it in your app build.gradle at the end of repositories:\n  ```java\n  dependencies {\n      implementation 'me.samlss:lighter:1.0.3'\n  }\n  ```\n\n#### Maven\n```java\n\u003cdependency\u003e\n  \u003cgroupId\u003eme.samlss\u003c/groupId\u003e\n  \u003cartifactId\u003elighter\u003c/artifactId\u003e\n  \u003cversion\u003e1.0.3\u003c/version\u003e\n  \u003ctype\u003epom\u003c/type\u003e\n\u003c/dependency\u003e\n```\n\n#### Code\n\nYou can specify that the highlighted root view is attached to the activity or viewgroup,\n\nyou can use the below code to specify:\n\n```java\nLighter with(Activity activity) //will use activity.getWindow().getDecorView as the root view, so it will display in full screen \n    \nLighter with(ViewGroup rootView) //will use the 'rootView' as the root view\n```\n\nComplete call:\n\n```java\n\n Lighter.with(activity)\n                .addHighlight(new LighterParameter.Builder()\n                                .setHighlightedViewId(R.id.vp_btn_1)\n                                .setTipLayoutId(R.layout.layout_tip_1)\n                                .setLighterShape(new RectShape(5, 5, 30))\n                                .setTipViewRelativeDirection(Direction.BOTTOM)\n                                .setTipViewRelativeOffset(new MarginOffset(150, 0, 30, 0))\n                                .build())\n                .addHighlight(new LighterParameter.Builder()\n                        .setHighlightedViewId(R.id.vp_btn_2)\n                        .setTipLayoutId(R.layout.layout_tip_2)\n                        .setLighterShape(new RectShape(5, 5, 30))\n                        .setTipViewRelativeDirection(Direction.TOP)\n                        .setTipViewRelativeOffset(new MarginOffset(-400, 0, 0, 30))\n                        .build())\n                .show();\n```\n\n\n\nWhen you need to display multiple highlight views at once, call **addHighlight(LighterParameter...lighterParameters)**\n\n```java\nLighter.with(activity)\n                .addHighlight(\n                        //Show two at a time\n                        new LighterParameter.Builder()\n                                .setHighlightedViewId(R.id.vp_btn_1)\n                                .setTipLayoutId(R.layout.layout_tip_1)\n                                .setLighterShape(new RectShape(5, 5, 30))\n                                .setTipViewRelativeDirection(Direction.BOTTOM)\n                                .setTipViewRelativeOffset(new MarginOffset(150, 0, 30, 0))\n                                .build(),\n\n                        new LighterParameter.Builder()\n                                .setHighlightedViewId(R.id.vp_btn_2)\n                                .setTipLayoutId(R.layout.layout_tip_2)\n                                .setLighterShape(new RectShape(5, 5, 30))\n                                .setTipViewRelativeDirection(Direction.TOP)\n                                .setTipViewRelativeOffset(new MarginOffset(-400, 0, 0, 30))\n                                .build())\n                .show();\n```\n\n#### About [LighterParameter.Builder](https://github.com/samlss/Lighter/blob/master/lighter/src/main/java/me/samlss/lighter/parameter/LighterParameter.java)\n\n\n| Method                      | Description                                                  |\n| :-------------------------- | :----------------------------------------------------------- |\n| setHighlightedViewId        | Set id the highlighted view                                  |\n| setHighlightedView          | Set the highlighted view                                     |\n| setTipLayoutId              | Set the layout id of the tip layout                          |\n| setTipView                  | Set the tip view                                             |\n| setLighterShape             | Set the shape of the wrapped highlight view                  |\n| setShapeXOffset             | Set the x-axis offset of the shape rect                      |\n| setShapeYOffset             | Set the y-axis offset of the shape rect                      |\n| setTipViewRelativeDirection | Set the direction of the tip view relative to the highlighted view |\n| setTipViewRelativeOffset    | Set the offset of the tip view's margin relative to the highlighted view |\n| setTipViewDisplayAnimation  | Set animation of the tip view when display                   |\n| build                       | To create a [LighterParameter](https://github.com/samlss/Lighter/blob/master/lighter/src/main/java/me/samlss/lighter/parameter/LighterParameter.java) object                      |\n\n##### Note:\n\n- setHighlightedViewId \u0026 setHighlightedView \n- setTipLayoutId \u0026 setTipView\n\nFor the above two methods, you only need to use one. If you don't use it,  an exception will be throwing.\n\n#### About [Shape](https://github.com/samlss/Lighter/tree/master/lighter/src/main/java/me/samlss/lighter/shape)\n\n| Shape  | Description                                              |\n| ------ | -------------------------------------------------------- |\n| Rect   | A rectangular shape with rounded corners and blur radius |\n| Circle | A circle shape with blur radius                          |\n| Oval   | A oval shape with blur radius                            |\n\n\n\n##### ShapeXOffset \u0026 ShapeYOffset\n\nRefer to the below picture :\n\n![Lighter](https://github.com/samlss/Lighter/blob/master/screenshots/screenshot6.png)\n\n\n\n#### About parameter of TipView\n\n##### Direction\n\nRefer to the below picture :\n\n![Lighter](https://github.com/samlss/Lighter/blob/master/screenshots/screenshot7.png)\n\n##### Offset\n\nWhen you specify a direction(the default is left),  the offset distance will be based on the direction you specify.\n\nE.g:\n\nLeft: The values of topMargin \u0026 rightMargin will take effect\n\nRight: The values of topMargin \u0026 leftMargin will take effect\n\nTop:  If the highlighted view is on the left side of the screen, the values of leftMargin \u0026 bottomMargin will take effect. Otherwise, the values of rightMargin \u0026 bottomMargin will take effect.\n\nBottom: If the highlighted view is on the left side of the screen, the values of leftMargin \u0026 topMargin will take effect. Otherwise, the values of rightMargin \u0026 topMargin will take effect.\n\n##### Animation\n\nYou can set any animation for the tip view.\n\n##### \n\n\n### License\n\n```\nCopyright 2018 samlss\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamlss%2Flighter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamlss%2Flighter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamlss%2Flighter/lists"}