Skip to content

Commit 55fce04

Browse files
authored
Androidplot 1.5.2 (halfhp#65)
* target Android SDK 26 * update fig dependency for gradle 3.x.x support * adds custom renderer documentation * remove obsolete class / unnecessary casts * adds sizing section to plot_composition.md * adds more sizing and positioning documentation
1 parent 4662832 commit 55fce04

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+527
-275
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
# CircleCI maintains a library of pre-built images
1818
# documented at https://circleci.com/docs/2.0/circleci-images/
19-
- image: circleci/android:api-25-alpha
19+
- image: circleci/android:api-26-alpha
2020

2121
working_directory: ~/repo
2222

androidplot-core/build.gradle

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ task generateAttrsMarkdown(type: AttrMarkdown) {
5858

5959
android {
6060
compileSdkVersion theCompileSdkVersion
61-
buildToolsVersion theBuildToolsVersion
6261

6362
defaultConfig {
6463
versionCode theVersionCode
@@ -74,7 +73,6 @@ android {
7473
lintOptions {
7574
abortOnError false
7675
}
77-
buildToolsVersion theBuildToolsVersion
7876
}
7977

8078
group = 'com.androidplot'
@@ -85,8 +83,8 @@ def gitUrl = 'https://github.com/halfhp/androidplot.git'
8583

8684
dependencies {
8785

88-
compile 'com.halfhp.fig:figlib:1.0.3'
89-
compile 'com.android.support:support-annotations:25.3.1'
86+
compile 'com.halfhp.fig:figlib:1.0.7'
87+
compile 'com.android.support:support-annotations:27.0.2'
9088
testCompile "org.mockito:mockito-core:1.10.19"
9189
testCompile group: 'junit', name: 'junit', version: '4.12'
9290
testCompile "org.robolectric:robolectric:3.1"

androidplot-core/src/main/java/com/androidplot/Plot.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ private void loadAttrs(AttributeSet attrs, int defStyle) {
520520

521521
// apply "configurator" attrs: (overrides any previously applied styleable attrs)
522522
// filter out androidplot prefixed attrs:
523-
HashMap<String, String> attrHash = new HashMap<String, String>();
523+
HashMap<String, String> attrHash = new HashMap<>();
524524
for (int i = 0; i < attrs.getAttributeCount(); i++) {
525525
String attrName = attrs.getAttributeName(i);
526526

@@ -529,7 +529,11 @@ private void loadAttrs(AttributeSet attrs, int defStyle) {
529529
attrHash.put(attrName.substring(XML_ATTR_PREFIX.length() + 1), attrs.getAttributeValue(i));
530530
}
531531
}
532-
Fig.configure(getContext(), this, attrHash);
532+
try {
533+
Fig.configure(getContext(), this, attrHash);
534+
} catch (FigException e) {
535+
throw new RuntimeException(e);
536+
}
533537
}
534538
}
535539

androidplot-core/src/main/java/com/androidplot/ui/Formatter.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ public Formatter(Context ctx, int xmlCfgId) {
4848
}
4949

5050
public void configure(Context ctx, int xmlCfgId) {
51-
Fig.configure(ctx, this, xmlCfgId);
51+
try {
52+
Fig.configure(ctx, this, xmlCfgId);
53+
} catch (FigException e) {
54+
throw new RuntimeException(e);
55+
}
5256
}
5357

5458
/**

androidplot-core/src/main/java/com/androidplot/ui/SizeMetric.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ protected void validatePair(float value, SizeMode layoutType) {
4343

4444
@Override
4545
public float getPixelValue(float size) {
46-
//switch(layoutType)
4746
switch(getLayoutType()) {
4847
case ABSOLUTE:
4948
return getValue();

androidplot-core/src/main/java/com/androidplot/ui/widget/LegendItemOrganizer.java

Lines changed: 0 additions & 9 deletions
This file was deleted.

androidplot-core/src/main/java/com/androidplot/xy/BarRenderer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ protected RectF createBarRect(float w1, float h1, float w2, float h2, BarFormatt
238238
return result;
239239
}
240240

241-
protected void drawBar(Canvas canvas, Bar bar, RectF rect) {
241+
protected void drawBar(Canvas canvas, Bar<FormatterType> bar, RectF rect) {
242242

243243
// null yVals are skipped:
244244
if(bar.getY() == null) {

androidplot-core/src/main/java/com/androidplot/xy/XYRegionFormatter.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ public class XYRegionFormatter {
4343
public XYRegionFormatter(Context ctx, int xmlCfgId) {
4444
// prevent configuration of classes derived from this one:
4545
if (getClass().equals(XYRegionFormatter.class)) {
46-
Fig.configure(ctx, this, xmlCfgId);
46+
try {
47+
Fig.configure(ctx, this, xmlCfgId);
48+
} catch (FigException e) {
49+
throw new RuntimeException(e);
50+
}
4751
}
4852
}
4953

androidplot-core/src/main/res/values/attrs.xml

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,17 @@
1616
-->
1717

1818
<!--
19+
_This documentation is auto generated from [attrs.xml](../androidplot-core/src/main/res/values/attrs.xml)._
20+
1921
# Androidplot XML Attributes
2022
Attributes are broken down by element followed by either their type or list of accepted values.
21-
<br/>
22-
<br/>
23-
_This documentation is auto generated from [attrs.xml](../androidplot-core/src/main/res/values/attrs.xml) and should not be edited directly._
23+
Supported Elements:
24+
25+
* [Plot](#Plot)
26+
* [XYPlot](#XYPlot)
27+
* [PieChart](#PieChart)
2428
-->
29+
<!--NODOC to generate from command line use: `./gradlew generateAttrsMarkdown` -->
2530
<resources>
2631

2732
<attr name="renderMode" format="enum">
@@ -442,6 +447,10 @@ __dimension|float|integer__
442447
* relative_from_left
443448
* relative_from_right
444449
* relative_from_center
450+
451+
`HorizontalPositioning` component of the `HorizontalPosition` of the `TextLabelWidget`
452+
that displays the domain title.
453+
See [Positioning Widgets](plot_composition.md#positioning-widgets) documentation.
445454
-->
446455
<attr name="domainTitleHorizontalPositioning"/>
447456
<!--
@@ -452,16 +461,28 @@ __dimension|float|integer__
452461
* relative_from_top
453462
* relative_from_bottom
454463
* relative_from_center
464+
465+
`VerticalPositioning` component of the `VerticalPosition` of the `TextLabelWidget`
466+
that displays the domain title.
467+
See [Positioning Widgets](plot_composition.md#positioning-widgets) documentation.
455468
-->
456469
<attr name="domainTitleVerticalPositioning"/>
457470
<!--
458471
### domainTitleHorizontalPosition
459472
__dimension|float|integer__
473+
474+
`float` value component of the `HorizontalPosition` of the `TextLabelWidget`
475+
that displays the domain title.
476+
See [Positioning Widgets](plot_composition.md#positioning-widgets) documentation.
460477
-->
461478
<attr name="domainTitleHorizontalPosition" format="dimension|float|integer"/>
462479
<!--
463480
### domainTitleVerticalPosition
464481
__dimension|float|integer__
482+
483+
`float` value component of the `VerticalPosition` of the `TextLabelWidget`
484+
that displays the domain title.
485+
See [Positioning Widgets](plot_composition.md#positioning-widgets) documentation.
465486
-->
466487
<attr name="domainTitleVerticalPosition" format="dimension|float|integer"/>
467488
<!--
@@ -570,7 +591,7 @@ __boolean__
570591
-->
571592
<attr name="rangeTitleVisible" format="boolean"/>
572593
<!--
573-
### graphHeight
594+
### drawGridOnTop
574595
__boolean__
575596
<br/>
576597
(default is false) When set to true, grid lines are drawn on top of rendered series data
@@ -617,6 +638,9 @@ __dimension|float|integer__
617638
* relative_from_left
618639
* relative_from_right
619640
* relative_from_center
641+
642+
`HorizontalPositioning` component of the `HorizontalPosition` of the `XYGraphWidget`.
643+
See [Positioning Widgets](plot_composition.md#positioning-widgets) documentation.
620644
-->
621645
<attr name="graphHorizontalPositioning"/>
622646
<!--
@@ -627,16 +651,25 @@ __dimension|float|integer__
627651
* relative_from_top
628652
* relative_from_bottom
629653
* relative_from_center
654+
655+
`VerticalPositioning` component of the `VerticalPosition` of the `XYGraphWidget`.
656+
See [Positioning Widgets](plot_composition.md#positioning-widgets) documentation.
630657
-->
631658
<attr name="graphVerticalPositioning"/>
632659
<!--
633660
### graphHorizontalPosition
634661
__dimension|float|integer__
662+
663+
`float` value component of the `HorizontalPosition` of the `XYGraphWidget`.
664+
See [Positioning Widgets](plot_composition.md#positioning-widgets) documentation.
635665
-->
636666
<attr name="graphHorizontalPosition" format="dimension|float|integer"/>
637667
<!--
638668
### graphVerticalPosition
639669
__dimension|float|integer__
670+
671+
`float` value component of the `VerticalPosition` of the `XYGraphWidget`.
672+
See [Positioning Widgets](plot_composition.md#positioning-widgets) documentation.
640673
-->
641674
<attr name="graphVerticalPosition" format="dimension|float|integer"/>
642675
<!--
@@ -977,6 +1010,8 @@ __dimension|float|integer__
9771010
<attr name="legendWidth" format="dimension|float|integer"/>
9781011
<!--
9791012
### legendHorizontalPositioning
1013+
`HorizontalPositioning` component of the `HorizontalPosition` of the `XYLegendWidget`.
1014+
See [Positioning Widgets](plot_composition.md#positioning-widgets) documentation.
9801015
* absolute_from_left
9811016
* absolute_from_right
9821017
* absolute_from_center
@@ -987,6 +1022,8 @@ __dimension|float|integer__
9871022
<attr name="legendHorizontalPositioning"/>
9881023
<!--
9891024
### legendVerticalPositioning
1025+
`VerticalPositioning` component of the `VerticalPosition` of the `XYLegendWidget`.
1026+
See [Positioning Widgets](plot_composition.md#positioning-widgets) documentation.
9901027
* absolute_from_top
9911028
* absolute_from_bottom
9921029
* absolute_from_center
@@ -998,11 +1035,17 @@ __dimension|float|integer__
9981035
<!--
9991036
### legendHorizontalPosition
10001037
__dimension|float|integer__
1038+
1039+
`float` value component of the `HorizontalPosition` of the `XYLegendWidget`.
1040+
See [Positioning Widgets](plot_composition.md#positioning-widgets) documentation.
10011041
-->
10021042
<attr name="legendHorizontalPosition" format="dimension|float|integer"/>
10031043
<!--
10041044
### legendVerticalPosition
10051045
__dimension|float|integer__
1046+
1047+
`float` value component of the `VerticalPosition` of the `XYLegendWidget`.
1048+
See [Positioning Widgets](plot_composition.md#positioning-widgets) documentation.
10061049
-->
10071050
<attr name="legendVerticalPosition" format="dimension|float|integer"/>
10081051
<!--

build.gradle

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ allprojects {
2323
}
2424

2525
ext {
26-
theBuildToolsVersion = '25.0.2'
27-
theCompileSdkVersion = 25
28-
theTargetSdkVersion = 25
26+
theCompileSdkVersion = 26
27+
theTargetSdkVersion = 26
2928
theMinSdkVersion = 5
3029
theVersionName = '1.5.2'
3130
theVersionCode = 0
@@ -35,20 +34,22 @@ buildscript {
3534
repositories {
3635
mavenCentral()
3736
jcenter()
37+
google()
3838
}
3939

4040
dependencies {
41-
classpath 'com.android.tools.build:gradle:2.3.3'
41+
classpath 'com.android.tools.build:gradle:3.0.1'
4242
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
43-
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7'
44-
classpath 'com.vanniktech:gradle-android-junit-jacoco-plugin:0.5.0'
43+
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
44+
classpath 'com.vanniktech:gradle-android-junit-jacoco-plugin:0.6.0'
4545
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.6.3'
4646
}
4747
}
4848

4949
allprojects {
5050
repositories {
5151
mavenCentral()
52+
google()
5253
}
5354
}
5455

0 commit comments

Comments
 (0)