[ios] Added navigation controller for bookmarks

This commit is contained in:
Alex Zolotarev 2012-05-08 15:38:58 +03:00 committed by Alex Zolotarev
parent 056e679f90
commit fa0983cdd3
6 changed files with 130 additions and 122 deletions

View file

@ -4,6 +4,7 @@
#import "EAGLView.h"
#import "BalloonView.h"
#import "BookmarksVC.h"
#import "PlacePageVC.h"
#import "../Settings/SettingsManager.h"
#import "../../Common/CustomAlertView.h"
@ -142,15 +143,19 @@ Framework * m_framework = NULL;
- (void)onBookmarkClicked
{
m2::PointD const ptG = m2::PointD(m_bookmark.glbPos.x, m_bookmark.glbPos.y);
PlacePageVC * placePageVC = [[PlacePageVC alloc] initWithStyle:UITableViewStyleGrouped];
[self.navigationController pushViewController:placePageVC animated:YES];
[placePageVC release];
Framework::AddressInfo info;
m_framework->GetAddressInfo(ptG, info);
m_framework->AddBookmark(ptG, info.m_name);
[m_bookmark hide];
m_framework->Invalidate();
// m2::PointD const ptG = m2::PointD(m_bookmark.globalPosition.x, m_bookmark.globalPosition.y);
//
// Framework::AddressInfo info;
// m_framework->GetAddressInfo(ptG, info);
// m_framework->AddBookmark(ptG, info.m_name);
//
// [m_bookmark hide];
//
// m_framework->Invalidate();
}
- (CGPoint) viewPoint2GlobalPoint:(CGPoint)pt
@ -193,6 +198,8 @@ Framework * m_framework = NULL;
{
if ((self = [super initWithCoder:coder]))
{
self.title = NSLocalizedString(@"Map", @"Back button in nav bar to show the map");
// Helper to display/hide pin on screen tap
m_bookmark = [[BalloonView alloc] initWithTarget:self andSelector:@selector(onBookmarkClicked)];
@ -431,14 +438,12 @@ NSInteger compareAddress(id l, id r, void * context)
- (void)viewWillAppear:(BOOL)animated
{
[self Invalidate];
[self.navigationController setNavigationBarHidden:YES animated:YES];
[super viewWillAppear:animated];
}
- (void)viewWillDisappear:(BOOL)animated
{
m_framework->SetUpdatesEnabled(false);
[self.navigationController setNavigationBarHidden:NO animated:YES];
[super viewWillDisappear:animated];
}

View file

@ -9,9 +9,10 @@
SettingsManager * m_settingsManager;
NSInteger m_standbyCounter;
NSInteger m_activeDownloadsCounter;
UINavigationController * m_navController;
UIWindow * m_window;
}
@property (nonatomic, retain) IBOutlet UIWindow * m_window;
@property (nonatomic, retain) IBOutlet MapViewController * m_mapViewController;
@property (nonatomic, readonly) LocationManager * m_locationManager;

View file

@ -10,7 +10,6 @@
@implementation MapsAppDelegate
@synthesize m_window;
@synthesize m_mapViewController;
@synthesize m_locationManager;
@ -90,7 +89,8 @@
[m_locationManager release];
[m_settingsManager release];
m_mapViewController = nil;
m_window = nil;
[m_navController release];
[m_window release];
[super dealloc];
}

View file

