Coder Social home page Coder Social logo

spotlight's Introduction

THIS LIBRARY IS NO LONGER MAINTAINED. I suggest you check alternatives.

Spotlight

Spotlight is an Android library used to onboard users by showcasing specific features in the app.

Platform API Android Arsenal

Screen

Usage

new SpotlightView.Builder(this)
        .introAnimationDuration(400)
        .enableRevealAnimation(isRevealEnabled)
        .performClick(true)
        .fadeinTextDuration(400)
        .headingTvColor(Color.parseColor("#eb273f"))
        .headingTvSize(32)
        .headingTvText("Love")
        .subHeadingTvColor(Color.parseColor("#ffffff"))
        .subHeadingTvSize(16)
        .subHeadingTvText("Like the picture?\nLet others know.")
        .maskColor(Color.parseColor("#dc000000"))
        .target(view)
        .lineAnimDuration(400)
        .lineAndArcColor(Color.parseColor("#eb273f"))
        .dismissOnTouch(true)
        .dismissOnBackPress(true)
        .enableDismissAfterShown(true)
        .usageId(usageId) //UNIQUE ID
        .show();

Download

Gradle

  1. Define the jitpack remote Maven repository inside the repositories block of your root build.gradle file

    allprojects {
        repositories {
            ...
            maven { url "https://jitpack.io" }
        }
    }
  2. Add the Spotlight dependency

    dependencies {
        ...
        implementation 'com.github.wooplr:Spotlight:1.2.3'
    }

Maven

  1. Define the jitpack remote Maven repository in your pom.xml at the end of repositories

    <repositories>
        ...
        <repository>
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
        </repository>
    </repositories>
  2. Add the Spotlight dependency

    <dependency>
        <groupId>com.github.wooplr</groupId>
        <artifactId>Spotlight</artifactId>
        <version>1.2.3</version>
    </dependency>

Builder Methods

maskColor(int)

Overlay Color

target(View)

View to showcase

introAnimationDuration(long)

Intro animation duration (For Reveal and Fadein)

enableRevealAnimation(boolean)

Enable reveal animation (Only for Lollipop and above)

fadeinTextDuration(long)

Fade in animation duration for spotlight text (Heading and Sub-heading)

headingTvSize(int)

Size of heading text

headingTvColor(int)

Color of heading text

headingTvText(CharSequence)

Text to display in heading

subHeadingTvSize(int)

Size of sub-heading text

subHeadingTvColor(int)

Color of sub-heading text

subHeadingTvText(CharSequence)

Text to display in sub-heading

setTypeface(Typeface)

Custom font for text in spotlight view

lineAndArcColor(int)

Color of the spotlight line

lineAnimDuration(long)

Line animation duration

performClick(boolean)

Perform a click on target view

usageId(String)

Unique id for each spotlight

dismissOnTouch(boolean)

Dismiss spotlight on touch outside

enableDismissAfterShown(boolean)

Dismiss spotlight on touch outside after spotlight is completely visible

Configuration Method

//Create global config instance to reuse it
SpotlightConfig config = new SpotlightConfig();
config.isDismissOnTouch(true);
config.setLineAndArcColor(0xFFFFFFFF);
...
.setConfiguration(config)

Author

Jitender Chaudhary

Proguard rules

-keep class com.wooplr.spotlight.** { *; }
-keep interface com.wooplr.spotlight.**
-keep enum com.wooplr.spotlight.**

Credits

MaterialIntroView

Rahul Khanna

Suraj Barthy

License

Apache 2.0

spotlight's People

Contributors

29jitender avatar dhavalwooplr avatar knjk04 avatar quiin avatar starkej2 avatar taylorbryant avatar tvkanters avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spotlight's Issues

Exception in Pre-lollipop using Eclipse

Using this Plugin with eclipse causing exception on pre-lollipop .
I studied a lot about this and finally comes to know the exception is occuring due to VectorDrawableSupport library.
Solution of this problem for Android studio is very simple to add this in app/build.gradle :
android {
defaultConfig {
vectorDrawables.useSupportLibrary = true
}
}

but i am unable to solve this problem in eclipse this problem is forcing me to not use this awesome library.
Can you solve my problem for eclipse.

