{"id":3517,"url":"https://github.com/TakuSemba/Spotlight","last_synced_at":"2025-08-12T01:30:59.970Z","repository":{"id":37470866,"uuid":"96007003","full_name":"TakuSemba/Spotlight","owner":"TakuSemba","description":"Android Library that lights items for tutorials or walk-throughs etc...","archived":false,"fork":false,"pushed_at":"2022-12-03T07:25:18.000Z","size":2025,"stargazers_count":3632,"open_issues_count":30,"forks_count":365,"subscribers_count":46,"default_branch":"master","last_synced_at":"2024-12-12T19:02:03.020Z","etag":null,"topics":["android","android-app","android-library","android-ui","java","spotlight","ui","ux"],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","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/TakuSemba.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}},"created_at":"2017-07-02T06:42:18.000Z","updated_at":"2024-12-11T17:01:19.000Z","dependencies_parsed_at":"2023-01-22T15:15:17.096Z","dependency_job_id":null,"html_url":"https://github.com/TakuSemba/Spotlight","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TakuSemba%2FSpotlight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TakuSemba%2FSpotlight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TakuSemba%2FSpotlight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TakuSemba%2FSpotlight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TakuSemba","download_url":"https://codeload.github.com/TakuSemba/Spotlight/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229624728,"owners_count":18100638,"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","android-app","android-library","android-ui","java","spotlight","ui","ux"],"created_at":"2024-01-05T20:16:43.758Z","updated_at":"2024-12-13T22:30:38.991Z","avatar_url":"https://github.com/TakuSemba.png","language":"Kotlin","readme":"# Spotlight\n\n\u003cimg src=\"https://github.com/TakuSemba/Spotlight/blob/master/arts/logo_yello.png\" alt=\"alt text\" style=\"width:200;height:200\"\u003e\n\n![Build Status](https://app.bitrise.io/app/bcf0d555e7b41eb2/status.svg?token=2wvl_JilEbg6HB3B1tfKpA\u0026branch=master)\n![Download](https://api.bintray.com/packages/takusemba/maven/spotlight/images/download.svg)\n![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)\n![API](https://img.shields.io/badge/API-14%2B-brightgreen.svg?style=flat)\n\n## Gradle\n\n```groovy\ndependencies {\n    implementation 'com.github.takusemba:spotlight:x.x.x'\n}\n```\n\n\n## Usage\n\n```kt\nval spotlight = Spotlight.Builder(this)\n    .setTargets(firstTarget, secondTarget, thirdTarget ...)\n    .setBackgroundColor(R.color.spotlightBackground)\n    .setDuration(1000L)\n    .setAnimation(DecelerateInterpolator(2f))\n    .setContainer(viewGroup)\n    .setOnSpotlightListener(object : OnSpotlightListener {\n      override fun onStarted() {\n        Toast.makeText(this@MainActivity, \"spotlight is started\", Toast.LENGTH_SHORT).show()\n      }\n      override fun onEnded() {\n        Toast.makeText(this@MainActivity, \"spotlight is ended\", Toast.LENGTH_SHORT).show()\n      }\n    })\n    .build()         \n```\n\nIf you want to show Spotlight immediately, you have to wait until views are laid out.\n\n```kt\n// with core-ktx method.\nview.doOnPreDraw { Spotlight.Builder(this)...start() }\n```\n\n\u003cbr/\u003e\n\u003cbr/\u003e\n\n\u003cimg src=\"https://github.com/TakuSemba/Spotlight/blob/master/arts/customTarget.gif\" align=\"left\" width=\"30%\"\u003e\n\n## Target\nCreate a Target to add Spotlight.\n\nTarget is a spot to be casted by Spotlight. You can add multiple targets to Spotlight.\n\n```kt\nval target = Target.Builder()\n    .setAnchor(100f, 100f)\n    .setShape(Circle(100f))\n    .setEffect(RippleEffect(100f, 200f, argb(30, 124, 255, 90)))\n    .setOverlay(layout)\n    .setOnTargetListener(object : OnTargetListener {\n      override fun onStarted() {\n        makeText(this@MainActivity, \"first target is started\", LENGTH_SHORT).show()\n      }\n      override fun onEnded() {\n        makeText(this@MainActivity, \"first target is ended\", LENGTH_SHORT).show()\n      }\n    })\n    .build()\n```\n\n\n\u003cbr/\u003e\n\u003cbr/\u003e\n\n## Start/Finish Spotlight\n\n```kt\nval spotlight = Spotlight.Builder(this)...start()\n\nspotlight.finish()\n```\n\n## Next/Previous/Show Target\n\n```kt\nval spotlight = Spotlight.Builder(this)...start()\n\nspotlight.next()\n\nspotlight.previous()\n\nspotlight.show(2)\n```\n\n## Custom Shape\n`Shape` defines how your target will look like.\n[Circle](https://github.com/TakuSemba/Spotlight/blob/master/spotlight/src/main/java/com/takusemba/spotlight/shape/Circle.kt) and [RoundedRectangle](https://github.com/TakuSemba/Spotlight/blob/master/spotlight/src/main/java/com/takusemba/spotlight/shape/RoundedRectangle.kt) shapes are already implemented, but if you want your custom shape, it's arhivable by implementing `Shape` interface.\n\n\n```kt\nclass CustomShape(\n    override val duration: Long,\n    override val interpolator: TimeInterpolator\n) : Shape {\n\n  override fun draw(canvas: Canvas, point: PointF, value: Float, paint: Paint) {\n    // draw your shape here.\n  }\n}\n```\n\n## Custom Effect\n`Effect` allows you to decorates your target.\n[RippleEffect](https://github.com/TakuSemba/Spotlight/blob/master/spotlight/src/main/java/com/takusemba/spotlight/effet/RippleEffect.kt) and [FlickerEffect](https://github.com/TakuSemba/Spotlight/blob/master/spotlight/src/main/java/com/takusemba/spotlight/effet/FlickerEffect.kt) shapes are already implemented, but if you want your custom effect, it's arhivable by implementing `Effect` interface.\n\n\n```kt\nclass CustomEffect(\n    override val duration: Long,\n    override val interpolator: TimeInterpolator,\n    override val repeatMode: Int\n) : Effect {\n\n  override fun draw(canvas: Canvas, point: PointF, value: Float, paint: Paint) {\n    // draw your effect here.\n  }\n}\n```\n\n## Sample\nClone this repo and check out the [app](https://github.com/TakuSemba/Spotlight/tree/master/app) module.\n\n## Author\n\n* **Taku Semba**\n    * **Github** - (https://github.com/takusemba)\n    * **Twitter** - (https://twitter.com/takusemba)\n    * **Facebook** - (https://www.facebook.com/takusemba)\n\n## Licence\n```\nCopyright 2017 Taku Semba.\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":["Index `(light-weight pages)`","Libraries","Kotlin","Index"],"sub_categories":["GUI"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTakuSemba%2FSpotlight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTakuSemba%2FSpotlight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTakuSemba%2FSpotlight/lists"}