Giter VIP home page Giter VIP logo

Comments (6)

bogdanzurac avatar bogdanzurac commented on July 3, 2024

@bmarrdev Do you have any feedback on this matter?

from android-decoview-charting.

bmarrdev avatar bmarrdev commented on July 3, 2024

I was unable to reproduce this issue. I will take another look at this when I get a chance. It would be helpful if you could share a gist of an activity that exhibits the behaviour.

from android-decoview-charting.

bogdanzurac avatar bogdanzurac commented on July 3, 2024

I'll post the entire DecoView related code, because the rest is pretty much the default project in AS. You can copy paste this inside an empty project and it's the same thing. I've even increased the animation durations in order to make it easier to spot.

double total = 3500;
double partial = 2570;
int percentage = (int) (partial * 100 / total);

mDecoView = (DecoView) findViewById(R.id.activity_main_decoview);

mDecoView.addSeries(new SeriesItem.Builder(ContextCompat.getColor(MainActivity.this, R.color.color_gray))
                .setSeriesLabel(new SeriesLabel.Builder(total + " USD")
                        .setColorBack(ContextCompat.getColor(MainActivity.this, R.color.color_gray_darker))
                        .setColorText(ContextCompat.getColor(MainActivity.this, R.color.color_gray))
                        .setTypeface(Typeface.create("sans-serif-light", Typeface.NORMAL))
                        .build())
                .setRange(0, 100, 100)
                .setInitialVisibility(false)
                .setLineWidth(32f)
                .build());

final SeriesItem seriesItem = new SeriesItem.Builder(ContextCompat.getColor(MainActivity.this, R.color.colorPrimary))
                .setSeriesLabel(new SeriesLabel.Builder(partial + " USD")
                        .setColorBack(ContextCompat.getColor(MainActivity.this, R.color.color_gray_darker))
                        .setColorText(ContextCompat.getColor(MainActivity.this, R.color.color_gray))
                        .setTypeface(Typeface.create("sans-serif-light", Typeface.NORMAL))
                        .build())
                .setRange(0, 100, 0)
                .setInitialVisibility(false)
                .setLineWidth(32f)
                .setCapRounded(true)
                .setShowPointWhenEmpty(true)
                .build();

int seriesIndex = mDecoView.addSeries(seriesItem);

mDecoView.executeReset();
mDecoView.addEvent(new DecoEvent.Builder(DecoEvent.EventType.EVENT_SHOW, true)
                .setDelay(1000)
                .setDuration(3000)
                .build());
mDecoView.addEvent(new DecoEvent.Builder(percentage).setIndex(seriesIndex).setDelay(4000).setDuration(2000).build());

Now then, the test case is the following:

  1. Cold start MainActivity, so that onCreate() is called with the code above.
  2. As soon as you see the series with the colorPrimary color appear and start growing as part of the show animation, immediately tap the Home button.
  3. Wait for the remaining of the animation to complete (~4s).
  4. Enter the app again (not cold start).

If you tap the Home button before the animation starts or after it ends, then everything will look fine, so if you don't get it right the first try, try some more. However, if you got the timing right, the result should look pretty similar to the initial screenshot. I presume the grow animation incorrectly sets the second series line width if the animation is interrupted, which isn't good.

from android-decoview-charting.

bmarrdev avatar bmarrdev commented on July 3, 2024

Thanks for that info. I will investigate it this weekend and report back.

from android-decoview-charting.

bmarrdev avatar bmarrdev commented on July 3, 2024

I have reproduced the issue. I couldn't see an immediate reason for it, but as soon as I get some free time I will find and post a fix. An option for you to work around this issue for now recreate the DecoView and set the positions or events required in your Activity onResume()

from android-decoview-charting.

bmarrdev avatar bmarrdev commented on July 3, 2024

I have included a fix for this issue in a new build, v0.9.6.

To access this fix update your gradle dependencies:
compile 'com.github.bmarrdev:android-DecoView-charting:v0.9.6'

from android-decoview-charting.

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.