Here is logcat

    1. E/VdcInflateDelegate(31205): org.xmlpull.v1.XmlPullParserException: Binary XML file line #2 tag requires viewportWidth > 0
    1. 11-30 15:37:57.908: E/VdcInflateDelegate(31205): at android.support.graphics.drawable.VectorDrawableCompat.updateStateFromTypedArray(VectorDrawableCompat.java:535)
    1. 11-30 15:37:57.908: E/VdcInflateDelegate(31205): at android.support.graphics.drawable.VectorDrawableCompat.updateStateFromTypedArray(VectorDrawableCompat.java:535)
    1. 11-30 15:37:57.908: E/VdcInflateDelegate(31205): at android.support.graphics.drawable.VectorDrawableCompat.inflate(VectorDrawableCompat.java:472)
    1. 11-30 15:37:57.908: E/VdcInflateDelegate(31205): at android.support.graphics.drawable.VectorDrawableCompat.createFromXmlInner(VectorDrawableCompat.java:436)
    1. 11-30 15:37:57.908: E/VdcInflateDelegate(31205): at android.support.v7.widget.AppCompatDrawableManager$VdcInflateDelegate.createFromXmlInner(AppCompatDrawableManager.java:851)
    1. 11-30 15:37:57.908: E/VdcInflateDelegate(31205): at android.support.v7.widget.AppCompatDrawableManager.loadDrawableFromDelegates(AppCompatDrawableManager.java:320)
    1. 11-30 15:37:57.908: E/VdcInflateDelegate(31205): at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:195)
    1. 11-30 15:37:57.908: E/VdcInflateDelegate(31205): at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:190)
    1. 11-30 15:37:57.908: E/VdcInflateDelegate(31205): at android.support.v7.widget.AppCompatImageHelper.setImageResource(AppCompatImageHelper.java:66)
    1. 11-30 15:37:57.908: E/VdcInflateDelegate(31205): at android.support.v7.widget.AppCompatImageView.setImageResource(AppCompatImageView.java:71)
    1. 11-30 15:37:57.908: E/VdcInflateDelegate(31205): at com.wooplr.spotlight.SpotlightView.addArcAnimation(SpotlightView.java:489)
    1. 11-30 15:37:57.908: E/VdcInflateDelegate(31205): at com.wooplr.spotlight.SpotlightView.access$10(SpotlightView.java:487)
    1. 11-30 15:37:57.908: E/VdcInflateDelegate(31205): at com.wooplr.spotlight.SpotlightView$4.onAnimationEnd(SpotlightView.java:442)

reset usage id

Hi thanks for the beautiful lib
is there any method to reset all and show again spotlight?

thanks in advance...

How to See Spotlight Everytime -- Usage ID

I want to see the spotlight everytime the user opens the activity.

Right now, When the spotlight appears and the user clicks around that area, spotlight disappears as expected. But when the application is started again, I want to show the spotlight feature again. How can I achieve this?
I know it happens because of unique id. But is there any way I can change this id everytime the activity is created? I used random function but even that is not successful everytime.

Cannot install via Gradle

buildscript {
    repositories {
        //...
        maven { url "https://jitpack.io" }
    }

    //...
}

//...
dependencies {
    //...
    compile 'com.github.wooplr:Spotlight:1.2.3'
}

=> Error on Sync:

Error:Could not GET 'http://oss.jfrog.org/artifactory/oss-snapshot-local/com/github/wooplr/Spotlight/1.2.3/Spotlight-1.2.3.pom'. Received status code 409 from server: Conflict
Enable Gradle 'offline mode' and sync project

Also, trying to open the URL above into a browser gives more details on the error:

{
  "errors" : [ {
    "status" : 409,
    "message" : "The repository 'oss-snapshot-local' rejected the resolution of an artifact 'oss-snapshot-local:com/github/wooplr/Spotlight/1.2.3/Spotlight-1.2.3.pom' due to conflict in the snapshot release handling policy."
  } ]
}

Title position

Hello, could you tell me how can I change the heading position (from right to center)? Thank you

IllegalArgumentException: width and height must be > 0

Hi,

I've received this exception. Could you tell why?

