Skip to content

Commit 917f7e4

Browse files
committed
Update readme with new 1.1 features
1 parent 16eac7b commit 917f7e4

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

README.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Step 1. Add the repositories into your build.gradle
2929
Step 2. Add the dependency in the form
3030

3131
dependencies {
32-
compile 'com.github.bmarrdev:android-DecoView-charting:v1.0.1'
32+
compile 'com.github.bmarrdev:android-DecoView-charting:v1.1'
3333
}
3434

3535

@@ -403,6 +403,34 @@ Note that in the example above the color uses transparency to give the edge of t
403403
404404
NOTE: On Android 4.0 to 4.3 Adding an EdgeDetail to a data series will result in Hardware acceleration being turned off for that DecoView. This is due to these platforms not supporting the clipPath() functions with hardware acceleration. It would be unusual for this cause any noticeable difference to the performance of the View.
405405
406+
Adding a shadow to a SeriesItem
407+
===
408+
409+
Shadows were introduced in DecoView 1.1, check you gradle dependency before adding shadows.
410+
411+
![Sample Shadow Image](https://github.com/bmarrdev/android-DecoView-charting/blob/master/art/shadow_example.png)
412+
413+
There are a couple of very important notes before adding shadows.
414+
415+
When creating a DecoView with shadows you must call ```java DecoView.disableHardwareAccelerationForDecoView();``` to disable hardware acceleration for the view. The shadow functionality built into the Android canvas operations are not supported with hardware acceleration. Please note that this may cause performance issues if you are animating multiple views concurrently.
416+
417+
If you are setting a shadow you will most likely want to also add the size of your shadow to the inset of the series item. The reason for this is the the decoView cannot draw outside of the given view canvas. If you don't inset your series then at the top and side edges of the view the shadow will be clipped.
418+
419+
420+
```java
421+
mDecoView = (DecoView) findViewById(R.id.dynamicArcView);
422+
mDecoView.disableHardwareAccelerationForDecoView();
423+
424+
final SeriesItem seriesItem = new SeriesItem.Builder(Color.parseColor("#FFFF8800"))
425+
.setRange(0, mSeriesMax, 0)
426+
.setInset(new PointF(30, 30))
427+
.setShadowSize(30)
428+
.setShadowColor(Color.DKGRAY)
429+
.setInitialVisibility(false)
430+
.build();
431+
```
432+
433+
406434

407435
Fitness tracker Sample
408436
===
@@ -428,7 +456,7 @@ Credits
428456
License
429457
===
430458

431-
Copyright 2015 Brent Marriott
459+
Copyright 2016 Brent Marriott
432460

433461
Licensed under the Apache License, Version 2.0 (the "License");
434462
you may not use this file except in compliance with the License.

art/shadow_example.png

18.3 KB
Loading

0 commit comments

Comments
 (0)