Update gpx open

This commit is contained in:
Victor Shcherb 2018-04-15 16:30:20 +02:00
parent 6a33b5f89a
commit 2843126682
3 changed files with 7 additions and 2 deletions

View file

@ -75,6 +75,7 @@ h3 {
font-size: 1.2em;
font-family: sans-serif;
word-wrap: break-word;
font-weight: normal;
margin-top: 3%;
margin-bottom: 3%;
}

View file

@ -1290,8 +1290,10 @@ public class GPXUtilities {
}
serializer.endTag(null, "gpx"); //$NON-NLS-1$
serializer.flush();
serializer.endDocument();
serializer.flush();
} catch (RuntimeException e) {
log.error("Error saving gpx", e); //$NON-NLS-1$
return ctx.getString(R.string.error_occurred_saving_gpx);

View file

@ -158,7 +158,9 @@ public class WikivoyageArticleDialogFragment extends WikivoyageBaseDialogFragmen
});
final GPXFile gpx = article.getGpxFile();
TextView trackButton = (TextView) mainView.findViewById(R.id.gpx_button);
trackButton.setText(trackButton.getText() + " (" + gpx.getPoints().size() +")");
trackButton.setCompoundDrawablesWithIntrinsicBounds(
getActiveIcon(R.drawable.ic_action_track_16), null, null, null
);
@ -171,7 +173,7 @@ public class WikivoyageArticleDialogFragment extends WikivoyageBaseDialogFragmen
}
WikivoyageDbHelper dbHelper = getMyApplication().getWikivoyageDbHelper();
File file = getMyApplication().getAppPath(IndexConstants.GPX_TRAVEL_DIR + dbHelper.getGPXName(article));
GPXFile gpx = article.getGpxFile();
GPXUtilities.writeGpxFile(file, gpx, getMyApplication());
Bundle args = new Bundle();
args.putString(WikivoyageArticleContentsFragment.CONTENTS_JSON_KEY, article.getContentsJson());