diff options
author | Aleksandr Zatsepin <alexzatsepin@users.noreply.github.com> | 2016-11-22 18:45:33 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-22 18:45:33 +0300 |
commit | f45fa5035cfc62d5c858fd985c59f6d8bc2a104f (patch) | |
tree | 74db931a27e80e470a0bbd4aa894d6618d54287d | |
parent | 9b9e5aef798537dde8bf5f198fe199ccf43eaa8e (diff) | |
parent | 34114786f29b54435b8c04ba57c53ed0fe59f62b (diff) |
Merge pull request #4781 from bykoianko/release-65-to-master
Unique release-65 commit to master.
18 files changed, 499 insertions, 82 deletions
diff --git a/3party/Alohalytics b/3party/Alohalytics -Subproject 28f74496e58213dd0bc7d793fd17ba0e7f3d89b +Subproject a3e1659ba90ed079b3021ea2fa45a628a832b8e diff --git a/android/res/values/themes-base.xml b/android/res/values/themes-base.xml index e076f73959..9cdefefbc4 100644 --- a/android/res/values/themes-base.xml +++ b/android/res/values/themes-base.xml @@ -13,9 +13,9 @@ <item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item> <item name="android:fontFamily" tools:targetApi="jelly_bean">@string/robotoRegular</item> <item name="android:colorBackgroundCacheHint">@null</item> + <item name="android:windowActionBarOverlay">true</item> <item name="clickableBackground">?selectableItemBackground</item> <item name="android:statusBarColor" tools:targetApi="lollipop">@android:color/transparent</item> - <item name="alertDialogTheme">@style/MwmTheme.DialogFragment</item> <item name="windowBackgroundForced">@color/bg_window</item> <item name="cardFrame">@drawable/card_frame</item> @@ -97,6 +97,7 @@ <item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item> <item name="android:fontFamily" tools:targetApi="jelly_bean">@string/robotoRegular</item> <item name="android:colorBackgroundCacheHint">@null</item> + <item name="android:windowActionBarOverlay">true</item> <item name="clickableBackground">?selectableItemBackground</item> <item name="android:statusBarColor" tools:targetApi="lollipop">@android:color/transparent</item> diff --git a/android/res/values/themes.xml b/android/res/values/themes.xml index 6d13b468b8..9f540ce0e4 100644 --- a/android/res/values/themes.xml +++ b/android/res/values/themes.xml @@ -180,9 +180,6 @@ <item name="android:colorPrimaryDark" tools:targetApi="lollipop">@android:color/black</item> <item name="android:timePickerStyle" tools:targetApi="lollipop">@style/MwmWidget.Editor.TimePicker</item> <item name="android:windowBackground">@null</item> - <item name="windowActionBar">false</item> - <item name="windowActionBarOverlay">true</item> - <item name="android:windowActionBarOverlay">true</item> </style> </resources> diff --git a/android/src/com/mapswithme/maps/base/BaseMwmFragmentActivity.java b/android/src/com/mapswithme/maps/base/BaseMwmFragmentActivity.java index 71c5390dba..852ce0dfbc 100644 --- a/android/src/com/mapswithme/maps/base/BaseMwmFragmentActivity.java +++ b/android/src/com/mapswithme/maps/base/BaseMwmFragmentActivity.java @@ -53,7 +53,9 @@ public class BaseMwmFragmentActivity extends AppCompatActivity mBaseDelegate.onCreate(); super.onCreate(savedInstanceState); + UiUtils.setupStatusBar(this); + setVolumeControlStream(AudioManager.STREAM_MUSIC); final int layoutId = getContentLayoutResId(); if (layoutId != 0) diff --git a/android/src/com/mapswithme/maps/downloader/DownloaderAdapter.java b/android/src/com/mapswithme/maps/downloader/DownloaderAdapter.java index 85fc786302..5098356a6d 100644 --- a/android/src/com/mapswithme/maps/downloader/DownloaderAdapter.java +++ b/android/src/com/mapswithme/maps/downloader/DownloaderAdapter.java @@ -740,7 +740,7 @@ class DownloaderAdapter extends RecyclerView.Adapter<DownloaderAdapter.ViewHolde loadAds(); } - void setSearchResultsMode(Collection<CountryItem> results, String query) + void setSearchResultsMode(@NonNull Collection<CountryItem> results, String query) { mSearchResultsMode = true; mSearchQuery = query.toLowerCase(); @@ -750,6 +750,19 @@ class DownloaderAdapter extends RecyclerView.Adapter<DownloaderAdapter.ViewHolde processData(); } + void clearAds() + { + if (mAds.isEmpty()) + return; + + if (mMytargetHelper != null) + mMytargetHelper.cancel(); + + mAds.clear(); + mAdsLoaded = false; + notifyDataSetChanged(); + } + void resetSearchResultsMode() { mSearchResultsMode = false; @@ -969,6 +982,13 @@ class DownloaderAdapter extends RecyclerView.Adapter<DownloaderAdapter.ViewHolde } mAdsLoading = true; + + if (mMytargetHelper == null) + initMytargetHelper(); + } + + private void initMytargetHelper() + { mMytargetHelper = new MytargetHelper(new MytargetHelper.Listener<Void>() { private void onNoAdsInternal() @@ -1009,7 +1029,6 @@ class DownloaderAdapter extends RecyclerView.Adapter<DownloaderAdapter.ViewHolde mAdsLoading = false; mAdsLoaded = true; - int oldSize = mAds.size(); mAds.clear(); if (banners != null) @@ -1018,10 +1037,7 @@ class DownloaderAdapter extends RecyclerView.Adapter<DownloaderAdapter.ViewHolde mAds.add(banner); mHeadersDecoration.invalidateHeaders(); - if (oldSize == 0) - notifyItemRangeInserted(mNearMeCount, mAds.size()); - else - notifyDataSetChanged(); + notifyDataSetChanged(); } }, mActivity); } diff --git a/android/src/com/mapswithme/maps/downloader/DownloaderFragment.java b/android/src/com/mapswithme/maps/downloader/DownloaderFragment.java index c796843b2a..f087b50e61 100644 --- a/android/src/com/mapswithme/maps/downloader/DownloaderFragment.java +++ b/android/src/com/mapswithme/maps/downloader/DownloaderFragment.java @@ -76,6 +76,7 @@ public class DownloaderFragment extends BaseMwmRecyclerFragment mCurrentSearch = System.nanoTime(); SearchEngine.searchMaps(mToolbarController.getQuery(), mCurrentSearch); mToolbarController.showProgress(true); + mAdapter.clearAds(); } void clearSearchQuery() diff --git a/android/src/com/mapswithme/maps/location/PlatformSocket.java b/android/src/com/mapswithme/maps/location/PlatformSocket.java index b13c338299..62852e6050 100644 --- a/android/src/com/mapswithme/maps/location/PlatformSocket.java +++ b/android/src/com/mapswithme/maps/location/PlatformSocket.java @@ -2,6 +2,7 @@ package com.mapswithme.maps.location; import android.annotation.SuppressLint; import android.net.SSLCertificateSocketFactory; +import android.os.SystemClock; import android.support.annotation.NonNull; import android.support.annotation.Nullable; @@ -139,7 +140,7 @@ class PlatformSocket return false; sLogger.d("Reading has started, data.length = " + data.length, ", count = " + count); - long startTime = System.nanoTime(); + long startTime = SystemClock.elapsedRealtime(); int readBytes = 0; try { @@ -147,7 +148,7 @@ class PlatformSocket throw new AssertionError("mSocket cannot be null"); InputStream in = mSocket.getInputStream(); - while (readBytes != count && (System.nanoTime() - startTime) < mTimeout) + while (readBytes != count && (SystemClock.elapsedRealtime() - startTime) < mTimeout) { try { @@ -170,7 +171,7 @@ class PlatformSocket readBytes += read; } catch (SocketTimeoutException e) { - long readingTime = System.nanoTime() - startTime; + long readingTime = SystemClock.elapsedRealtime() - startTime; sLogger.e(e, "Socked timeout has occurred after ", readingTime, " (ms) "); if (readingTime > mTimeout) { @@ -194,7 +195,7 @@ class PlatformSocket return false; sLogger.d("Writing method has started, data.length = " + data.length, ", count = " + count); - long startTime = System.nanoTime(); + long startTime = SystemClock.elapsedRealtime(); try { if (mSocket == null) @@ -206,7 +207,7 @@ class PlatformSocket return true; } catch (SocketTimeoutException e) { - long writingTime = System.nanoTime() - startTime; + long writingTime = SystemClock.elapsedRealtime() - startTime; sLogger.e(e, "Socked timeout has occurred after ", writingTime, " (ms) "); } catch (IOException e) { diff --git a/android/src/com/mapswithme/maps/widget/placepage/BottomPlacePageAnimationController.java b/android/src/com/mapswithme/maps/widget/placepage/BottomPlacePageAnimationController.java index fa8ab4fecf..0197d3cf85 100644 --- a/android/src/com/mapswithme/maps/widget/placepage/BottomPlacePageAnimationController.java +++ b/android/src/com/mapswithme/maps/widget/placepage/BottomPlacePageAnimationController.java @@ -82,6 +82,7 @@ class BottomPlacePageAnimationController extends BasePlacePageAnimationControlle mIsDragging = false; mIsGestureFinished = false; mDownCoord = event.getY(); + mGestureDetector.onTouchEvent(event); break; case MotionEvent.ACTION_MOVE: if (!mIsGestureStartedInsideView) @@ -93,7 +94,8 @@ class BottomPlacePageAnimationController extends BasePlacePageAnimationControlle break; case MotionEvent.ACTION_UP: - if (mIsGestureStartedInsideView) + final boolean isInside = UiUtils.isViewTouched(event, mDetailsScroll); + if (isInside && mIsGestureStartedInsideView) mGestureDetector.onTouchEvent(event); break; } diff --git a/iphone/Maps/Categories/UIKitCategories.mm b/iphone/Maps/Categories/UIKitCategories.mm index cd122c63be..5b1cd6a186 100644 --- a/iphone/Maps/Categories/UIKitCategories.mm +++ b/iphone/Maps/Categories/UIKitCategories.mm @@ -290,7 +290,7 @@ - (void)safariViewControllerDidFinish:(SFSafariViewController *)controller { - [self.navigationController popViewControllerAnimated:YES]; + [self.navigationController dismissViewControllerAnimated:YES completion:nil]; } @end @@ -299,14 +299,8 @@ - (void)openUrl:(NSURL *)url { - UIApplication * app = [UIApplication sharedApplication]; - if ([app canOpenURL:url]) - [app openURL:url]; - // TODO(Vlad): Correct implementation of navigation controller's buttons. - /* NSString * scheme = url.scheme; - NSAssert(([scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"]), @"Incorrect - url's scheme!"); + NSAssert(([scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"]), @"Incorrect url's scheme!"); if (isIOS8) { UIApplication * app = [UIApplication sharedApplication]; @@ -316,8 +310,7 @@ } SFSafariViewController * svc = [[SFSafariViewController alloc] initWithURL:url]; svc.delegate = self; - [self.navigationController pushViewController:svc animated:YES]; - */ + [self.navigationController presentViewController:svc animated:YES completion:nil]; } @end diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMTaxiPreviewDataSource.mm b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMTaxiPreviewDataSource.mm index b3ec86fe33..0e9383eb90 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMTaxiPreviewDataSource.mm +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMTaxiPreviewDataSource.mm @@ -86,6 +86,14 @@ using namespace uber; return self; } +- (void)dealloc +{ + MWMTaxiCollectionView * cv = self.collectionView; + cv.dataSource = nil; + cv.delegate = nil; + self.collectionView = nil; +} + - (void)requestTaxiFrom:(MWMRoutePoint const &)from to:(MWMRoutePoint const &)to completion:(TMWMVoidBlock)completion diff --git a/iphone/Maps/Classes/Editor/MWMEditorViewController.mm b/iphone/Maps/Classes/Editor/MWMEditorViewController.mm index 9a060ce207..024a2accde 100644 --- a/iphone/Maps/Classes/Editor/MWMEditorViewController.mm +++ b/iphone/Maps/Classes/Editor/MWMEditorViewController.mm @@ -285,9 +285,8 @@ void registerCellsForTableView(vector<MWMPlacePageCellType> const & cells, UITab auto const latLon = m_mapObject.GetLatLon(); NSMutableDictionary * noteInfo = [info mutableCopy]; noteInfo[kStatProblem] = self.note; - noteInfo[kStatLat] = @(latLon.lat); - noteInfo[kStatLon] = @(latLon.lon); - [Statistics logEvent:kStatEditorProblemReport withParameters:noteInfo]; + CLLocation * location = [[CLLocation alloc] initWithLatitude:latLon.lat longitude:latLon.lon]; + [Statistics logEvent:kStatEditorProblemReport withParameters:noteInfo atLocation:location]; f.CreateNote(latLon, featureID, osm::Editor::NoteProblemType::General, self.note.UTF8String); } @@ -958,6 +957,7 @@ void registerCellsForTableView(vector<MWMPlacePageCellType> const & cells, UITab { auto const & fid = m_mapObject.GetID(); auto const latLon = m_mapObject.GetLatLon(); + CLLocation * location = [[CLLocation alloc] initWithLatitude:latLon.lat longitude:latLon.lon]; self.isFeatureUploaded = osm::Editor::Instance().IsFeatureUploaded(fid.m_mwmId, fid.m_index); [self.tableView reloadRowsAtIndexPaths:@[ [self.tableView indexPathForCell:cell] ] withRowAnimation:UITableViewRowAnimationFade]; @@ -969,10 +969,9 @@ void registerCellsForTableView(vector<MWMPlacePageCellType> const & cells, UITab withParameters:@{ kStatEditorMWMName : @(fid.GetMwmName().c_str()), kStatEditorMWMVersion : @(fid.GetMwmVersion()), - kStatProblem : @(osm::Editor::kPlaceDoesNotExistMessage), - kStatLat : @(latLon.lat), - kStatLon : @(latLon.lon) - }]; + kStatProblem : @(osm::Editor::kPlaceDoesNotExistMessage) + } + atLocation:location]; GetFramework().CreateNote(latLon, fid, osm::Editor::NoteProblemType::PlaceDoesNotExist, additional); [self backTap]; @@ -984,10 +983,9 @@ void registerCellsForTableView(vector<MWMPlacePageCellType> const & cells, UITab [Statistics logEvent:isCreated ? kStatEditorAddCancel : kStatEditorEditCancel withParameters:@{ kStatEditorMWMName : @(fid.GetMwmName().c_str()), - kStatEditorMWMVersion : @(fid.GetMwmVersion()), - kStatLat : @(latLon.lat), - kStatLon : @(latLon.lon) - }]; + kStatEditorMWMVersion : @(fid.GetMwmVersion()) + } + atLocation:location]; auto & f = GetFramework(); if (!f.RollBackChanges(fid)) NSAssert(false, @"We shouldn't call this if we can't roll back!"); diff --git a/iphone/Maps/Classes/MWMPlacePageManager.mm b/iphone/Maps/Classes/MWMPlacePageManager.mm index 9d047a7361..a9ca96b86b 100644 --- a/iphone/Maps/Classes/MWMPlacePageManager.mm +++ b/iphone/Maps/Classes/MWMPlacePageManager.mm @@ -254,15 +254,13 @@ { stat[kStatProvider] = kStatBooking; stat[kStatHotel] = data.sponsoredId; - stat[kStatHotelLat] = @(latLon.lat); - stat[kStatHotelLon] = @(latLon.lon); + stat[kStatHotelLocation] = makeLocationEventValue(latLon.lat, latLon.lon); } else { stat[kStatProvider] = kStatOpentable; stat[kStatRestaurant] = data.sponsoredId; - stat[kStatRestaurantLat] = @(latLon.lat); - stat[kStatRestaurantLon] = @(latLon.lon); + stat[kStatRestaurantLocation] = makeLocationEventValue(latLon.lat, latLon.lon); } NSString * eventName = isBooking ? kPlacePageHotelBook : kPlacePageRestaurantBook; diff --git a/iphone/Maps/Classes/MWMPlacePageViewManager.mm b/iphone/Maps/Classes/MWMPlacePageViewManager.mm new file mode 100644 index 0000000000..b03ba2afc0 --- /dev/null +++ b/iphone/Maps/Classes/MWMPlacePageViewManager.mm @@ -0,0 +1,395 @@ +#import "MWMPlacePageViewManager.h" +#import <Pushwoosh/PushNotificationManager.h> +#import "Common.h" +#import "MWMAPIBar.h" +#import "MWMActivityViewController.h" +#import "MWMBasePlacePageView.h" +#import "MWMDirectionView.h" +#import "MWMFrameworkListener.h" +#import "MWMLocationHelpers.h" +#import "MWMLocationManager.h" +#import "MWMPlacePage.h" +#import "MWMPlacePageActionBar.h" +#import "MWMPlacePageEntity.h" +#import "MWMPlacePageNavigationBar.h" +#import "MWMRouter.h" +#import "MWMiPadPlacePage.h" +#import "MWMiPhoneLandscapePlacePage.h" +#import "MWMiPhonePortraitPlacePage.h" +#import "MapViewController.h" +#import "MapsAppDelegate.h" +#import "Statistics.h" + +#import "3party/Alohalytics/src/alohalytics_objc.h" + +#include "MWMRoutePoint.h" + +#include "geometry/distance_on_sphere.hpp" +#include "map/place_page_info.hpp" +#include "platform/measurement_utils.hpp" + +extern NSString * const kAlohalyticsTapEventKey; +extern NSString * const kBookmarksChangedNotification; + +@interface MWMPlacePageViewManager ()<MWMLocationObserver> + +@property(nonatomic, readwrite) MWMPlacePageEntity * entity; +@property(nonatomic) MWMPlacePage * placePage; +@property(nonatomic) MWMDirectionView * directionView; + +@end + +@implementation MWMPlacePageViewManager + +- (void)hidePlacePage { [self.placePage hide]; } +- (void)dismissPlacePage +{ + [self.placePage dismiss]; + [MWMLocationManager removeObserver:self]; + GetFramework().DeactivateMapSelection(false); + self.placePage = nil; +} + +- (void)showPlacePage:(place_page::Info const &)info +{ + [MWMLocationManager addObserver:self]; + self.entity = [[MWMPlacePageEntity alloc] initWithInfo:info]; + if (IPAD) + [self setPlacePageForiPad]; + else + [self setPlacePageForiPhoneWithOrientation:self.ownerViewController.interfaceOrientation]; + [self configPlacePage]; +} + +- (FeatureID const &)featureId { return self.entity.featureID; } +#pragma mark - Layout + +- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)orientation +{ + [self rotateToOrientation:orientation]; +} + +- (void)viewWillTransitionToSize:(CGSize)size + withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator +{ + [self rotateToOrientation:size.height > size.width ? UIInterfaceOrientationPortrait + : UIInterfaceOrientationLandscapeLeft]; +} + +- (void)rotateToOrientation:(UIInterfaceOrientation)orientation +{ + if (!self.placePage) + return; + + if (IPAD) + { + self.placePage.parentViewHeight = self.ownerViewController.view.width; + [(MWMiPadPlacePage *)self.placePage updatePlacePageLayoutAnimated:NO]; + } + else + { + [self.placePage dismiss]; + [self setPlacePageForiPhoneWithOrientation:orientation]; + [self configPlacePage]; + } +} + +- (void)configPlacePage +{ + if (self.entity.isMyPosition) + self.entity.subtitle = + location_helpers::formattedSpeedAndAltitude([MWMLocationManager lastLocation]); + self.placePage.parentViewHeight = self.ownerViewController.view.height; + [self.placePage configure]; + self.placePage.topBound = self.topBound; + self.placePage.leftBound = self.leftBound; + [self refreshPlacePage]; +} + +- (void)refreshPlacePage +{ + [self.placePage show]; + [self updateDistance]; +} + +- (void)mwm_refreshUI +{ + [self.placePage.extendedPlacePageView mwm_refreshUI]; + [self.placePage.actionBar mwm_refreshUI]; +} + +- (BOOL)hasPlacePage { return self.placePage != nil; } +- (void)setPlacePageForiPad +{ + [self.placePage dismiss]; + self.placePage = [[MWMiPadPlacePage alloc] initWithManager:self]; +} + +- (void)updateMyPositionSpeedAndAltitude +{ + if (self.entity.isMyPosition) + [self.placePage updateMyPositionStatus:location_helpers::formattedSpeedAndAltitude( + [MWMLocationManager lastLocation])]; +} + +- (void)setPlacePageForiPhoneWithOrientation:(UIInterfaceOrientation)orientation +{ + switch (orientation) + { + case UIInterfaceOrientationLandscapeLeft: + case UIInterfaceOrientationLandscapeRight: + if (![self.placePage isKindOfClass:[MWMiPhoneLandscapePlacePage class]]) + self.placePage = [[MWMiPhoneLandscapePlacePage alloc] initWithManager:self]; + break; + + case UIInterfaceOrientationPortrait: + case UIInterfaceOrientationPortraitUpsideDown: + if (![self.placePage isKindOfClass:[MWMiPhonePortraitPlacePage class]]) + self.placePage = [[MWMiPhonePortraitPlacePage alloc] initWithManager:self]; + break; + + case UIInterfaceOrientationUnknown: break; + } +} + +- (void)addSubviews:(NSArray *)views withNavigationController:(UINavigationController *)controller +{ + if (controller) + [self.ownerViewController addChildViewController:controller]; + [[MWMMapViewControlsManager manager] addPlacePageViews:views]; +} + +- (void)routeFrom +{ + [Statistics logEvent:kStatEventName(kStatPlacePage, kStatBuildRoute) + withParameters:@{kStatValue : kStatSource}]; + [Alohalytics logEvent:kAlohalyticsTapEventKey withValue:@"ppRoute"]; + [[MWMRouter router] buildFromPoint:self.target bestRouter:YES]; + [self hidePlacePage]; +} + +- (void)routeTo +{ + [Statistics logEvent:kStatEventName(kStatPlacePage, kStatBuildRoute) + withParameters:@{kStatValue : kStatDestination}]; + [Alohalytics logEvent:kAlohalyticsTapEventKey withValue:@"ppRoute"]; + auto r = [MWMRouter router]; + [r buildToPoint:self.target bestRouter:YES]; + [self hidePlacePage]; +} + +- (MWMRoutePoint)target +{ + NSString * name = nil; + if (self.entity.title.length > 0) + name = self.entity.title; + else if (self.entity.address.length > 0) + name = self.entity.address; + else if (self.entity.subtitle.length > 0) + name = self.entity.subtitle; + else if (self.entity.isBookmark) + name = self.entity.bookmarkTitle; + else + name = L(@"placepage_unknown_place"); + + m2::PointD const & org = self.entity.mercator; + return self.entity.isMyPosition ? MWMRoutePoint(org) : MWMRoutePoint(org, name); +} + +- (void)share +{ + [Statistics logEvent:kStatEventName(kStatPlacePage, kStatShare)]; + [Alohalytics logEvent:kAlohalyticsTapEventKey withValue:@"ppShare"]; + MWMPlacePageEntity * entity = self.entity; + MWMActivityViewController * shareVC = [MWMActivityViewController + shareControllerForPlacePageObject:static_cast<id<MWMPlacePageObject>>(entity)]; + [shareVC presentInParentViewController:self.ownerViewController + anchorView:self.placePage.actionBar.shareAnchor]; +} + +- (void)book:(BOOL)isDescription +{ + MWMPlacePageEntity * data = self.entity; + BOOL const isBooking = data.isBooking; + auto const & latLon = data.latLon; + NSMutableDictionary * stat = [@{} mutableCopy]; + if (isBooking) + { + stat[kStatProvider] = kStatBooking; + stat[kStatHotel] = data.sponsoredId; + stat[kStatHotelLocation] = makeLocationEventValue(latLon.lat, latLon.lon); + } + else + { + stat[kStatProvider] = kStatOpentable; + stat[kStatRestaurant] = data.sponsoredId; + stat[kStatRestaurantLocation] = makeLocationEventValue(latLon.lat, latLon.lon); + } + + NSString * eventName = isBooking ? kPlacePageHotelBook : kPlacePageRestaurantBook; + [Statistics logEvent:isDescription ? kPlacePageHotelDetails : eventName + withParameters:stat + atLocation:[MWMLocationManager lastLocation]]; + + UIViewController * vc = static_cast<UIViewController *>([MapViewController controller]); + NSURL * url = isDescription ? self.entity.sponsoredDescriptionURL : self.entity.sponsoredURL; + NSAssert(url, @"Sponsored url can't be nil!"); + [vc openUrl:url]; +} + +- (void)call +{ + NSString * tel = [self.entity getCellValue:MWMPlacePageCellTypePhoneNumber]; + NSAssert(tel, @"Phone number can't be nil!"); + NSString * phoneNumber = [[@"telprompt:" stringByAppendingString:tel] + stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneNumber]]; +} + +- (void)apiBack +{ + [Statistics logEvent:kStatEventName(kStatPlacePage, kStatAPI)]; + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:self.entity.apiURL]]; + [((MapViewController *)self.ownerViewController).apiBar back]; +} + +- (void)editPlace +{ + [Statistics logEvent:kStatEventName(kStatPlacePage, kStatEdit)]; + [[PushNotificationManager pushManager] setTags:@{ @"editor_edit_discovered" : @YES }]; + [(MapViewController *)self.ownerViewController openEditor]; +} + +- (void)addBusiness +{ + [Statistics logEvent:kStatEditorAddClick withParameters:@{kStatValue : kStatPlacePage}]; + [[MWMMapViewControlsManager manager] addPlace:YES hasPoint:NO point:m2::PointD()]; +} + +- (void)addPlace +{ + [Statistics logEvent:kStatEditorAddClick + withParameters:@{kStatValue : kStatPlacePageNonBuilding}]; + [[MWMMapViewControlsManager manager] addPlace:NO hasPoint:YES point:self.entity.mercator]; +} + +- (void)addBookmark +{ + [Statistics logEvent:kStatEventName(kStatPlacePage, kStatBookmarks) + withParameters:@{kStatValue : kStatAdd}]; + Framework & f = GetFramework(); + BookmarkData bmData = {self.entity.titleForNewBookmark, f.LastEditedBMType()}; + auto const categoryIndex = f.LastEditedBMCategory(); + auto const bookmarkIndex = f.GetBookmarkManager().AddBookmark(categoryIndex, self.entity.mercator, bmData); + self.entity.bac = {bookmarkIndex, categoryIndex}; + self.entity.bookmarkTitle = @(bmData.GetName().c_str()); + self.entity.bookmarkCategory = @(f.GetBmCategory(categoryIndex)->GetName().c_str()); + [NSNotificationCenter.defaultCenter postNotificationName:kBookmarksChangedNotification + object:nil + userInfo:nil]; + [self updateDistance]; + [self.placePage addBookmark]; +} + +- (void)removeBookmark +{ + [Statistics logEvent:kStatEventName(kStatPlacePage, kStatBookmarks) + withParameters:@{kStatValue : kStatRemove}]; + Framework & f = GetFramework(); + BookmarkCategory * bookmarkCategory = + f.GetBookmarkManager().GetBmCategory(self.entity.bac.m_categoryIndex); + if (bookmarkCategory) + { + { + BookmarkCategory::Guard guard(*bookmarkCategory); + guard.m_controller.DeleteUserMark(self.entity.bac.m_bookmarkIndex); + } + bookmarkCategory->SaveToKMLFile(); + } + self.entity.bac = {}; + self.entity.bookmarkTitle = nil; + self.entity.bookmarkCategory = nil; + [NSNotificationCenter.defaultCenter postNotificationName:kBookmarksChangedNotification + object:nil + userInfo:nil]; + [self updateDistance]; + [self.placePage removeBookmark]; +} + +- (void)reloadBookmark +{ + [self.entity synchronize]; + [self.placePage reloadBookmark]; + [self updateDistance]; +} + +- (void)dragPlacePage:(CGRect)frame { [[MWMMapViewControlsManager manager] dragPlacePage:frame]; } +- (void)updateDistance +{ + NSString * distance = [self distance]; + self.directionView.distanceLabel.text = distance; + [self.placePage setDistance:distance]; +} + +- (NSString *)distance +{ + CLLocation * lastLocation = [MWMLocationManager lastLocation]; + if (!lastLocation) + return @""; + string distance; + CLLocationCoordinate2D const coord = lastLocation.coordinate; + ms::LatLon const & target = self.entity.latLon; + measurement_utils::FormatDistance( + ms::DistanceOnEarth(coord.latitude, coord.longitude, target.lat, target.lon), distance); + return @(distance.c_str()); +} + +- (void)showDirectionViewWithTitle:(NSString *)title type:(NSString *)type +{ + MWMDirectionView * directionView = self.directionView; + directionView.titleLabel.text = title; + directionView.typeLabel.text = type; + [directionView show]; + [self updateDistance]; +} + +- (void)changeHeight:(CGFloat)height +{ + if (!IPAD) + return; + ((MWMiPadPlacePage *)self.placePage).height = height; +} + +#pragma mark - MWMLocationObserver + +- (void)onHeadingUpdate:(location::CompassInfo const &)info +{ + CLLocation * lastLocation = [MWMLocationManager lastLocation]; + if (!lastLocation) + return; + CGFloat const angle = ang::AngleTo(lastLocation.mercator, self.entity.mercator) + info.m_bearing; + CGAffineTransform transform = CGAffineTransformMakeRotation(M_PI_2 - angle); + [self.placePage setDirectionArrowTransform:transform]; + [self.directionView setDirectionArrowTransform:transform]; +} + +- (void)onLocationUpdate:(location::GpsInfo const &)locationInfo +{ + [self updateDistance]; + [self updateMyPositionSpeedAndAltitude]; +} + +#pragma mark - Properties + +- (MWMDirectionView *)directionView +{ + if (!_directionView) + _directionView = [[MWMDirectionView alloc] initWithManager:self]; + return _directionView; +} + +- (MapViewController *)ownerViewController { return [MapViewController controller]; } +- (void)setTopBound:(CGFloat)topBound { _topBound = self.placePage.topBound = topBound; } +- (void)setLeftBound:(CGFloat)leftBound { _leftBound = self.placePage.leftBound = leftBound; } +- (void)editBookmark {} +@end diff --git a/iphone/Maps/Classes/Routing/MWMRouter.mm b/iphone/Maps/Classes/Routing/MWMRouter.mm index 369ae56a03..036c8b218f 100644 --- a/iphone/Maps/Classes/Routing/MWMRouter.mm +++ b/iphone/Maps/Classes/Routing/MWMRouter.mm @@ -76,8 +76,11 @@ bool isMarkerPoint(MWMRoutePoint const & point) { return point.IsValid() && !poi auto const & fLatLon = MercatorBounds::ToLatLon(router.finishPoint.Point()); [Statistics logEvent:eventName - withParameters:@{kStatProvider : kStatUber, kStatFromLat : @(sLatLon.lat), kStatFromLon : @(sLatLon.lon), - kStatToLat : @(fLatLon.lat), kStatToLon : @(fLatLon.lon)} + withParameters:@{ + kStatProvider : kStatUber, + kStatFromLocation : makeLocationEventValue(sLatLon.lat, sLatLon.lon), + kStatToLocation : makeLocationEventValue(fLatLon.lat, fLatLon.lon) + } atLocation:[MWMLocationManager lastLocation]]; [[UIApplication sharedApplication] openURL:taxiDataSource.taxiURL]; diff --git a/iphone/Maps/Maps.xcodeproj/project.pbxproj b/iphone/Maps/Maps.xcodeproj/project.pbxproj index c82f47eed8..7997c67f75 100644 --- a/iphone/Maps/Maps.xcodeproj/project.pbxproj +++ b/iphone/Maps/Maps.xcodeproj/project.pbxproj @@ -592,7 +592,6 @@ 6741AA3C1BF340DE002C974C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; settings = {ATTRIBUTES = (Required, ); }; }; 6741AA3D1BF340DE002C974C /* FBSDKCoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F6BC1E4B1ACBE96100EF0360 /* FBSDKCoreKit.framework */; settings = {ATTRIBUTES = (Required, ); }; }; 6741AA3E1BF340DE002C974C /* FBSDKShareKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F6BC1E4C1ACBE96100EF0360 /* FBSDKShareKit.framework */; settings = {ATTRIBUTES = (Required, ); }; }; - 6741AA3F1BF340DE002C974C /* PassKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 97C9864F186C5EDE00AF7E9E /* PassKit.framework */; settings = {ATTRIBUTES = (Required, ); }; }; 6741AA401BF340DE002C974C /* libFlurry_7.1.0.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F6671C6A1BA2EFD500548008 /* libFlurry_7.1.0.a */; }; 6741AA411BF340DE002C974C /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B00511051A1101FC00A61AA4 /* CoreMedia.framework */; }; 6741AA421BF340DE002C974C /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B00511031A1101F600A61AA4 /* CoreData.framework */; }; @@ -687,7 +686,6 @@ B00511021A1101E000A61AA4 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 97C98655186C734000AF7E9E /* AVFoundation.framework */; }; B00511041A1101F600A61AA4 /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B00511031A1101F600A61AA4 /* CoreData.framework */; }; B00511061A1101FC00A61AA4 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B00511051A1101FC00A61AA4 /* CoreMedia.framework */; }; - B08AA8D51A25E58500810B1C /* PassKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 97C9864F186C5EDE00AF7E9E /* PassKit.framework */; settings = {ATTRIBUTES = (Required, ); }; }; B08AA8D61A25E58C00810B1C /* Social.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 97C9864D186C5ED300AF7E9E /* Social.framework */; settings = {ATTRIBUTES = (Required, ); }; }; B08AA8DA1A26299A00810B1C /* TimeUtils.mm in Sources */ = {isa = PBXBuildFile; fileRef = B08AA8D91A26299A00810B1C /* TimeUtils.mm */; }; B0DFE6311A1B78A200B6C35E /* LocalNotifications.plist in Resources */ = {isa = PBXBuildFile; fileRef = B0DFE62F1A1B78A200B6C35E /* LocalNotifications.plist */; }; @@ -1452,7 +1450,6 @@ 97C98521186AE3CF00AF7E9E /* AppInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppInfo.h; sourceTree = "<group>"; }; 97C9864B186C5EAA00AF7E9E /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = System/Library/Frameworks/MediaPlayer.framework; sourceTree = SDKROOT; }; 97C9864D186C5ED300AF7E9E /* Social.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Social.framework; path = System/Library/Frameworks/Social.framework; sourceTree = SDKROOT; }; - 97C9864F186C5EDE00AF7E9E /* PassKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PassKit.framework; path = System/Library/Frameworks/PassKit.framework; sourceTree = SDKROOT; }; 97C98651186C5EF000AF7E9E /* iAd.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = iAd.framework; path = System/Library/Frameworks/iAd.framework; sourceTree = SDKROOT; }; 97C98653186C5F0500AF7E9E /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; 97C98655186C734000AF7E9E /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; @@ -1761,7 +1758,6 @@ 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, F6BC1E4D1ACBE96100EF0360 /* FBSDKCoreKit.framework in Frameworks */, F6BC1E4E1ACBE96100EF0360 /* FBSDKShareKit.framework in Frameworks */, - B08AA8D51A25E58500810B1C /* PassKit.framework in Frameworks */, F6671C6B1BA2EFD500548008 /* libFlurry_7.1.0.a in Frameworks */, 343E8B341D07F84C0046AEEE /* Pushwoosh.framework in Frameworks */, B00511061A1101FC00A61AA4 /* CoreMedia.framework in Frameworks */, @@ -1835,7 +1831,6 @@ 6741AA3D1BF340DE002C974C /* FBSDKCoreKit.framework in Frameworks */, 3456E0241DC0C4290055DF50 /* HockeySDK.framework in Frameworks */, 6741AA3E1BF340DE002C974C /* FBSDKShareKit.framework in Frameworks */, - 6741AA3F1BF340DE002C974C /* PassKit.framework in Frameworks */, 6741AA401BF340DE002C974C /* libFlurry_7.1.0.a in Frameworks */, 6741AA411BF340DE002C974C /* CoreMedia.framework in Frameworks */, 674A7E2A1C0DA579003D48E1 /* libdrape.a in Frameworks */, @@ -2218,7 +2213,6 @@ 97C98655186C734000AF7E9E /* AVFoundation.framework */, 97C98653186C5F0500AF7E9E /* AudioToolbox.framework */, 97C98651186C5EF000AF7E9E /* iAd.framework */, - 97C9864F186C5EDE00AF7E9E /* PassKit.framework */, 97C9864D186C5ED300AF7E9E /* Social.framework */, 97C9864B186C5EAA00AF7E9E /* MediaPlayer.framework */, 97719D471843B6F200BDD815 /* Security.framework */, @@ -3428,11 +3422,14 @@ enabled = 1; }; com.apple.InAppPurchase = { - enabled = 1; + enabled = 0; }; com.apple.Push = { enabled = 1; }; + com.apple.Wallet = { + enabled = 0; + }; }; }; 6741A93D1BF340DE002C974C = { @@ -4512,7 +4509,6 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; BUNDLE_IDENTIFIER = mapsme.debug; - CURRENT_PROJECT_VERSION = 6.5.0; DEVELOPMENT_TEAM = 3T6FSDE8C7; ENABLE_BITCODE = NO; GCC_ENABLE_PASCAL_STRINGS = NO; @@ -4550,7 +4546,7 @@ FAAB411A149BA83500C245B1 /* Simulator */ = { isa = XCBuildConfiguration; buildSettings = { - BUILD_DIR = "$(inherited)/../qmake"; + BUILD_DIR = "$(BUILD_ROOT)"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Frameworks/HockeySDK.embeddedframework", @@ -4599,7 +4595,6 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; BUNDLE_IDENTIFIER = mapsme.debug; - CURRENT_PROJECT_VERSION = 6.5.0; DEVELOPMENT_TEAM = 3T6FSDE8C7; ENABLE_BITCODE = NO; GCC_ENABLE_PASCAL_STRINGS = NO; @@ -4634,7 +4629,7 @@ FAAB411C149BA84700C245B1 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - BUILD_DIR = "$(inherited)/../qmake"; + BUILD_DIR = "$(BUILD_ROOT)"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Frameworks/HockeySDK.embeddedframework", @@ -4683,7 +4678,6 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; BUNDLE_IDENTIFIER = "com.my.maps-beta-enterprise"; - CURRENT_PROJECT_VERSION = 6.5.0; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = L2QFT5NA2Q; ENABLE_BITCODE = NO; @@ -4699,6 +4693,7 @@ ); INFOPLIST_FILE = MAPSME.plist; LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/Frameworks"; + ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = ( "$(inherited)", "-Wall", @@ -4720,7 +4715,7 @@ FAAB411E149BA85500C245B1 /* AdHoc */ = { isa = XCBuildConfiguration; buildSettings = { - BUILD_DIR = "$(inherited)/../qmake"; + BUILD_DIR = "$(BUILD_ROOT)"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Frameworks/HockeySDK.embeddedframework", @@ -4769,9 +4764,8 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; BUNDLE_IDENTIFIER = com.mapswithme.full; - CURRENT_PROJECT_VERSION = 6.5.0; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEVELOPMENT_TEAM = 3T6FSDE8C7; + DEVELOPMENT_TEAM = N9X2A789QT; ENABLE_BITCODE = NO; GCC_ENABLE_PASCAL_STRINGS = NO; GCC_INLINES_ARE_PRIVATE_EXTERN = YES; @@ -4785,6 +4779,7 @@ ); INFOPLIST_FILE = MAPSME.plist; LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/Frameworks"; + ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = ( "$(inherited)", "-Wall", @@ -4806,7 +4801,7 @@ FAAB4120149BA86000C245B1 /* Production Full */ = { isa = XCBuildConfiguration; buildSettings = { - BUILD_DIR = "$(inherited)/../qmake"; + BUILD_DIR = "$(BUILD_ROOT)"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Frameworks/HockeySDK.embeddedframework", @@ -4855,7 +4850,6 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; BUNDLE_IDENTIFIER = mapsme.release; - CURRENT_PROJECT_VERSION = 6.5.0; DEVELOPMENT_TEAM = 3T6FSDE8C7; ENABLE_BITCODE = NO; GCC_ENABLE_PASCAL_STRINGS = NO; @@ -4893,7 +4887,7 @@ FABB561F149CD957006969C0 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - BUILD_DIR = "$(inherited)/../qmake"; + BUILD_DIR = "$(BUILD_ROOT)"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Frameworks/HockeySDK.embeddedframework", @@ -4942,7 +4936,6 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; BUNDLE_IDENTIFIER = mapsme.release; - CURRENT_PROJECT_VERSION = 6.5.0; DEVELOPMENT_TEAM = 3T6FSDE8C7; ENABLE_BITCODE = NO; GCC_ENABLE_PASCAL_STRINGS = NO; @@ -4981,7 +4974,7 @@ FACFE54515F8F35600CE8B20 /* Simulator Release */ = { isa = XCBuildConfiguration; buildSettings = { - BUILD_DIR = "$(inherited)/../qmake"; + BUILD_DIR = "$(BUILD_ROOT)"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Frameworks/HockeySDK.embeddedframework", diff --git a/iphone/Maps/Statistics/Statistics.mm b/iphone/Maps/Statistics/Statistics.mm index 3fce94016e..3e9b8be74f 100644 --- a/iphone/Maps/Statistics/Statistics.mm +++ b/iphone/Maps/Statistics/Statistics.mm @@ -16,6 +16,15 @@ // If you have a "missing header error" here, then please run configure.sh script in the root repo folder. #import "../../../private.h" +namespace +{ +void checkFlurryLogStatus(FlurryEventRecordStatus status) +{ + NSCAssert(status == FlurryEventRecorded || status == FlurryEventLoggingDelayed, + @"Flurry log event failed."); +} +} // namespace + @interface Statistics () @property(nonatomic) NSDate * lastLocationLogTimestamp; @@ -62,8 +71,8 @@ if (![MWMSettings statisticsEnabled]) return; NSMutableDictionary * params = [self addDefaultAttributesToParameters:parameters]; - [Flurry logEvent:eventName withParameters:params]; [Alohalytics logEvent:eventName withDictionary:params]; + checkFlurryLogStatus([Flurry logEvent:eventName withParameters:params]); } - (void)logEvent:(NSString *)eventName withParameters:(NSDictionary *)parameters atLocation:(CLLocation *)location @@ -73,15 +82,13 @@ NSMutableDictionary * params = [self addDefaultAttributesToParameters:parameters]; [Alohalytics logEvent:eventName withDictionary:params atLocation:location]; auto const & coordinate = location ? location.coordinate : kCLLocationCoordinate2DInvalid; - params[kStatLat] = @(coordinate.latitude); - params[kStatLon] = @(coordinate.longitude); - [Flurry logEvent:eventName withParameters:params]; + params[kStatLocation] = makeLocationEventValue(coordinate.latitude, coordinate.longitude); + checkFlurryLogStatus([Flurry logEvent:eventName withParameters:params]); } - (NSMutableDictionary *)addDefaultAttributesToParameters:(NSDictionary *)parameters { NSMutableDictionary * params = [parameters mutableCopy]; - params[kStatDeviceType] = IPAD ? kStatiPad : kStatiPhone; BOOL isLandscape = UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation); params[kStatOrientation] = isLandscape ? kStatLandscape : kStatPortrait; AppInfo * info = [AppInfo sharedInfo]; diff --git a/iphone/Maps/Statistics/StatisticsStrings.h b/iphone/Maps/Statistics/StatisticsStrings.h index 84bdc56c24..22a35a4153 100644 --- a/iphone/Maps/Statistics/StatisticsStrings.h +++ b/iphone/Maps/Statistics/StatisticsStrings.h @@ -97,8 +97,7 @@ static NSString * const kStatExport = @"Export"; static NSString * const kStatFacebook = @"Facebook"; static NSString * const kStatFeedback = @"Feedback"; static NSString * const kStatFrom = @"from"; -static NSString * const kStatFromLat = @"from_lat"; -static NSString * const kStatFromLon = @"from_lon"; +static NSString * const kStatFromLocation = @"from_location"; static NSString * const kStatFromMyPosition = @"From my position"; static NSString * const kStatGo = @"Go"; static NSString * const kStatGoogle = @"Google"; @@ -106,8 +105,7 @@ static NSString * const kStatHelp = @"Help"; static NSString * const kStatHidden = @"Hidden"; static NSString * const kStatHistory = @"History"; static NSString * const kStatHotel = @"hotel"; -static NSString * const kStatHotelLat = @"hotel_lat"; -static NSString * const kStatHotelLon = @"hotel_lon"; +static NSString * const kStatHotelLocation = @"hotel_location"; static NSString * const kStatImport = @"Import"; static NSString * const kStatIn = @"In"; static NSString * const kStatIsAuto = @"is_auto"; @@ -117,9 +115,7 @@ static NSString * const kStatKML = @"KML"; static NSString * const kStatKilometers = @"Kilometers"; static NSString * const kStatLandscape = @"Landscape"; static NSString * const kStatLanguage = @"Language"; -static NSString * const kStatLat = @"Lat"; static NSString * const kStatLocation = @"Location"; -static NSString * const kStatLon = @"Lon"; static NSString * const kStatLogout = @"Logout"; static NSString * const kStatMap = @"map"; static NSString * const kStatMapSearch = @"Map search"; @@ -170,8 +166,7 @@ static NSString * const kStatRemove = @"Remove"; static NSString * const kStatRename = @"Rename"; static NSString * const kStatReport = @"Report"; static NSString * const kStatRestaurant = @"restaurant"; -static NSString * const kStatRestaurantLat = @"restaurant_lat"; -static NSString * const kStatRestaurantLon = @"restaurant_lon"; +static NSString * const kStatRestaurantLocation = @"restaurant_location"; static NSString * const kStatRetry = @"retry"; static NSString * const kStatRouting = @"routing"; static NSString * const kStatRoutingTaxiInstall = @"Routing_Taxi_install"; @@ -198,8 +193,7 @@ static NSString * const kStatSwapRoutingPoints = @"Swap routing points"; static NSString * const kStatTTS = @"TTS"; static NSString * const kStatTTSSettings = @"TTS settings"; static NSString * const kStatTable = @"Table"; -static NSString * const kStatToLat = @"to_lat"; -static NSString * const kStatToLon = @"to_lon"; +static NSString * const kStatToLocation = @"to_location"; static NSString * const kStatToMyPosition = @"To my position"; static NSString * const kStatToggleBookmark = @"Toggle bookmark"; static NSString * const kStatToggleCompassCalibration = @"Toggle compass calibration"; @@ -227,3 +221,9 @@ static inline NSString * const kStatEventName(NSString * component, NSString * a { return [NSString stringWithFormat:@"%@ %@", component, action]; } + +static inline NSString * const makeLocationEventValue(CLLocationDegrees latitude, + CLLocationDegrees longitude) +{ + return [NSString stringWithFormat:@"%@,%@", @(latitude), @(longitude)]; +} diff --git a/xcode/common.xcconfig b/xcode/common.xcconfig index 412ab8706d..3b3fb4e997 100644 --- a/xcode/common.xcconfig +++ b/xcode/common.xcconfig @@ -1,8 +1,10 @@ +CURRENT_PROJECT_VERSION = 6.5.3 + // Paths -OMIM_ROOT=$(PROJECT_DIR)/../.. -BUILD_DIR=$(OMIM_ROOT)/../omim-build/xcode -QT_PATH=/usr/local/opt/qt5 -BOOST_ROOT=$(OMIM_ROOT)/3party/boost +OMIM_ROOT = $(PROJECT_DIR)/../.. +BUILD_DIR = $(OMIM_ROOT)/../omim-build/xcode +QT_PATH = /usr/local/opt/qt5 +BOOST_ROOT = $(OMIM_ROOT)/3party/boost HEADER_SEARCH_PATHS = $(inherited) $(OMIM_ROOT) $(BOOST_ROOT) LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks |