Skip to content

Commit

Permalink
Merge branch 'release/1.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
ticofab committed Jul 2, 2018
2 parents 76520b0 + 0e46c52 commit 4f8bb59
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 25 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## Version 1.2.0 *(July 2nd 2018)*

* Parsing WayPoint description.

## Version 1.1.2 *(June 26th 2018)*

* Fix to prevent endless loop in case of malformed GPX track (thanks to D. Elliot!)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Download
Grab via Gradle:

```groovy
api 'io.ticofab.androidgpxparser:parser:1.1.2'
// compile 'io.ticofab.androidgpxparser:parser:1.1.2' - for gradle plugin < 3.0.0
api 'io.ticofab.androidgpxparser:parser:1.2.0'
// compile 'io.ticofab.androidgpxparser:parser:1.2.0' - for gradle plugin < 3.0.0
```

Dependencies
Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ android {
minSdkVersion 14
targetSdkVersion 27
versionCode 2
versionName "1.1.2"
versionName "1.2.0"
}
buildTypes {
release {
Expand Down
8 changes: 4 additions & 4 deletions parser/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ext {
siteUrl = 'https://github.com/ticofab/android-gpx-parser'
gitUrl = 'https://github.com/ticofab/android-gpx-parser.git'

libraryVersion = '1.1.2'
libraryVersion = '1.2.0'

developerId = 'ticofab'
developerName = 'Fabio Tiriticco'
Expand All @@ -31,8 +31,8 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 27
versionCode 6
versionName "1.1.2"
versionCode 7
versionName "1.2.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand All @@ -46,7 +46,7 @@ android {
dependencies {
// JodaTime for Android
// https://github.com/dlew/joda-time-android
implementation 'net.danlew:android.joda:2.9.9.2'
implementation 'net.danlew:android.joda:2.9.9.4'

androidTestImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support:support-annotations:27.1.1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ public void testGarminBaseCampExport() throws IOException, XmlPullParserExceptio
assertEquals(3, gpx.getWayPoints().size());
assertEquals(1, gpx.getRoutes().size());
assertEquals(7, gpx.getRoutes().get(0).getRoutePoints().size());
assertEquals(" A92", gpx.getWayPoints().get(0).getDesc());
assertEquals("Erding Ab", gpx.getWayPoints().get(2).getDesc());
}

@Test(expected = XmlPullParserException.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,9 @@ private Point readPoint(Point.Builder builder, XmlPullParser parser, String tagN
case TAG_NAME:
builder.setName(readName(parser));
break;
case TAG_DESC:
builder.setDesc(readDesc(parser));
break;
case TAG_ELEVATION:
builder.setElevation(readElevation(parser));
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,22 @@

/**
* A point containing a location, time and name.
*
*/
public abstract class Point {
private final Double mLatitude;
private final Double mLongitude;
private final Double mElevation;
private final DateTime mTime;
private String mName;
private final String mName;
private final String mDesc;

Point(Builder builder) {
mLatitude = builder.mLatitude;
mLongitude = builder.mLongitude;
mElevation = builder.mElevation;
mTime = builder.mTime;
mName = builder.mName;
mDesc = builder.mDesc;
}

/**
Expand Down Expand Up @@ -53,12 +54,20 @@ public String getName() {
return mName;
}

/**
* @return the description
*/
public String getDesc() {
return mDesc;
}

public static abstract class Builder {
private Double mLatitude;
private Double mLongitude;
private Double mElevation;
private DateTime mTime;
private String mName;
private String mDesc;

public Builder setLatitude(Double latitude) {
mLatitude = latitude;
Expand All @@ -80,8 +89,13 @@ public Builder setTime(DateTime time) {
return this;
}

public Builder setName(String mName) {
this.mName = mName;
public Builder setName(String mame) {
mName = mame;
return this;
}

public Builder setDesc(String desc) {
mDesc = desc;
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,38 +72,38 @@ public Builder setRoutePoints(List<RoutePoint> routePoints) {
return this;
}

public Builder setRouteName(String mRouteName) {
this.mRouteName = mRouteName;
public Builder setRouteName(String routeName) {
mRouteName = routeName;
return this;
}

public Builder setRouteDesc(String mRouteDesc) {
this.mRouteDesc = mRouteDesc;
public Builder setRouteDesc(String routeDesc) {
mRouteDesc = routeDesc;
return this;
}

public Builder setRouteCmt(String mRouteCmt) {
this.mRouteCmt = mRouteCmt;
public Builder setRouteCmt(String routeCmt) {
mRouteCmt = routeCmt;
return this;
}

public Builder setRouteSrc(String mRouteSrc) {
this.mRouteSrc = mRouteSrc;
public Builder setRouteSrc(String routeSrc) {
mRouteSrc = routeSrc;
return this;
}

public Builder setRouteNumber(Integer mRouteNumber) {
this.mRouteNumber = mRouteNumber;
public Builder setRouteNumber(Integer routeNumber) {
mRouteNumber = routeNumber;
return this;
}

public Builder setRouteLink(Link mRouteLink) {
this.mRouteLink = mRouteLink;
public Builder setRouteLink(Link routeLink) {
mRouteLink = routeLink;
return this;
}

public Builder setRouteType(String mRouteType) {
this.mRouteType = mRouteType;
public Builder setRouteType(String routeType) {
mRouteType = routeType;
return this;
}

Expand Down

0 comments on commit 4f8bb59

Please sign in to comment.