Comments (6)
@bmarrdev Do you have any feedback on this matter?
from android-decoview-charting.
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.
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:
- Cold start MainActivity, so that onCreate() is called with the code above.
- 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.
- Wait for the remaining of the animation to complete (~4s).
- 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.
Thanks for that info. I will investigate it this weekend and report back.
from android-decoview-charting.
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.
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)
- Line width completely different for different screen sizes HOT 5
- Point and arrow at the edges of the series
- How to fixed one series and overlap two other serieses
- Large load on CPU HOT 2
- Series item with start angle
- how to add gradient to Series Item ? HOT 1
- TextView HOT 1
- Series label gets hidden HOT 4
- How to only use one of the charts
- In File SampleFragment4
- Decoview gets hide
- Label on point series
- Dyanamically changing the percentage value HOT 2
- Decoview with labels at fixed position
- Bug refreshing UI
- Change position of Label Text to end of progress of each SeriesItem
- How to draw line path on top of arc
- Is there any way to show big circle end of the progress
- Is there a way to add a gradient colour?
- Can I set click events? How to set up
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-decoview-charting.