From 72c4beffc3b677f7b8f4dcf78790195dac9b5a50 Mon Sep 17 00:00:00 2001 From: GaidamakUA Date: Mon, 30 Nov 2015 18:28:57 +0200 Subject: [PATCH 1/8] RateUs: Added handling of Amazone version. --- .../net/osmand/plus/OsmandApplication.java | 2 +- .../plus/dashboard/DashRateUsFragment.java | 15 ++++---------- .../plus/dialogs/RateUsBottomSheetDialog.java | 20 +++++++++---------- 3 files changed, 14 insertions(+), 23 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/OsmandApplication.java b/OsmAnd/src/net/osmand/plus/OsmandApplication.java index 272e41a8aa..4de2113293 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandApplication.java +++ b/OsmAnd/src/net/osmand/plus/OsmandApplication.java @@ -177,7 +177,7 @@ public class OsmandApplication extends MultiDexApplication { if (routingHelper != null) { routingHelper.getVoiceRouter().onApplicationTerminate(); } - if(RateUsBottomSheetDialog.shouldShow(osmandSettings)) { + if(RateUsBottomSheetDialog.shouldShow(this)) { osmandSettings.RATE_US_STATE.set(RateUsBottomSheetDialog.RateUsState.IGNORED); } getNotificationHelper().removeServiceNotification(); diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashRateUsFragment.java b/OsmAnd/src/net/osmand/plus/dashboard/DashRateUsFragment.java index 5d3a580444..bd7d2f5b1e 100644 --- a/OsmAnd/src/net/osmand/plus/dashboard/DashRateUsFragment.java +++ b/OsmAnd/src/net/osmand/plus/dashboard/DashRateUsFragment.java @@ -1,6 +1,5 @@ package net.osmand.plus.dashboard; -import android.content.ActivityNotFoundException; import android.content.Intent; import android.net.Uri; import android.os.Bundle; @@ -13,6 +12,7 @@ import android.widget.TextView; import net.osmand.plus.OsmandSettings; import net.osmand.plus.R; +import net.osmand.plus.Version; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.dashboard.tools.DashFragmentData; import net.osmand.plus.dialogs.RateUsBottomSheetDialog; @@ -24,7 +24,7 @@ public class DashRateUsFragment extends DashBaseFragment { new DashboardOnMap.DefaultShouldShow() { @Override public boolean shouldShow(OsmandSettings settings, MapActivity activity, String tag) { - return RateUsBottomSheetDialog.shouldShow(settings) + return RateUsBottomSheetDialog.shouldShow(activity.getMyApplication()) && super.shouldShow(settings, activity, tag); } }; @@ -86,16 +86,9 @@ public class DashRateUsFragment extends DashBaseFragment { return; case USER_LIKES_APP: settings.RATE_US_STATE.set(RateUsBottomSheetDialog.RateUsState.LIKED); - // Assuming GooglePlay - Uri uri = Uri.parse("market://details?id=" + getActivity().getPackageName()); + Uri uri = Uri.parse(Version.marketPrefix(getMyApplication()) + getActivity().getPackageName()); Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri); - try { - startActivity(goToMarket); - } catch (ActivityNotFoundException e) { - startActivity(new Intent(Intent.ACTION_VIEW, - Uri.parse("http://play.google.com/store/apps/details?id=" - + getActivity().getPackageName()))); - } + startActivity(goToMarket); break; case USER_DISLIKES_APP: String email = getString(R.string.support_email); diff --git a/OsmAnd/src/net/osmand/plus/dialogs/RateUsBottomSheetDialog.java b/OsmAnd/src/net/osmand/plus/dialogs/RateUsBottomSheetDialog.java index 88a0d899fe..93a12ec345 100644 --- a/OsmAnd/src/net/osmand/plus/dialogs/RateUsBottomSheetDialog.java +++ b/OsmAnd/src/net/osmand/plus/dialogs/RateUsBottomSheetDialog.java @@ -1,6 +1,5 @@ package net.osmand.plus.dialogs; -import android.content.ActivityNotFoundException; import android.content.Intent; import android.net.Uri; import android.os.Bundle; @@ -11,8 +10,10 @@ import android.view.ViewGroup; import android.widget.Button; import android.widget.TextView; +import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandSettings; import net.osmand.plus.R; +import net.osmand.plus.Version; import net.osmand.plus.base.BottomSheetDialogFragment; import java.util.Calendar; @@ -34,7 +35,11 @@ public class RateUsBottomSheetDialog extends BottomSheetDialogFragment { return view; } - public static boolean shouldShow(OsmandSettings settings) { + public static boolean shouldShow(OsmandApplication application) { + if (Version.isMarketEnabled(application)) { + return false; + } + OsmandSettings settings = application.getSettings(); if(!settings.LAST_DISPLAY_TIME.isSet()) { settings.LAST_DISPLAY_TIME.set(System.currentTimeMillis()); } @@ -110,16 +115,9 @@ public class RateUsBottomSheetDialog extends BottomSheetDialogFragment { return; case USER_LIKES_APP: settings.RATE_US_STATE.set(RateUsBottomSheetDialog.RateUsState.LIKED); - // Assuming GooglePlay - Uri uri = Uri.parse("market://details?id=" + getActivity().getPackageName()); + Uri uri = Uri.parse(Version.marketPrefix(getMyApplication()) + getActivity().getPackageName()); Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri); - try { - startActivity(goToMarket); - } catch (ActivityNotFoundException e) { - startActivity(new Intent(Intent.ACTION_VIEW, - Uri.parse("http://play.google.com/store/apps/details?id=" - + getActivity().getPackageName()))); - } + startActivity(goToMarket); break; case USER_DISLIKES_APP: String email = getString(R.string.support_email); From 6f4c90fe4af762aa6d00dbfddc77296f596a0d12 Mon Sep 17 00:00:00 2001 From: jan madsen Date: Mon, 30 Nov 2015 21:03:30 +0100 Subject: [PATCH 2/8] Translated using Weblate (Danish) Currently translated at 97.9% (2289 of 2337 strings) --- OsmAnd/res/values-da/phrases.xml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/OsmAnd/res/values-da/phrases.xml b/OsmAnd/res/values-da/phrases.xml index 2fc542bc18..b76b54fb27 100644 --- a/OsmAnd/res/values-da/phrases.xml +++ b/OsmAnd/res/values-da/phrases.xml @@ -2517,4 +2517,26 @@ Med internetadgang + Sundhedsspeciale: alment praktiserende læge + Sundhedsspeciale: oftalmologi + Sundhedsspeciale: gynækologi + Sundhedsspeciale: intern medicin + Sundhedsspeciale: ortopædi + oto-rhino-laryngolog: oto-rhino-laryngolog + Sundhedsspeciale: Pædiatri + Sundhedsspeciale: pædiatri: nej + Sundhedsspeciale: dermatologi + Sundhedsspeciale: Urologi + Sundhedsspeciale: almen kirurgi + Sundhedsspeciale: radiologi + Sundhedsspeciale: psykiatri + Sundhedsspeciale: neurologi + Sundhedsspeciale: dermato-venerologi + Sundhedsspeciale: kardiologi + Sundhedsspeciale: traumatologi + Sundhedsspeciale: klinisk biologi + Sundhedsspeciale: osteopati + Sundhedsspeciale: anæstetika + Sundhedsspeciale: respiratory medicine + Sundhedsspeciale: tand-, mund- og kæbe ansigtskirurgi From 9db144e79a66ab0f811c45904ffdef37ecec6d56 Mon Sep 17 00:00:00 2001 From: jf-simon Date: Mon, 30 Nov 2015 21:03:50 +0100 Subject: [PATCH 3/8] Translated using Weblate (German) Currently translated at 99.7% (2331 of 2337 strings) --- OsmAnd/res/values-de/phrases.xml | 64 ++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/OsmAnd/res/values-de/phrases.xml b/OsmAnd/res/values-de/phrases.xml index 5bf7bad0e3..dd728e788b 100644 --- a/OsmAnd/res/values-de/phrases.xml +++ b/OsmAnd/res/values-de/phrases.xml @@ -2444,4 +2444,68 @@ Palsamoor IC gespeicherte Fährfahrkarten akzeptiert IC gespeicherte Fährfahrkarten nicht akzeptiert + Hausarzt + Augenheilkunde + Gynäkologie + Innere Medizin + Orthopädie + Hals-Nasen-Ohrenheilkunde + Kinderheilkunde + Kinderheilkunde: nein + Dermatologie + Urologie + (Allgemeine) Chirurgie + Radiologie + Psychiatrie und Psychotherapie + Neurologie + Haut- und Geschlechtskrankheiten + Innere Medizin und Schwerpunkt Kardiologie + Traumatologie + Klinische Biologie + Osteopathie (Alternativmedizin) + Anästhesiologie + Pneumologie + Zahn-, Mund-, Kiefer- und Gesichtschirurgie + Mutterschaft + Unfall- und Notfallmedizin + Unfall- und Notfallmedizin: Nein + Plastische Chirurgie + Kieferorthopädie + Krankengymnastik + Biologische Chemie + Ergotherapie + Kinderpsychiatrie + Physikalische Medizin und Rehabilitation + Kiefer- und Gesichtschirurgie + diagnostische Radiologie + Innere Medizin und Schwerpunkt Gastroenterologie + Zahnheilkunde + Nephrologie (Nierenerkrankungen) + Neurochirurgie + Nervenheilkunde (Neurologie und Psychiatrie) + Innere Medizin und Schwerpunkt Endokrinologie und Diabetologie + Nuklearmedizin + Pathologie + Onkologie + Tropenmedizin + Tropenmedizin: Nein + Geburtshilfe (postnatal) + Geburtshilfe (nachgeburtlich): Nein + Geburtshilfe (vorgeburtliche) + Geburtshilfe (vorgeburtliche): Nein + Sozialpädiatrie + Sozialpädiatrie: Nein + Geburtshilfe (Kaiserschnitt) + Geburtshilfe (Kaiserschnitt): Nein + Suchtmedizin + praktische Augenheilkunde + Klinische Pathologie + Logopädie (Sprachtherapie) + Physiotherapie + Sportmedizin + Podologie + Erwachsenenpsychiatrie + Akupunktur + Homöopathie + Traditionelle chinesische Medizin From 4d3d51f11ea953fbd08ce41d4ae12dcad8c4a6cf Mon Sep 17 00:00:00 2001 From: jf-simon Date: Mon, 30 Nov 2015 21:05:04 +0100 Subject: [PATCH 4/8] Translated using Weblate (German) Currently translated at 100.0% (2337 of 2337 strings) --- OsmAnd/res/values-de/phrases.xml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-de/phrases.xml b/OsmAnd/res/values-de/phrases.xml index dd728e788b..536a0eb2a2 100644 --- a/OsmAnd/res/values-de/phrases.xml +++ b/OsmAnd/res/values-de/phrases.xml @@ -2508,4 +2508,12 @@ Akupunktur Homöopathie Traditionelle chinesische Medizin - + Reiki + Kräuterkunde + Chiropraktik + Naturheilkunde + Tiefenpsychologie + Verhalten + + + From ce7e5934f51f82e372dd0f99ed96a9086770d587 Mon Sep 17 00:00:00 2001 From: jan madsen Date: Mon, 30 Nov 2015 21:33:50 +0100 Subject: [PATCH 5/8] Translated using Weblate (Danish) Currently translated at 100.0% (2337 of 2337 strings) --- OsmAnd/res/values-da/phrases.xml | 52 +++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-da/phrases.xml b/OsmAnd/res/values-da/phrases.xml index b76b54fb27..c2d4687fa4 100644 --- a/OsmAnd/res/values-da/phrases.xml +++ b/OsmAnd/res/values-da/phrases.xml @@ -2539,4 +2539,54 @@ Sundhedsspeciale: anæstetika Sundhedsspeciale: respiratory medicine Sundhedsspeciale: tand-, mund- og kæbe ansigtskirurgi - + Sundhedsspeciale: barsel + Sundhedsspeciale: ulykkes- og katastrofemedicin + Sundhedsspeciale: ulykkes- og katastrofemedicin: nej + Sundhedsspeciale: plastikkirurgi + Sundhedsspeciale: Ortodonti + Sundhedsspeciale: fysioterapi + Sundhedsspeciale: biokemi + Sundhedsspeciale: ergoterapi + Sundhedsspeciale: børnepsykiatri + Sundhedsspeciale: fysisk medicin og rehabilitering + Sundhedsspeciale:-ansigtskirurgi + Sundhedsspeciale: diagnostisk radiologi + Sundhedsspeciale: gastroenterologi + Sundhedsspeciale: tandpleje + Sundhedsspeciale: nefrologi (nyre sygdomme) + Sundhedsspeciale: neurokirurgi + Sundhedsspeciale: neuropsykiatri + Sundhedsspeciale: endokrinologi + Sundhedsspeciale: nuklear medicin + Sundhedsspeciale: patologisk anatomi + Sundhedsspeciale: onkologi + Sundhedsspeciale: tropemedicin + Sundhedsspeciale: tropemedicin: nej + Sundhedsspeciale: obstetrik (postnatal) + Sundhedsspeciale: obstetrik (postnatal): nej + Sundhedsspeciale: obstetrik (før fødslen) + Sundhedsspeciale: obstetrik (før fødslen): nej + Sundhedsspeciale: socialpædiatri + Sundhedspeciale: socialpædiatri: nej + Sundhedsspeciale: obstetrik (kejsersnit) + Sundhedsspeciale: obstetrik (kejsersnit): nej + Sundhedsspeciale: afhængighed af medicin + Sundhedsspeciale: optometry + Sundhedspeciale: klinisk patologi + Sundhedsspeciale: taleterapi + Sundhedsspeciale: manuel terapi + Sundhedsspeciale: sportsmedicin + Sundhedsspeciale: podology + Sundhedsspeciale: voksenpsykiatri + Sundhedsspeciale: akupunktur + Sundhedsspeciale: homøopati + Sundhedsspeciale: traditionel kinesiskmedicin + Sundhedsspeciale: reiki + Sundhedsspeciale: naturmedicin + Sundhedspeciale: kiropraktik + Sundhesspeciale: naturopati + Sundhedsspeciale: dybde psykologi + Sundhedsspeciale: adfærd + + + From 41b555c6e9e36acfb03146557ec041189cf2ceb9 Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Tue, 1 Dec 2015 00:24:58 +0300 Subject: [PATCH 6/8] Fix - move location to bottom line of POI's context menu --- .../net/osmand/plus/mapcontextmenu/MenuController.java | 10 ++++------ .../mapcontextmenu/builders/AmenityMenuBuilder.java | 5 +++++ .../controllers/AmenityMenuController.java | 1 - 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java index 0120f50fdb..adf1c0dd5b 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java @@ -133,14 +133,12 @@ public abstract class MenuController extends BaseMenuController { } public void addPlainMenuItems(String typeStr, PointDescription pointDescription, LatLon latLon) { - addMyLocationToPlainItems(pointDescription, latLon); + addMyLocationToPlainItems(latLon); } - protected void addMyLocationToPlainItems(PointDescription pointDescription, LatLon latLon) { - if (pointDescription != null) { - addPlainMenuItem(R.drawable.ic_action_get_my_location, PointDescription.getLocationName(getMapActivity(), - latLon.getLatitude(), latLon.getLongitude(), true).replaceAll("\n", ""), false); - } + protected void addMyLocationToPlainItems(LatLon latLon) { + addPlainMenuItem(R.drawable.ic_action_get_my_location, PointDescription.getLocationName(getMapActivity(), + latLon.getLatitude(), latLon.getLongitude(), true).replaceAll("\n", ""), false); } public PointDescription getPointDescription() { diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java index d2be72d925..277cba5339 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java @@ -12,6 +12,7 @@ import android.widget.LinearLayout; import android.widget.TextView; import net.osmand.data.Amenity; +import net.osmand.data.PointDescription; import net.osmand.osm.AbstractPoiType; import net.osmand.osm.MapPoiTypes; import net.osmand.osm.PoiType; @@ -281,6 +282,10 @@ public class AmenityMenuBuilder extends MenuBuilder { for (AmenityInfoRow info : descriptions) { buildAmenityRow(view, info); } + + buildRow(view, R.drawable.ic_action_get_my_location, PointDescription.getLocationName(app, + amenity.getLocation().getLatitude(), amenity.getLocation().getLongitude(), true) + .replaceAll("\n", ""), 0, false, 0); } public void buildAmenityRow(View view, AmenityInfoRow info) { diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AmenityMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AmenityMenuController.java index 204bb029cd..87d5fb4b58 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AmenityMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AmenityMenuController.java @@ -99,6 +99,5 @@ public class AmenityMenuController extends MenuController { } addPlainMenuItem(resId, typeStr, false); } - addMyLocationToPlainItems(pointDescription, amenity.getLocation()); } } From 482f107cf200c0cab7914876858994ebb70bcdc4 Mon Sep 17 00:00:00 2001 From: jan madsen Date: Mon, 30 Nov 2015 21:48:36 +0100 Subject: [PATCH 7/8] Translated using Weblate (Danish) Currently translated at 100.0% (2337 of 2337 strings) --- OsmAnd/res/values-da/phrases.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/OsmAnd/res/values-da/phrases.xml b/OsmAnd/res/values-da/phrases.xml index c2d4687fa4..7c1aafd532 100644 --- a/OsmAnd/res/values-da/phrases.xml +++ b/OsmAnd/res/values-da/phrases.xml @@ -2409,7 +2409,7 @@ Billedhugger Kors - Topkors: ja + Kors på toppen: ja Tidligere fangelejr Type: koncentrationslejr @@ -2429,7 +2429,7 @@ Bådopbevaring -Flytning: ja +Transportør: ja Bro ref @@ -2523,10 +2523,10 @@ Sundhedsspeciale: intern medicin Sundhedsspeciale: ortopædi oto-rhino-laryngolog: oto-rhino-laryngolog - Sundhedsspeciale: Pædiatri + Sundhedsspeciale: pædiatri Sundhedsspeciale: pædiatri: nej Sundhedsspeciale: dermatologi - Sundhedsspeciale: Urologi + Sundhedsspeciale: urologi Sundhedsspeciale: almen kirurgi Sundhedsspeciale: radiologi Sundhedsspeciale: psykiatri @@ -2543,7 +2543,7 @@ Sundhedsspeciale: ulykkes- og katastrofemedicin Sundhedsspeciale: ulykkes- og katastrofemedicin: nej Sundhedsspeciale: plastikkirurgi - Sundhedsspeciale: Ortodonti + Sundhedsspeciale: ortodonti Sundhedsspeciale: fysioterapi Sundhedsspeciale: biokemi Sundhedsspeciale: ergoterapi From a78f17541e521bfbb7b8360bad80386b8cd7305a Mon Sep 17 00:00:00 2001 From: jan madsen Date: Mon, 30 Nov 2015 22:37:54 +0100 Subject: [PATCH 8/8] Translated using Weblate (Danish) Currently translated at 100.0% (2337 of 2337 strings) --- OsmAnd/res/values-da/phrases.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-da/phrases.xml b/OsmAnd/res/values-da/phrases.xml index 7c1aafd532..7c6018ee09 100644 --- a/OsmAnd/res/values-da/phrases.xml +++ b/OsmAnd/res/values-da/phrases.xml @@ -2521,7 +2521,7 @@ Sundhedsspeciale: oftalmologi Sundhedsspeciale: gynækologi Sundhedsspeciale: intern medicin - Sundhedsspeciale: ortopædi + Sundhedsspeciale: ortopædkirurgi oto-rhino-laryngolog: oto-rhino-laryngolog Sundhedsspeciale: pædiatri Sundhedsspeciale: pædiatri: nej @@ -2537,7 +2537,7 @@ Sundhedsspeciale: klinisk biologi Sundhedsspeciale: osteopati Sundhedsspeciale: anæstetika - Sundhedsspeciale: respiratory medicine + Sundhedsspeciale: pneumologi Sundhedsspeciale: tand-, mund- og kæbe ansigtskirurgi Sundhedsspeciale: barsel Sundhedsspeciale: ulykkes- og katastrofemedicin