All Projects → TakuSemba → Spotlight

TakuSemba / Spotlight

Licence: apache-2.0
Android Library that lights items for tutorials or walk-throughs etc...

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Spotlight

Extract-Color-Palette-Api
Create gradient drawable by extracting prominent colors from image⚫⚪
Stars: ✭ 16 (-99.49%)
Mutual labels:  android-ui, android-app
E-commerceCustomerFYP
Android E-commerce Platform. Allow customer to buy product, chat, feedback rating, make payment to retailer
Stars: ✭ 41 (-98.7%)
Mutual labels:  android-ui, android-app
Android-daily-read-tips
log for articles and info in android for every developer
Stars: ✭ 13 (-99.59%)
Mutual labels:  android-ui, android-app
Biometric-Authentication-Android
A sample implementation of AndroidX biometrics API using Kotlin. Authenticate using biometrics or PIN/Password if biometrics isn't available on device. Fully implemented in Jetpack compose using Material 3 dynamic theming and also has a separate implementation in xml with MDC 3.
Stars: ✭ 29 (-99.08%)
Mutual labels:  android-ui, android-app
Reside-Menu
By applying viewpager animation you can also make AMAZING Reside Menu's
Stars: ✭ 72 (-97.71%)
Mutual labels:  android-ui, android-app
PaymentCardView
Custom Credit/Debit card view
Stars: ✭ 62 (-98.03%)
Mutual labels:  android-ui, android-app
SuperToolbar
Android native Toolbar on steroids 💪
Stars: ✭ 52 (-98.35%)
Mutual labels:  android-ui, android-app
Awesomedialog
A Beautiful Dialog Library for Kotlin Android
Stars: ✭ 163 (-94.81%)
Mutual labels:  android-app, android-ui
SeatLayout
A seat selection library for Android with an example for selecting seats for flights, sports venue, theatres, etc
Stars: ✭ 30 (-99.05%)
Mutual labels:  android-ui, android-app
FutureFurnitureUI-Android
Check out the new style for App Design aims for Furniture E-commerce...😉😀😁😎
Stars: ✭ 117 (-96.28%)
Mutual labels:  android-ui, android-app
Modern Android Development
Modern Android Development tools & key points
Stars: ✭ 219 (-93.03%)
Mutual labels:  android-app, android-ui
SignInSignupScreen-Android
SignIn and SignUp in android 😊😊😉
Stars: ✭ 51 (-98.38%)
Mutual labels:  android-ui, android-app
Bottomsheet
BottomSheet dialog library for Android
Stars: ✭ 219 (-93.03%)
Mutual labels:  android-app, android-ui
media-picker
Easy customizable picker for all your needs in Android application
Stars: ✭ 167 (-94.69%)
Mutual labels:  android-ui, android-app
Android library
android_library
Stars: ✭ 170 (-94.59%)
Mutual labels:  android-app, android-ui
android-custom-view
No description or website provided.
Stars: ✭ 15 (-99.52%)
Mutual labels:  android-ui, android-app
Zimlx
Open Source and free launcher for Android
Stars: ✭ 137 (-95.64%)
Mutual labels:  android-app, android-ui
Notzz App
📝 A Simple Note-Taking App built to demonstrate the use of Modern Android development tools - (Kotlin, Coroutines, State Flow, Hilt-Dependency Injection, Jetpack DataStore, Architecture Components, MVVM, Room, Material Design Components).
Stars: ✭ 158 (-94.97%)
Mutual labels:  android-app, android-ui
PlantShopUI-Android
Check out the new style for App Design aims for the Online Plant Shop Service using jetpack compose...😉😀😁😎
Stars: ✭ 29 (-99.08%)
Mutual labels:  android-ui, android-app
AndroidBatteryStats
Displays all battery stats of an Android device using broadcast receiver.
Stars: ✭ 20 (-99.36%)
Mutual labels:  android-ui, android-app

Spotlight

alt text

Build Status Download License API

Gradle

dependencies {
    implementation 'com.github.takusemba:spotlight:x.x.x'
}

Usage

val spotlight = Spotlight.Builder(this)
    .setTargets(firstTarget, secondTarget, thirdTarget ...)
    .setBackgroundColor(R.color.spotlightBackground)
    .setDuration(1000L)
    .setAnimation(DecelerateInterpolator(2f))
    .setContainer(viewGroup)
    .setOnSpotlightListener(object : OnSpotlightListener {
      override fun onStarted() {
        Toast.makeText(this@MainActivity, "spotlight is started", Toast.LENGTH_SHORT).show()
      }
      override fun onEnded() {
        Toast.makeText(this@MainActivity, "spotlight is ended", Toast.LENGTH_SHORT).show()
      }
    })
    .build()         

If you want to show Spotlight immediately, you have to wait until views are laid out.

// with core-ktx method.
view.doOnPreDraw { Spotlight.Builder(this)...start() }


Target

Create a Target to add Spotlight.

Target is a spot to be casted by Spotlight. You can add multiple targets to Spotlight.

val target = Target.Builder()
    .setAnchor(100f, 100f)
    .setShape(Circle(100f))
    .setEffect(RippleEffect(100f, 200f, argb(30, 124, 255, 90)))
    .setOverlay(layout)
    .setOnTargetListener(object : OnTargetListener {
      override fun onStarted() {
        makeText(this@MainActivity, "first target is started", LENGTH_SHORT).show()
      }
      override fun onEnded() {
        makeText(this@MainActivity, "first target is ended", LENGTH_SHORT).show()
      }
    })
    .build()


Start/Finish Spotlight

val spotlight = Spotlight.Builder(this)...start()

spotlight.finish()

Next/Previous/Show Target

val spotlight = Spotlight.Builder(this)...start()

spotlight.next()

spotlight.previous()

spotlight.show(2)

Custom Shape

Shape defines how your target will look like. Circle and RoundedRectangle shapes are already implemented, but if you want your custom shape, it's arhivable by implementing Shape interface.

class CustomShape(
    override val duration: Long,
    override val interpolator: TimeInterpolator
) : Shape {

  override fun draw(canvas: Canvas, point: PointF, value: Float, paint: Paint) {
    // draw your shape here.
  }
}

Custom Effect

Effect allows you to decorates your target. RippleEffect and FlickerEffect shapes are already implemented, but if you want your custom effect, it's arhivable by implementing Effect interface.

class CustomEffect(
    override val duration: Long,
    override val interpolator: TimeInterpolator,
    override val repeatMode: Int
) : Effect {

  override fun draw(canvas: Canvas, point: PointF, value: Float, paint: Paint) {
    // draw your effect here.
  }
}

Sample

Clone this repo and check out the app module.

Author

Licence

Copyright 2017 Taku Semba.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].