Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Android Studio generated folders
.navigation/
captures/
.externalNativeBuild

# IntelliJ project files
*.iml
.idea/

# Misc
.DS_Store
46 changes: 15 additions & 31 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,24 @@
language: android

env:
global:
# install timeout in minutes (2 minutes by default)
- ADB_INSTALL_TIMEOUT=24
- EMULATOR_API_LEVEL=21
- ANDROID_API_LEVEL=23
- ANDROID_BUILD_TOOLS_VERSION=23.0.3
- ANDROID_ABI=armeabi-v7a
jdk:
- oraclejdk8

before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock

cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/

android:
components:
- platform-tools
- tools
- build-tools-$ANDROID_BUILD_TOOLS_VERSION
- android-$ANDROID_API_LEVEL
- android-$EMULATOR_API_LEVEL
- platform-tools
- build-tools-25.0.3
- android-25
- extra-android-m2repository
- extra-android-support
- sys-img-armeabi-v7a-android-$ANDROID_API_LEVEL
- sys-img-armeabi-v7a-android-$EMULATOR_API_LEVEL

jdk: oraclejdk7

# Turn off caching to avoid any caching problems
cache: false

# Use the Travis Container-Based Infrastructure
sudo: false

# Emulator Management: Create, Start and Wait
before_script:
- echo no | android create avd --force -n test -t android-$EMULATOR_API_LEVEL --abi $ANDROID_ABI
- emulator -avd test -no-skin -no-audio -no-window &
- android-wait-for-emulator
- adb shell input keyevent 82 &

before_install:
- chmod +x gradlew
script:
./gradlew build
27 changes: 12 additions & 15 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# DecoView Changelog

v1.0.0
===
## [Unreleased]

- Update to latest support libraries
- Minimum SDK raised to 9 (Android 2.3)

## 1.0.0

- Support for Android Studio 2.0
- Update targetSdkVersion to 23
Expand All @@ -10,41 +14,34 @@ v1.0.0
- Verify split screen behavior on Android N
- Promote release to 1.0

v0.9.6
===
## 0.9.6

- Fix issue where line width of arc was incorrect if onPause was called during the Event Show effect

v0.9.5
===
## 0.9.5

- Remove `android:allowBackup="true"` from library project to prevent compilation issues for projects that require this attribute to be overridden.
This manifest merger issue is discussed in the AOSP issue tracker issue 70073.

v0.9.4
===
## 0.9.4

- Added pause() and resume() support for data series move animation
- Added pause/resume sample fragment to sample app
- Added support for 0 duration move events (no animation)
- Changed default move effect animation duration from 2000ms to duration calculated by total series spin duration
- Deprecated function DecoView.getSeriesItem(int index). Use DecoView.getChartSeries(index).getSeriesItem()

v0.9.3
===
## 0.9.3

- All xml attributes prefixed with 'dv_'

v0.9.2
===
## 0.9.2

- Add Travis Continuous Integration
- Added support back to Android 2.2 (API 8)
- Added new example charts to sample app
- Reverse primary and secondary color for drawing gradient


v0.9.1
===
## 0.9.1

Initial implementation
83 changes: 32 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,26 @@ Sample app available from the play store.