Fatal Exception: java.lang.IllegalArgumentException: width and height must be > 0
at android.graphics.Bitmap.createBitmap(Bitmap.java:933)
at android.graphics.Bitmap.createBitmap(Bitmap.java:912)
at android.graphics.Bitmap.createBitmap(Bitmap.java:879)
at com.wooplr.spotlight.SpotlightView.onDraw(SpotlightView.java:232)
at android.view.View.draw(View.java:16068)
at android.widget.FrameLayout.draw(FrameLayout.java:592)
at android.view.View.updateDisplayListIfDirty(View.java:14999)
at android.view.View.getDisplayList(View.java:15022)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3662)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3641)
at android.view.View.updateDisplayListIfDirty(View.java:14959)
at android.view.View.getDisplayList(View.java:15022)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:275)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:281)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:320)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2741)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2573)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2165)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1180)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6558)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:777)
at android.view.Choreographer.doCallbacks(Choreographer.java:590)
at android.view.Choreographer.doFrame(Choreographer.java:560)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:763)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5832)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)

Proguard Issue

The following issues after integrating pro guard in release build.

  1. Horizontal line is not drawing.
  2. Animation while drawing lines is not working.

Note: proguard-rules.pro

-keep class com.wooplr.spotlight.** { ; }
-keep interface com.wooplr.spotlight.
*
-keep enum com.wooplr.spotlight.**

#15 issue still exist

Reproduced on
Android version: Android 7.0
Device: Galaxy S8+ (dream2lte)
Manufacturer: Samsung
RAM (MB) 4096
Screen size 1080 × 2008
Screen density (dpi) 420
Native platform armeabi-v7a
OpenGL ES version 3.2
CPU make Samsung
CPU model Exynos 8895

Fatal Exception: java.lang.IllegalStateException: Cannot start this animator on a detached view!
at android.view.RenderNode.addAnimator(RenderNode.java:863)
at android.view.RenderNodeAnimator.setTarget(RenderNodeAnimator.java:300)
at android.view.RenderNodeAnimator.setTarget(RenderNodeAnimator.java:282)
at android.animation.RevealAnimator.(RevealAnimator.java)
at android.view.ViewAnimationUtils.createCircularReveal(ViewAnimationUtils.java:55)
at com.wooplr.spotlight.SpotlightView.startRevealAnimation(SpotlightView.java:358)
at com.wooplr.spotlight.SpotlightView.access$100(SpotlightView.java:54)
at com.wooplr.spotlight.SpotlightView$1.run(SpotlightView.java:319)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7409)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

maskcolor is not transparent.

thanks for this awesome library. But I am not able to set the mask color to transparent. How do i do?

        config.setIntroAnimationDuration(400);
        config.setFadingTextDuration(400);
        config.setHeadingTvSize(32);
        config.setSubHeadingTvSize(16);
        config.setMaskColor(android.R.color.transparent);
        config.setLineAnimationDuration(400);
        config.setDismissOnTouch(true);
        config.setDismissOnBackpress(true);
        config.setRevealAnimationEnabled(true);
        config.setPerformClick(true);

but still getting the primary color background. any idea?

How to perform onClick

I want to make target view invisible on performing onclick or please suggest any other option to do the same.

Circle.calculateRadius()?

首先感谢您的开源,我学到了很多,但是,Circle.calculateRadius()这里的代码是不是多余了?高宽中的最大值和最小值之和的一半,不就是高宽之和的一半嘛?

Why Cant I use it on android 4

I keep getting error on android 4 but I did not see anything on your doc that says this is only for android 5 or 6
here is the error it seems it occurs when the arc or line animation starts :

