Coder Social home page Coder Social logo

#15 issue still exist about spotlight HOT 4 OPEN

29jitender avatar 29jitender commented on September 6, 2024 1
#15 issue still exist

from spotlight.

Comments (4)

irfaan008 avatar irfaan008 commented on September 6, 2024 1

Is it solved? Its gonna 1 year. Issue still exists

from spotlight.

tinyCoder32 avatar tinyCoder32 commented on September 6, 2024

Here too.

from spotlight.

dhavalwooplr avatar dhavalwooplr commented on September 6, 2024

I added a possible fix based on crash logs and your suggestions in SpotlightView class.

private void show(final Activity activity) {

        if (preferencesManager.isDisplayed(usageId))
            return;

        ((ViewGroup) activity.getWindow().getDecorView()).addView(this);

        setReady(true);

        SpotlightView.this.post(new Runnable() {
            @Override
            public void run() {
                try{
                    boolean isAttachedToWindow = true;
                    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
                        isAttachedToWindow = SpotlightView.this.isAttachedToWindow();
                    }

                    if(isAttachedToWindow) {
                        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {

                            if (isRevealAnimationEnabled)
                                startRevealAnimation(activity);
                            else {
                                startFadinAnimation(activity);
                            }
                        } else {
                            startFadinAnimation(activity);
                        }
                    }
                }catch(Exception e){
                    e.printStackTrace();
                }
            }
        });
    }

I modified above method to avoid that crash but I'm unable to reproduce this issue and so unable to test this. Can you guys check this change in your code and confirm if this is the working fix for you or not?

from spotlight.

rasheedk avatar rasheedk commented on September 6, 2024

Hi, dhavalwooplr

Crash issue is fixed by changing to your code above, but we can't show the tutorial [Spotlight View ] again if we use the above code....

Crash issue was found when :

  • A spotlight view tutorial is being displayed in screen, user exits the app by calling finish ().
    -Next time when app open's crash report :

Fatal Exception: java.lang.IllegalStateException: Cannot start this animator on a detached view! at android.view.RenderNode.addAnimator(RenderNode.java:812) at android.view.RenderNodeAnimator.setTarget(RenderNodeAnimator.java:300) at android.view.RenderNodeAnimator.setTarget(RenderNodeAnimator.java:282) at android.animation.RevealAnimator.<init>(RevealAnimator.java:37) 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:746) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5443) at java.lang.reflect.Method.invoke(Method.java)

What i have done to avoid crash

  1. Modified SpotlightView.java with your code below
    `SpotlightView.this.post(new Runnable() {
    @OverRide
    public void run() {
    try{
    boolean isAttachedToWindow = true;
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
    isAttachedToWindow = SpotlightView.this.isAttachedToWindow();
    }

                 if(isAttachedToWindow) {
                     if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    
                         if (isRevealAnimationEnabled)
                             startRevealAnimation(activity);
                         else {
                             startFadinAnimation(activity);
                         }
                     } else {
                         startFadinAnimation(activity);
                     }
                 }
             }catch(Exception e){
                 e.printStackTrace();
             }
         }
     });`
    

Issue facing now

  • I used to show the tutorial again by clearing Shared preference values in a Method.
  • Now the tutorial cant be shown again , if i use your code above.

Please help me in fixing this

from spotlight.

Related Issues (20)

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.