[![Google Play Store](https://github.com/bmarrdev/android-DecoView-charting/blob/master/art/en_app_rgb_wo_60.png)](https://play.google.com/store/apps/details?id=com.hookedonplay.decoviewsample)

Including DecoView in your project
===
## Including DecoView in your project

Step 1. Add the repositories into your build.gradle

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

Step 2. Add the dependency in the form

dependencies {
compile 'com.github.bmarrdev:android-DecoView-charting:v1.2'
}

```groovy
dependencies {
compile 'com.github.bmarrdev:android-DecoView-charting:v1.2'
}
```

Usage
===
## Usage

DecoView is subclassed from the Android View class. Just like other View subclasses, such as TextView and ImageView, it can be added and configured from your layout XML then controlled in your Activity code.

Expand All @@ -45,7 +46,6 @@ The main concepts you need to understand are:
- Use [SeriesItem.Builder](https://github.com/bmarrdev/android-DecoView-charting/blob/master/decoviewlib/src/main/java/com/hookedonplay/decoviewlib/charts/SeriesItem.java) to build one or more data series or your DecoView will not be visible
- Use [DecoEvent.Builder](https://github.com/bmarrdev/android-DecoView-charting/blob/master/decoviewlib/src/main/java/com/hookedonplay/decoviewlib/events/DecoEvent.java) to schedule animating events for each data series


**Add DecoView to your xml layout**

```xml
Expand Down Expand Up @@ -74,7 +74,6 @@ SeriesItem seriesItem1 = new SeriesItem.Builder(Color.argb(255, 64, 196, 0))
.build();

int series1Index = arcView.addSeries(seriesItem1);

```

**Add events to animate the data series**
Expand All @@ -91,8 +90,7 @@ arcView.addEvent(new DecoEvent.Builder(10).setIndex(series1Index).setDelay(12000

```

Chart Shape and orientation
===
### Chart Shape and orientation

The chart can be a full circle (360 degrees) or part of a circle. The number of degrees and the orientation can be set in the DecoView.

Expand All @@ -108,8 +106,7 @@ By default when using a full circle the data series will originate at the top of

When the view is not a complete circle the default initial point is the bottom of the view. Passing 90 will set the initial point to the leftmost point and 180 the topmost.

Chart Gravity
===
### Chart Gravity

By default the chart will maintain a square shape regardless of the dimensions of the DecoView in the layout.

Expand All @@ -135,8 +132,7 @@ decoView.setHorizGravity(DecoView.HorizGravity.GRAVITY_HORIZONTAL_FILL);
decoView.setVertGravity(DecoView.VertGravity.GRAVITY_VERTICAL_BOTTOM);
```

Constructing a data series
===
### Constructing a data series

One or more data series can be added to the DecoView. These are created using the SeriesItem.Builder(...) class.

Expand Down Expand Up @@ -166,8 +162,7 @@ SeriesItem seriesItem1 = new SeriesItem.Builder(Color.argb(255, 64, 196, 0))
.build();
```

Adding a listener to a data series
===
### Adding a listener to a data series

Once you have a SeriesItem created you can optionally add a SeriesItem.SeriesItemListener() that will allow you to use a callback to monitor the progress of an animation for the data series.

Expand Down Expand Up @@ -196,8 +191,7 @@ seriesItem.addArcSeriesItemListener(new SeriesItem.SeriesItemListener() {

Note that the progress callback includes a percentComplete parameter. This is the percent complete of the current animation being executed, you can calculate the percent filled using the current position.

Animating the data series
===
### Animating the data series

Each data series in the DecoView can be animated in a number of ways.

Expand Down Expand Up @@ -230,8 +224,7 @@ In the above example some important points to note are:
- The index that is passed was returned from the DecoView.addSeries(...) function call
- All durations are specified in milliseconds

Adding a listener to an DecoEvent
===
### Adding a listener to an DecoEvent

Adding a listener to a DecoEvent is useful for getting a callback when an event starts and also when an event finishes.

Expand All @@ -254,8 +247,7 @@ decoView.addEvent(new DecoEvent.Builder(EventType.EVENT_HIDE, false)
.build());
```

Configuring animation
===
### Configuring animation

Animating the movement when moving the current position of a data series is done using the built-in [Android Interpolator classes](http://developer.android.com/reference/android/view/animation/Interpolator.html).

Expand All @@ -282,8 +274,7 @@ decoView.addEvent(new DecoEvent.Builder(10)
.build());
```

Configuring the animation duration
===
### Configuring the animation duration

Much like configuring the Interpolator, the total duration taken to complete an animation can be set when creating the data series, or overridden for each event.

Expand All @@ -308,8 +299,7 @@ decoView.addEvent(new DecoEvent.Builder(10)
.build());
```

Adding labels to a data series
===
### Adding labels to a data series

Labels can be added to one or more data series. The labels will only be shown when the data series is visible.

Expand All @@ -332,8 +322,7 @@ It is possible to use a custom font for the text used on the data labels. Load t

Note: Labels are currently not supported on DecoViews which have a data series that move in an anti-clockwise direction.

Insetting arc radius
===
### Insetting arc radius

By default each arc in a series will be located at the center of the widest series of data. The result of this is that two arcs with the same line width will be drawn at the same radius from the center of the view.

Expand All @@ -352,8 +341,7 @@ SeriesItem seriesItem = new SeriesItem.Builder(Color.parseColor("#FF00FF00")

It is also possible to move a data series in an outward direction by using a negative inset. To do this you need to ensure that you don't move the data series outside the viewable area of the View.

Animating color change
===
### Animating color change

Solid color change can be animated from one color to another. This can be done as a stand alone event or during a move event.

Expand Down Expand Up @@ -381,8 +369,7 @@ decoView.addEvent(new DecoEvent.Builder(EventType.EVENT_COLOR_CHANGE, Color.pars

Note: It is not possible to animate color change on series with a color gradient.

Adding an EdgeDetail to a data series
===
### Adding an EdgeDetail to a data series

The EdgeDetail class allows you to apply an effect to the edge of a data series. The image below shows an EdgeDetail applied to each data series.

Expand All @@ -403,8 +390,7 @@ Note that in the example above the color uses transparency to give the edge of t

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.

Adding a shadow to a SeriesItem
===
### Adding a shadow to a SeriesItem

Shadows were introduced in DecoView 1.1, check you gradle dependency before adding shadows.

Expand All @@ -430,31 +416,26 @@ final SeriesItem seriesItem = new SeriesItem.Builder(Color.parseColor("#FFFF8800
.build();
```



Fitness tracker Sample
===
## Fitness tracker Sample

In addition to the samples built in this repository a [Fitness tracker sample is available on GitHub](https://github.com/bmarrdev/fauxfit-decoview-sample).

The steps required to build this sample are detailed in the following article:

[https://androidbycode.wordpress.com/2015/08/16/creating-a-google-fit-style-circular-animated-view/](https://androidbycode.wordpress.com/2015/08/16/creating-a-google-fit-style-circular-animated-view/)

Requirements
===
## Requirements

Android 2.3+

Android 2.2+
## Credits

Credits
===
- Continuous integration is provided by [Travis CI](https://travis-ci.org/bmarrdev/android-DecoView-charting).
- Jake Wharton for <a href="https://github.com/JakeWharton/NineOldAndroids/">NineOldAndroids</a> allowing support for Android 2.2+ devices.
- [Infographic vector designed by Freepik](http://www.freepik.com/free-photos-vectors/infographic)
- [Avatars designed by Freepik](http://www.freepik.com/free-vector/family-avatars_796722.htm)

License
===
## License

Copyright 2016 Brent Marriott

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.android.tools.build:gradle:2.3.3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
1 change: 0 additions & 1 deletion decoviewlib/.gitignore

This file was deleted.

Loading