New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
assign target to view.. #27
Comments
SimpleTarget simpleTarget = new SimpleTarget.Builder(this)
|
Can you give me a screenshot of how the spotlight isnt fit. |
I had the same issue, the spotligth isn't fit Code: Spotlight.with(this)
.setOverlayColor(ContextCompat.getColor(this,R.color.background))
.setDuration(1000L)
.setAnimation(DecelerateInterpolator(2f))
.setTargets(
SimpleTarget.Builder(this)
.setPoint(100f,Intentos.y)
.setRadius(100f)
.setTitle("Intentos")
.setDescription("Este es el contador de los intentos que has realizado,recuerada el maximo es 20!!.")
.build()
,
SimpleTarget.Builder(this)
.setPoint(Chronometer.x, Chronometer.y)
.setRadius(100f)
.setTitle("Cronometro")
.setDescription("Tiempo que ha pasado mientras intentas adivinar la palabra.")
.build()
,
SimpleTarget.Builder(this)
.setPoint(horizontalScrollView.x , horizontalScrollView.y)
.setTitle("Letras")
.setDescription("Cada botón representa una letra o caracter, puedes buscar el que necesites pasando el dedo de izquierda a derecha o viceversa")
.build()
)
.setClosedOnTouchedOutside(true)
.setOnSpotlightStartedListener {
}
.setOnSpotlightEndedListener {
}
.start() |
Can you try after view is located as I described in Read.me? view.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override public void onGlobalLayout() {
view.getViewTreeObserver().removeOnGlobalLayoutListener(this);
// show spotlight here
}
}); |
Instrucciones.getViewTreeObserver().addOnGlobalLayoutListener{
object : ViewTreeObserver.OnGlobalLayoutListener {
override fun onGlobalLayout() {
Instrucciones.viewTreeObserver.removeOnGlobalLayoutListener(this)
Spotlight.with(this@instructions)
.setOverlayColor(ContextCompat.getColor(this@instructions, R.color.background))
.setDuration(1000L)
.setAnimation(DecelerateInterpolator(2f))
.setTargets(
SimpleTarget.Builder(this@instructions)
.setPoint(Intentos)
.setRadius(100f)
.setTitle("Intentos")
.setDescription("Este es el contador de los intentos que has realizado,recuerada el maximo es 20!!.")
.build()
,
SimpleTarget.Builder(this@instructions)
.setPoint(Chronometer)
.setRadius(100f)
.setTitle("Cronometro")
.setDescription("Tiempo que ha pasado mientras intentas adivinar la palabra.")
.build()
,
SimpleTarget.Builder(this@instructions)
.setPoint(horizontalScrollView)
.setTitle("Letras")
.setDescription("Cada botón representa una letra o caracter, puedes buscar el que necesites pasando el dedo de izquierda a derecha o viceversa")
.build()
)
.setClosedOnTouchedOutside(true)
.setOnSpotlightStartedListener {
}
.setOnSpotlightEndedListener {
}
.start()
}
}
} with this code the spotlight doesn't start/show |
the code above, is the callback even called? |
sorry, closing this issue as not seeing your response. |
Hi,
im trying to implement the library, but i cant put target as a view to method setPoint(textview1);
the round is not fit to the view..
any advice would help much.
thanks
The text was updated successfully, but these errors were encountered: