From 14663396e2759d4deaf295d583b49301125d0e7d Mon Sep 17 00:00:00 2001 From: alexzatsepin Date: Fri, 23 Sep 2016 13:43:21 +0300 Subject: [PATCH 1/2] [android] Fixed the NPE exception in RoutingPlanController while retreiving the cached routing info --- .../maps/routing/RoutingController.java | 2 ++ .../maps/routing/RoutingPlanController.java | 20 ++++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/android/src/com/mapswithme/maps/routing/RoutingController.java b/android/src/com/mapswithme/maps/routing/RoutingController.java index 27d1682885..4dc809cfd4 100644 --- a/android/src/com/mapswithme/maps/routing/RoutingController.java +++ b/android/src/com/mapswithme/maps/routing/RoutingController.java @@ -92,6 +92,7 @@ public class RoutingController private boolean mContainsCachedResult; private int mLastResultCode; private String[] mLastMissingMaps; + @Nullable private RoutingInfo mCachedRoutingInfo; @SuppressWarnings("FieldCanBeLocal") @@ -525,6 +526,7 @@ public class RoutingController return mEndPoint; } + @Nullable RoutingInfo getCachedRoutingInfo() { return mCachedRoutingInfo; diff --git a/android/src/com/mapswithme/maps/routing/RoutingPlanController.java b/android/src/com/mapswithme/maps/routing/RoutingPlanController.java index 4d136618e1..46b354457a 100644 --- a/android/src/com/mapswithme/maps/routing/RoutingPlanController.java +++ b/android/src/com/mapswithme/maps/routing/RoutingPlanController.java @@ -177,12 +177,25 @@ public class RoutingPlanController extends ToolbarController } private void showAltitudeChartAndRoutingDetails() + { + UiUtils.show(mAltitudeChartFrame); + mAltitudeChartShown = true; + showRoutingDetails(); + } + + private void showRoutingDetails() { final View numbersFrame = mAltitudeChartFrame.findViewById(R.id.numbers); + final RoutingInfo rinfo = RoutingController.get().getCachedRoutingInfo(); + if (rinfo == null) + { + UiUtils.hide(numbersFrame); + return; + } + TextView numbersTime = (TextView) numbersFrame.findViewById(R.id.time); TextView numbersDistance = (TextView) numbersFrame.findViewById(R.id.distance); TextView numbersArrival = (TextView) numbersFrame.findViewById(R.id.arrival); - RoutingInfo rinfo = RoutingController.get().getCachedRoutingInfo(); numbersTime.setText(RoutingController.formatRoutingTime(mFrame.getContext(), rinfo.totalTimeInSeconds, R.dimen.text_size_routing_number)); numbersDistance.setText(rinfo.distToTarget + " " + rinfo.targetUnits); @@ -192,11 +205,8 @@ public class RoutingPlanController extends ToolbarController String arrivalTime = RoutingController.formatArrivalTime(rinfo.totalTimeInSeconds); numbersArrival.setText(arrivalTime); } - - UiUtils.show(mAltitudeChartFrame); - mAltitudeChartShown = true; } - + private void hideAltitudeChartAndRoutingDetails() { if (UiUtils.isHidden(mAltitudeChartFrame)) From 53dfe90e36f3a804e3aad314d66ab6168498dc89 Mon Sep 17 00:00:00 2001 From: alexzatsepin Date: Wed, 28 Sep 2016 11:45:10 +0300 Subject: [PATCH 2/2] [android] Added a new build flavor for Nine store --- android/build.gradle | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/android/build.gradle b/android/build.gradle index 9957ceb38b..23d3f503c9 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -210,6 +210,13 @@ android { android.sourceSets.blackberry.assets.srcDirs = ['flavors/mwm-ttf-assets'] buildConfigField 'String', 'REVIEW_URL', '"https://appworld.blackberry.com/webstore/content/51013892"' } + + nineStore { + versionName = android.defaultConfig.versionName + '-NineStore' + android.sourceSets.blackberry.assets.srcDirs = ['flavors/mwm-ttf-assets'] + buildConfigField 'String', 'SUPPORT_MAIL', '"ninestore@mapswithme.com"' + buildConfigField 'String', 'REVIEW_URL', '"http://www.ninestore.ru/android-apps/mapswithme-maps-pro"' + } } // Currently (as of 1.2.3 gradle plugin) ABI filters aren't supported inside of product flavors, so we cannot generate splitted builds only for Google build.