@ -11,7 +11,6 @@
<string key="NS.object.0">1181</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>IBUIWindow</string>
<string>IBUICustomObject</string>
<string>IBUIViewController</string>
<string>IBUIButton</string>
@ -125,7 +124,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{160, 435}, {40, 40}}</string>
<reference key="NSSuperview" ref="53915144"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:222</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
@ -183,11 +181,8 @@
<reference key="NSSuperview"/>
<reference key="NSNextKeyView" ref="803813744"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
<object class="NSColorSpace" key="NSCustomColorSpace">
<int key="NSID">2</int>
</object>
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC45MzMzMzMzMzMzIDAuOTMzMzMzMzMzMyAwLjg2NjY2NjY2NjcAA</bytes>
</object>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<bool key="IBUIMultipleTouchEnabled">YES</bool>
@ -202,20 +197,6 @@
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
<object class="IBUIWindow" id="380026005">
<nil key="NSNextResponder"/>
<int key="NSvFlags">1280</int>
<object class="NSPSMatrix" key="NSFrameMatrix"/>
<string key="NSFrameSize">{320, 480}</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MSAxIDEAA</bytes>
</object>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIVisibleAtLaunch">YES</bool>
<bool key="IBUIResizesToFullScreen">YES</bool>
</object>
</array>
<object class="IBObjectContainer" key="IBDocument.Objects">
<array class="NSMutableArray" key="connectionRecords">
@ -227,22 +208,6 @@
</object>
<int key="connectionID">196</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">rootViewController</string>
<reference key="source" ref="380026005"/>
<reference key="destination" ref="963277495"/>
</object>
<int key="connectionID">213</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">m_window</string>
<reference key="source" ref="664661524"/>
<reference key="destination" ref="380026005"/>
</object>
<int key="connectionID">191</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">m_mapViewController</string>
@ -320,12 +285,6 @@
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">2</int>
<reference key="object" ref="380026005"/>
<array class="NSMutableArray" key="children"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="841351856"/>
@ -393,8 +352,6 @@
<string key="126.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="161.CustomClassName">EAGLView</string>
<string key="161.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<dictionary class="NSMutableDictionary" key="2.IBAttributePlaceholdersKey"/>
<string key="2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="200.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<real value="2" key="200.IBUIButtonInspectorSelectedEdgeInsetMetadataKey"/>
<real value="0.0" key="200.IBUIButtonInspectorSelectedStateConfigurationMetadataKey"/>
@ -418,6 +375,14 @@
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">EAGLView</string>
<string key="superclassName">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/EAGLView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">FirstResponder</string>
<dictionary class="NSMutableDictionary" key="actions">
@ -444,6 +409,81 @@
<string key="minorKey"/>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">MapViewController</string>
<string key="superclassName">UIViewController</string>
<dictionary class="NSMutableDictionary" key="actions">
<string key="OnBookmarksClicked:">id</string>
<string key="OnMyPositionClicked:">id</string>
<string key="OnSearchClicked:">id</string>
<string key="OnSettingsClicked:">id</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="actionInfosByName">
<object class="IBActionInfo" key="OnBookmarksClicked:">
<string key="name">OnBookmarksClicked:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="OnMyPositionClicked:">
<string key="name">OnMyPositionClicked:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="OnSearchClicked:">
<string key="name">OnSearchClicked:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="OnSettingsClicked:">
<string key="name">OnSettingsClicked:</string>
<string key="candidateClassName">id</string>
</object>
</dictionary>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="m_bookmarksButton">UIButton</string>
<string key="m_downloadButton">UIButton</string>
<string key="m_myPositionButton">UIButton</string>
<string key="m_searchButton">UIButton</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="m_bookmarksButton">
<string key="name">m_bookmarksButton</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo" key="m_downloadButton">
<string key="name">m_downloadButton</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo" key="m_myPositionButton">
<string key="name">m_myPositionButton</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo" key="m_searchButton">
<string key="name">m_searchButton</string>
<string key="candidateClassName">UIButton</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/MapViewController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">MapsAppDelegate</string>
<string key="superclassName">NSObject</string>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">m_mapViewController</string>
<string key="NS.object.0">MapViewController</string>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<string key="NS.key.0">m_mapViewController</string>
<object class="IBToOneOutletInfo" key="NS.object.0">
<string key="name">m_mapViewController</string>
<string key="candidateClassName">MapViewController</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/MapsAppDelegate.h</string>
</object>
</object>
</array>
</object>
<int key="IBDocument.localizationMode">0</int>

View file