08-30 14:46:23.248 14239-14239/ir.cafevas.ferfereh E/AndroidRuntime: FATAL EXCEPTION: main android.content.res.Resources$NotFoundException: File res/drawable/ic_spotlight_arc.xml from drawable resource ID #0x7f0200e9 at android.content.res.Resources.loadDrawable(Resources.java:1953) at android.content.res.Resources.getDrawable(Resources.java:660) at android.support.v7.widget.ResourcesWrapper.getDrawable(ResourcesWrapper.java:128) at android.support.v7.widget.TintResources.getDrawable(TintResources.java:45) at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:323) at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:202) at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:192) at android.support.v7.widget.AppCompatImageHelper.setImageResource(AppCompatImageHelper.java:66) at android.support.v7.widget.AppCompatImageView.setImageResource(AppCompatImageView.java:71) at com.wooplr.spotlight.SpotlightView.addArcAnimation(SpotlightView.java:479) at com.wooplr.spotlight.SpotlightView.access$300(SpotlightView.java:52) at com.wooplr.spotlight.SpotlightView$4.onAnimationEnd(SpotlightView.java:432) at android.view.animation.Animation$3.run(Animation.java:374) at android.os.Handler.handleCallback(Handler.java:725) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5041) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) at dalvik.system.NativeStart.main(Native Method) Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #2: invalid drawable tag vector at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:881) at android.graphics.drawable.Drawable.createFromXml(Drawable.java:822) at android.content.res.Resources.loadDrawable(Resources.java:1950) at android.content.res.Resources.getDrawable(Resources.java:660)  at android.support.v7.widget.ResourcesWrapper.getDrawable(ResourcesWrapper.java:128)  at android.support.v7.widget.TintResources.getDrawable(TintResources.java:45)  at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:323)  at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:202)  at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:192)  at android.support.v7.widget.AppCompatImageHelper.setImageResource(AppCompatImageHelper.java:66)  at android.support.v7.widget.AppCompatImageView.setImageResource(AppCompatImageView.java:71)  at com.wooplr.spotlight.SpotlightView.addArcAnimation(SpotlightView.java:479)  at com.wooplr.spotlight.SpotlightView.access$300(SpotlightView.java:52)  at com.wooplr.spotlight.SpotlightView$4.onAnimationEnd(SpotlightView.java:432)  at android.view.animation.Animation$3.run(Animation.java:374)  at android.os.Handler.handleCallback(Handler.java:725)  at android.os.Handler.dispatchMessage(Handler.java:92)  at android.os.Looper.loop(Looper.java:137)  at android.app.ActivityThread.main(ActivityThread.java:5041)  at java.lang.reflect.Method.invokeNative(Native Method)  at java.lang.reflect.Method.invoke(Method.java:511)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)  at dalvik.system.NativeStart.main(Native Method)  

is there anyway I could work this out . your spotlight is really awesome I cant find anything like it.

thanks

Touch events close Spotlight (when it shouldnt)

I have edited the provided sample to like bellow:

private void showIntro(View view, String usageId) {
       new SpotlightView.Builder(this)
               .introAnimationDuration(400)
               .enableRevealAnimation(isRevealEnabled)
               .performClick(true)
               .fadeinTextDuration(400)
               //.setTypeface(FontUtil.get(this, "RemachineScript_Personal_Use"))
               .headingTvColor(Color.parseColor("#eb273f"))
               .headingTvSize(32)
               .headingTvText("Love")
               .subHeadingTvColor(Color.parseColor("#ffffff"))
               .subHeadingTvSize(16)
               .subHeadingTvText("Like the picture?\nLet others know.")
               .maskColor(Color.parseColor("#dc000000"))
               .target(view)
               .lineAnimDuration(400)
               .lineAndArcColor(Color.parseColor("#eb273f"))
               .dismissOnTouch(false)                         // <------ Default was true
               .dismissOnBackPress(false)                     // <------ Default was true
               .enableDismissAfterShown(false)                // <------ Default was true
               .usageId(usageId) //UNIQUE ID
               .show();
   }

When I did this I expected a touch event on the dark area (not on the target view) to not close the Spotlight. However, the Spotlight was closed none the less.

How may I stop the Spotlight from being dismissed on touch?

Rectangle instead of Circle?

Is there a way to show spotlight as a rectangle area with some padding showing the target?
Circle does not work fine for menu item highlight in the Drawer + ListView as well as for bigger ListView component in the activity (show full listview which covers 30-70% of the screen, dim top and bottom).

Arc doesn't show up from the second time when chained using setListener

example of how the SpotlightView are chained.

Just the arc does not show up. Line shows up perfectly fine.

new SpotlightView.Builder(Activity.this)
  .introAnimationDuration(400)
  .enableRevalAnimation(true)
  .performClick(true)
  .fadeinTextDuration(400)
  .headingTvColor(Color.parseColor("#ffffff"))
  .headingTvSize(32)
  .headingTvText("Title.")
  .subHeadingTvColor(Color.parseColor("#ffffff"))
  .subHeadingTvSize(16)
  .subHeadingTvText(Html.fromHtml("text"))
  .maskColor(Color.parseColor("#dc000000"))
  .target(findViewById(R.id.viewid))
  .lineAnimDuration(400)
  .lineAndArcColor(ContextCompat.getColor(Activity.this, R.color.colorPrimary))
  .dismissOnTouch(true)
  .usageId("Someid1")
  .setListener(new SpotlightListener() {
    @Override
    public void onUserClicked(String s) {
      new SpotlightView.Builder(Activity.this)
        .introAnimationDuration(400)
        .enableRevalAnimation(true)
        .performClick(true)
        .fadeinTextDuration(400)
        .headingTvColor(Color.parseColor("#ffffff"))
        .headingTvSize(32)
        .headingTvText("Title")
        .subHeadingTvColor(Color.parseColor("#ffffff"))
        .subHeadingTvSize(16)
        .subHeadingTvText("Text")
        .maskColor(Color.parseColor("#dc000000"))
        .target(findViewById(R.id.viewid))
        .lineAnimDuration(400)
        .lineAndArcColor(ContextCompat.getColor(Activity.this, R.color.colorPrimary))
        .dismissOnTouch(true)
        .usageId("Someid2")
        .setListener(new SpotlightListener() {
          @Override
          public void onUserClicked(String s) {
          }
        })
        .show();
    }
  })
  .show();

