Skip to content

Commit d41d76f

Browse files
committed
Merge branch 'dev'
2 parents c00310a + 8e89885 commit d41d76f

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

app/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ android {
1010
applicationId "de.hauke_stieler.geonotes"
1111
minSdkVersion 16
1212
targetSdkVersion 30
13-
versionCode 1003000
14-
versionName "1.3.0"
13+
versionCode 1003001
14+
versionName "1.3.1"
1515

1616
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1717
}
@@ -40,6 +40,7 @@ dependencies {
4040
implementation 'androidx.appcompat:appcompat:1.2.0'
4141
implementation 'com.google.android.material:material:1.3.0'
4242
implementation 'androidx.preference:preference:1.1.1'
43+
implementation 'org.apache.commons:commons-text:1.9'
4344

4445
testImplementation 'junit:junit:4.13.2'
4546
testImplementation 'org.mockito:mockito-inline:3.8.0'

app/src/main/java/de/hauke_stieler/geonotes/map/Map.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,15 @@ private void initAndSelectMarker(GeoPoint location) {
230230

231231
/**
232232
* Tries to snap the location to the last known GPS of the distance on the screen is below 50dp.
233+
* If no GPS location available or if the distance to the current GPS location is lower than 50dp, then the GPS location is returned, otherwise the input is returned.
233234
*
234-
* @return If distance <50dp then GPS location is returned, if not, the input is returned.
235+
* @return The new location, snapped if possible.
235236
*/
236237
private GeoPoint snapToGpsLocation(GeoPoint location) {
238+
if (gpsLocationProvider.getLastKnownLocation() == null) {
239+
return location;
240+
}
241+
237242
GeoPoint gpsLocation = new GeoPoint(gpsLocationProvider.getLastKnownLocation());
238243

239244
Point markerLocationOnScreen = map.getProjection().toPixels(location, null);

app/src/main/java/de/hauke_stieler/geonotes/map/MarkerWindow.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
import androidx.core.content.FileProvider;
3232

33+
import org.apache.commons.text.StringEscapeUtils;
3334
import org.osmdroid.api.IMapView;
3435
import org.osmdroid.views.MapView;
3536
import org.osmdroid.views.overlay.Marker;
@@ -189,6 +190,8 @@ public void onOpen(Object item) {
189190
if (snippet == null) {
190191
snippet = "";
191192
}
193+
snippet = StringEscapeUtils.escapeHtml4(snippet).replace("\n", "<br>");
194+
192195
Spanned snippetHtml = Html.fromHtml(snippet);
193196
EditText descriptionView = mView.findViewById(mDescriptionId /*R.id.description*/);
194197
if (descriptionView != null) {

metadata/en-US/changelogs/1003001.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
1.3.1:
2+
3+
* Fix rotation bug and resulting crash
4+
* Fix line break bug in note description

0 commit comments

Comments
 (0)