Skip to content

Commit

Permalink
fix #7
Browse files Browse the repository at this point in the history
  • Loading branch information
woheller69 committed Jan 10, 2023
1 parent 0b4b447 commit 9667474
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ android {
applicationId "org.woheller69.lavatories"
minSdkVersion 26
targetSdkVersion 31
versionCode 14
versionName "1.4"
versionCode 15
versionName "1.5"

buildConfigField "String", "BASE_URL", "\"https://overpass-api.de/api/interpreter\""
buildConfigField "String", "BASE_URL2","\"https://nominatim.openstreetmap.org/\""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.woheller69.lavatories.database.SQLiteHelper;
import org.woheller69.lavatories.database.Lavatory;
import org.woheller69.lavatories.api.IDataExtractor;
import java.nio.charset.StandardCharsets;


public class OSMDataExtractor implements IDataExtractor {
Expand Down Expand Up @@ -53,7 +54,9 @@ public Lavatory extractLavatory(String data, int cityId, Context context) {
lavatory.setDistance(Math.round(cityLocation.distanceTo(toiletLocation)/10)/100.0);
lavatory.setUuid(json.getString("id"));
JSONObject tags = json.getJSONObject("tags");
if (tags.has("operator")) lavatory.setOperator(tags.getString("operator"));
//fix issues with ü instead of ü, etc. OSM data is UTF-8 encoded
//String(byte[] bytes, Charset charset) constructs a new String by decoding the specified array of bytes using the specified charset.
if (tags.has("operator")) lavatory.setOperator(new String(tags.getString("operator").getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8));
if (tags.has("opening_hours")) lavatory.setOpeningHours(tags.getString("opening_hours"));
if (tags.has("access") && tags.getString(("access")).contains("private")) return null;
lavatory.setWheelchair(tags.has("wheelchair") && !tags.getString(("wheelchair")).equals("no"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,10 @@
import android.view.ViewGroup;

import org.woheller69.lavatories.R;
import org.woheller69.lavatories.activities.LavSeekerActivity;
import org.woheller69.lavatories.database.Lavatory;
import org.woheller69.lavatories.ui.RecycleList.CityAdapter;
import org.woheller69.lavatories.ui.RecycleList.OnSwipeDownListener;
import org.woheller69.lavatories.ui.updater.IUpdateableCityUI;
import org.woheller69.lavatories.ui.updater.ViewUpdater;
import org.woheller69.lavatories.ui.viewPager.CityPagerAdapter;

import java.util.List;

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<string name="dialog_OK_button">OK</string>
<string name="dialog_NO_button">Nein</string>
<string name="dialog_Later_button">Vielleicht später</string>
<string name="dialog_StarOnGitHub">Mögen Sie diese App? Bitte vergeben Sie einen Stern auf GitHub.</string>
<string name="dialog_StarOnGitHub">Mögen Sie diese App? Bitte vergeben Sie einen Stern auf GitHub oder spendieren Sie dem Entwickler einen Kaffee über PayPal.</string>
<string name="closed">Geschlossen</string>
<string name="open">Geöffnet</string>
<string name="error_no_lavatory_found">Keine Toilette gefunden</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<string name="dialog_OK_button">Oui</string>
<string name="dialog_NO_button">Non</string>
<string name="dialog_Later_button">Plus tard</string>
<string name="dialog_StarOnGitHub">Vous aimez cette application? Donnez lui une étoile sur GitHub.</string>
<string name="dialog_StarOnGitHub">Aimez-vous cette application? Veuillez donner une étoile sur GitHub ou acheter un café au développeur via PayPal.</string>
<string name="closed">Fermée</string>
<string name="open">Ouverte</string>
<string name="error_no_lavatory_found">Pas de toilettes à proximité</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<string name="dialog_OK_button">OK</string>
<string name="dialog_NO_button">No</string>
<string name="dialog_Later_button">Maybe later</string>
<string name="dialog_StarOnGitHub">Do you like this app? Please star it on GitHub.</string>
<string name="dialog_StarOnGitHub">Do you like this app? Please give a star on GitHub or buy the developer a coffee via PayPal.</string>
<string name="closed">Closed</string>
<string name="open">Open</string>
<string name="error_no_lavatory_found">No lavatories found</string>
Expand Down
1 change: 1 addition & 0 deletions fastlane/metadata/android/de-DE/changelogs/15.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fehlerbehebung
1 change: 1 addition & 0 deletions fastlane/metadata/android/en-US/changelogs/15.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Bugfix

0 comments on commit 9667474

Please sign in to comment.