Dismiss/hide Spotlight

Hello! First off, I'd like to thank you for this amazing library.

My app handles orientation changes on it's own, without running onCreate again. When this happens the spotlight becomes misaligned. Therefore, I'd like to be able to dismiss the currently showing spotlight so I can draw a new one using the new orientation.
I haven't been able to find a method to dismiss the spotlight, is there one available?

Thanks!

android.content.res.Resources$NotFoundException: File res/drawable-xxxhdpi-v4/ic_spotlight_arc.png

Hi,
First of all a great lib for show casing the app. Very nice UI. Have started using it in an application.

Works great on Android 5.

Facing issues on android 4.4.2 :

android.content.res.Resources$NotFoundException: File res/drawable-xxxhdpi-v4/ic_spotlight_arc.png from xml type xml resource ID #0x7f0200d0
    at android.content.res.Resources.loadXmlResourceParser(Resources.java:2396)
    at android.content.res.Resources.loadXmlResourceParser(Resources.java:2351)
    at android.content.res.Resources.getXml(Resources.java:1028)
    at android.content.res.XResources.getXml(XResources.java:745)
    at android.support.graphics.drawable.VectorDrawableCompat.create(VectorDrawableCompat.java:408)
    at android.support.graphics.drawable.AnimatedVectorDrawableCompat.inflate(AnimatedVectorDrawableCompat.java:356)
    at android.support.graphics.drawable.AnimatedVectorDrawableCompat.createFromXmlInner(AnimatedVectorDrawableCompat.java:162)
    at android.support.graphics.drawable.AnimatedVectorDrawableCompat.create(AnimatedVectorDrawableCompat.java:142)
    at com.wooplr.spotlight.SpotlightView.addArcAnimation(SpotlightView.java:521)
    at com.wooplr.spotlight.SpotlightView.access$300(SpotlightView.java:50)
    at com.wooplr.spotlight.SpotlightView$4.onAnimationEnd(SpotlightView.java:433)
    at android.view.animation.Animation$3.run(Animation.java:374)
    at android.os.Handler.handleCallback(Handler.java:733)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:136)
    at android.app.ActivityThread.main(ActivityThread.java:5118)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:610)
    at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
    at dalvik.system.NativeStart.main(Native Method)