@ -86,6 +86,10 @@
FA4B0A1415136C4C00758203 /* World.mwm.nosearch in Resources */ = {isa = PBXBuildFile; fileRef = FA4B0A1315136C4C00758203 /* World.mwm.nosearch */; };
FA4B0A16151372BA00758203 /* countries.txt.nosearch in Resources */ = {isa = PBXBuildFile; fileRef = FA4B0A15151372BA00758203 /* countries.txt.nosearch */; };
FA500588128907F0002961F0 /* visibility.txt in Resources */ = {isa = PBXBuildFile; fileRef = FA500587128907F0002961F0 /* visibility.txt */; };
FA5D4F171557F79900E7D8BB /* AddBookmarkVC.mm in Sources */ = {isa = PBXBuildFile; fileRef = FA5D4F141557F79900E7D8BB /* AddBookmarkVC.mm */; };
FA5D4F181557F79900E7D8BB /* AddBookmarkVC.mm in Sources */ = {isa = PBXBuildFile; fileRef = FA5D4F141557F79900E7D8BB /* AddBookmarkVC.mm */; };
FA5D4F191557F79900E7D8BB /* PlacePageVC.mm in Sources */ = {isa = PBXBuildFile; fileRef = FA5D4F161557F79900E7D8BB /* PlacePageVC.mm */; };
FA5D4F1A1557F79900E7D8BB /* PlacePageVC.mm in Sources */ = {isa = PBXBuildFile; fileRef = FA5D4F161557F79900E7D8BB /* PlacePageVC.mm */; };
FA64D9A913F975AD00350ECF /* types.txt in Resources */ = {isa = PBXBuildFile; fileRef = FA64D9A813F975AD00350ECF /* types.txt */; };
FA68E1671525F92700077B9E /* Default-Landscape@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FA68E1651525F92700077B9E /* Default-Landscape@2x.png */; };
FA68E1681525F92700077B9E /* Default-Landscape@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FA68E1651525F92700077B9E /* Default-Landscape@2x.png */; };
@ -1355,6 +1359,10 @@
FA4B0A1315136C4C00758203 /* World.mwm.nosearch */ = {isa = PBXFileReference; lastKnownFileType = file; name = World.mwm.nosearch; path = ../../data/World.mwm.nosearch; sourceTree = "<group>"; };
FA4B0A15151372BA00758203 /* countries.txt.nosearch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = countries.txt.nosearch; path = ../../data/countries.txt.nosearch; sourceTree = "<group>"; };
FA500587128907F0002961F0 /* visibility.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = visibility.txt; path = ../../data/visibility.txt; sourceTree = SOURCE_ROOT; };
FA5D4F131557F79900E7D8BB /* AddBookmarkVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AddBookmarkVC.h; path = Bookmarks/AddBookmarkVC.h; sourceTree = SOURCE_ROOT; };
FA5D4F141557F79900E7D8BB /* AddBookmarkVC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AddBookmarkVC.mm; path = Bookmarks/AddBookmarkVC.mm; sourceTree = SOURCE_ROOT; };
FA5D4F151557F79900E7D8BB /* PlacePageVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlacePageVC.h; path = Bookmarks/PlacePageVC.h; sourceTree = SOURCE_ROOT; };
FA5D4F161557F79900E7D8BB /* PlacePageVC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = PlacePageVC.mm; path = Bookmarks/PlacePageVC.mm; sourceTree = SOURCE_ROOT; };
FA64D9A813F975AD00350ECF /* types.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = types.txt; path = ../../data/types.txt; sourceTree = SOURCE_ROOT; };
FA68E1651525F92700077B9E /* Default-Landscape@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Landscape@2x.png"; sourceTree = "<group>"; };
FA68E1661525F92700077B9E /* Default-Portrait@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Portrait@2x.png"; sourceTree = "<group>"; };
@ -2210,6 +2218,10 @@
isa = PBXGroup;
children = (
FA36B8171540466A004560CC /* Images */,
FA5D4F131557F79900E7D8BB /* AddBookmarkVC.h */,
FA5D4F141557F79900E7D8BB /* AddBookmarkVC.mm */,
FA5D4F151557F79900E7D8BB /* PlacePageVC.h */,
FA5D4F161557F79900E7D8BB /* PlacePageVC.mm */,
FA36B80315403A4F004560CC /* BalloonView.h */,
FA36B80415403A4F004560CC /* BalloonView.mm */,
FA36B80515403A4F004560CC /* BookmarksVC.h */,
@ -4096,6 +4108,8 @@
F7B90CD31521E6D200C054EE /* CustomNavigationView.mm in Sources */,
FA36B80B15403A4F004560CC /* BalloonView.mm in Sources */,
FA36B80D15403A4F004560CC /* BookmarksVC.mm in Sources */,
FA5D4F171557F79900E7D8BB /* AddBookmarkVC.mm in Sources */,
FA5D4F191557F79900E7D8BB /* PlacePageVC.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -4123,6 +4137,8 @@
F7B90CD41521E6D200C054EE /* CustomNavigationView.mm in Sources */,
FA36B80C15403A4F004560CC /* BalloonView.mm in Sources */,
FA36B80E15403A4F004560CC /* BookmarksVC.mm in Sources */,
FA5D4F181557F79900E7D8BB /* AddBookmarkVC.mm in Sources */,
FA5D4F1A1557F79900E7D8BB /* PlacePageVC.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View file

@ -11,7 +11,6 @@
<string key="NS.object.0">1181</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>IBUIWindow</string>
<string>IBUICustomObject</string>
<string>IBUIViewController</string>
<string>IBUIButton</string>
@ -37,25 +36,6 @@
<object class="IBUICustomObject" id="664661524">
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
<object class="IBUIWindow" id="380026005">
<reference key="NSNextResponder"/>
<int key="NSvFlags">1280</int>
<object class="NSPSMatrix" key="NSFrameMatrix"/>
<string key="NSFrameSize">{768, 1024}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MSAxIDEAA</bytes>
</object>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics">
<int key="IBUIStatusBarStyle">2</int>
</object>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<bool key="IBUIVisibleAtLaunch">YES</bool>
<bool key="IBUIResizesToFullScreen">YES</bool>
</object>
<object class="IBUIViewController" id="963277495">
<object class="IBUIView" key="IBUIView" id="53915144">
<reference key="NSNextResponder"/>
@ -201,11 +181,8 @@
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="68084817"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
<object class="NSColorSpace" key="NSCustomColorSpace">
<int key="NSID">2</int>
</object>
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC45MzMzMzMzMzMzIDAuOTMzMzMzMzMzMyAwLjg2NjY2NjY2NjcAA</bytes>
</object>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<bool key="IBUIMultipleTouchEnabled">YES</bool>
@ -230,22 +207,6 @@
</object>
<int key="connectionID">189</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">rootViewController</string>
<reference key="source" ref="380026005"/>
<reference key="destination" ref="963277495"/>
</object>
<int key="connectionID">197</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">m_window</string>
<reference key="source" ref="664661524"/>
<reference key="destination" ref="380026005"/>
</object>
<int key="connectionID">188</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">m_mapViewController</string>
@ -323,12 +284,6 @@
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">2</int>
<reference key="object" ref="380026005"/>
<array class="NSMutableArray" key="children"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="841351856"/>
@ -402,12 +357,6 @@
<real value="0.0" key="191.IBUIButtonInspectorSelectedStateConfigurationMetadataKey"/>
<string key="192.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<real value="1" key="192.IBUIButtonInspectorSelectedStateConfigurationMetadataKey"/>
<dictionary class="NSMutableDictionary" key="2.IBAttributePlaceholdersKey"/>
<object class="NSMutableDictionary" key="2.IBLastUsedUIStatusBarStylesToTargetRuntimesMap">
<string key="NS.key.0">IBCocoaTouchFramework</string>
<integer value="0" key="NS.object.0"/>
</object>
<string key="2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="204.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<real value="1" key="204.IBUIButtonInspectorSelectedStateConfigurationMetadataKey"/>
<string key="3.CustomClassName">MapsAppDelegate</string>
@ -514,20 +463,17 @@
<object class="IBPartialClassDescription">
<string key="className">MapsAppDelegate</string>
<string key="superclassName">NSObject</string>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="m_mapViewController">MapViewController</string>
<string key="m_window">UIWindow</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="m_mapViewController">
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">m_mapViewController</string>
<string key="NS.object.0">MapViewController</string>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<string key="NS.key.0">m_mapViewController</string>
<object class="IBToOneOutletInfo" key="NS.object.0">
<string key="name">m_mapViewController</string>
<string key="candidateClassName">MapViewController</string>
</object>
<object class="IBToOneOutletInfo" key="m_window">
<string key="name">m_window</string>
<string key="candidateClassName">UIWindow</string>
</object>
</dictionary>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/MapsAppDelegate.h</string>