Caused by: java.io.FileNotFoundException: Corrupt XML binary file
    at android.content.res.AssetManager.openXmlAssetNative(Native Method)
    at android.content.res.AssetManager.openXmlBlockAsset(AssetManager.java:495)
    at android.content.res.Resources.loadXmlResourceParser(Resources.java:2378)
    at android.content.res.Resources.loadXmlResourceParser(Resources.java:2351at android.content.res.Resources.getXml(Resources.java:1028at android.content.res.XResources.getXml(XResources.java:745at android.support.graphics.drawable.VectorDrawableCompat.create(VectorDrawableCompat.java:408at android.support.graphics.drawable.AnimatedVectorDrawableCompat.inflate(AnimatedVectorDrawableCompat.java:356at android.support.graphics.drawable.AnimatedVectorDrawableCompat.createFromXmlInner(AnimatedVectorDrawableCompat.java:162at android.support.graphics.drawable.AnimatedVectorDrawableCompat.create(AnimatedVectorDrawableCompat.java:142at com.wooplr.spotlight.SpotlightView.addArcAnimation(SpotlightView.java:521at com.wooplr.spotlight.SpotlightView.access$300(SpotlightView.java:50at com.wooplr.spotlight.SpotlightView$4.onAnimationEnd(SpotlightView.java:433at android.view.animation.Animation$3.run(Animation.java:374at android.os.Handler.handleCallback(Handler.java:733at android.os.Handler.dispatchMessage(Handler.java:95at android.os.Looper.loop(Looper.java:136at android.app.ActivityThread.main(ActivityThread.java:5118at java.lang.reflect.Method.invokeNative(Native Methodat java.lang.reflect.Method.invoke(Method.java:515at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:610at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132at dalvik.system.NativeStart.main(Native Method

Recommendation for SpotlightSequence

I changed new Handler(Looper.getMainLooper()).postDelayed(new Runnable() to the
new Handler().postDelayed(new Runnable(){ and it works much better for me

Handling orientation changes

When the SpotlightView is showing and the app is set to handle orientation changes on its own (without re-running onCreate), the SpotlightView becomes misaligned.

bitmap error on draw

In your library you have mentioned that you have put try catch for onDraw method (in issue #26 ), but when importing it from gradle I can't see it.
screenshot 34

Need the ability to fully interact with the target view

I am trying to build an interactive tutorial, where the user needs to perform interactions with the target view that are more advanced than simple clicks (In my case, change the value of a circular slider/seekbar). This library currently only supports click events.

Resources Not Found

android.content.res.Resources$NotFoundException: File res/drawable/ic_spotlight_arc.xml from drawable resource ID #0x7f0200b0

new SpotlightView.Builder(this).introAnimationDuration(this.introAnimationDuration)
            .enableRevalAnimation(this.isFadeAnimationEnabled).performClick(this.isPerformClick)
            .fadeinTextDuration(this.fadingTextDuration).setTypeface(this.typeface)
            .headingTvColor(this.headingTvColor).headingTvSize(this.headingTvSize).headingTvText(this.headingTvText)
            .subHeadingTvColor(this.subHeadingTvColor).subHeadingTvSize(this.subHeadingTvSize)
            .subHeadingTvText(this.subHeadingTvText).maskColor(this.maskColor).target(this.view)
            .lineAnimDuration(this.lineAnimDuration).lineAndArcColor(this.lineAndArcColor)
            .dismissOnTouch(this.dismissOnTouch).enableDismissAfterShown(this.enableDismissAfterShown)
            .usageId(this.usageId) // UNIQUE
            // ID
            .show();

@

Change Direction of Line

I have a microphone in the center, I am using spotlight to add a hint to tap the mic.
Now the direction of the spotlight is TOP RIGHT corner. How can I change it to appear at BOTTOM RIGHT corner?

rtl language

I want to write text in rtl (right to left language ie persian) how i do it?

Can't disable dismiss on touch

When dismissOnTouch is set to false, the SpotlightView still dismisses when touched. It looks like this is because dismissOnTouch is set to true after the animation ends. I'm not sure why that flag needs to be set to true there, but it's breaking the ability to disable dismiss on touch.

Leaks Activity

Since

private static SpotlightSequence instance;

is static, it leaks the activity that is passed to it.

java.lang.IllegalStateException: Cannot start this animator on a detached view!

This issue is caused by this line:

Animator anim = ViewAnimationUtils.createCircularReveal(this, this.targetView.getPoint().x, this.targetView.getPoint().y, 0.0F, finalRadius);

inside SpotlightView.startRevealAnimation()

I'm not sure but i believe it could be resolved by not using postDelayed inside the show() function because in some cases the view is destroyed before the handler executes and thus width or height = 0

here is the complete stacktrace:

Fatal Exception: java.lang.IllegalStateException: Cannot start this animator on a detached view!
at android.view.RenderNode.addAnimator(RenderNode.java:824)
at android.view.RenderNodeAnimator.setTarget(RenderNodeAnimator.java:277)
at android.view.RenderNodeAnimator.setTarget(RenderNodeAnimator.java:261)
at android.animation.RevealAnimator.(RevealAnimator.java)
at android.view.ViewAnimationUtils.createCircularReveal(ViewAnimationUtils.java:48)
at com.wooplr.spotlight.SpotlightView.startRevealAnimation(SpotlightView.java:351)
at com.wooplr.spotlight.SpotlightView.access$100(SpotlightView.java:52)
at com.wooplr.spotlight.SpotlightView$1.run(SpotlightView.java:312)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5538)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)

Landscape causes some text to be hidden

Hello,

When using the app in landscape orientation, android's virtual buttons hide some parts of the text when the tutorial is displayed. This area was probably not taken into account?

Example

Clear Usage IDs

There ought to be a way to clear SharedPreferences so the spotlights can show up again. Is this possible at all?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.