diff --git a/iphone/Barcodes/Barcodes.xcodeproj/project.pbxproj b/iphone/Barcodes/Barcodes.xcodeproj/project.pbxproj index 28c625200..def76abda 100755 --- a/iphone/Barcodes/Barcodes.xcodeproj/project.pbxproj +++ b/iphone/Barcodes/Barcodes.xcodeproj/project.pbxproj @@ -11,6 +11,10 @@ 1D60589B0D05DD56006BFB54 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.mm */; }; 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; + 1F91E0BF1292BAC9003A0BFD /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1F91E0BE1292BAC9003A0BFD /* Default@2x.png */; }; + 1F91E0C11292BAD5003A0BFD /* LatestResultBackground.png in Resources */ = {isa = PBXBuildFile; fileRef = 1F91E0C01292BAD5003A0BFD /* LatestResultBackground.png */; }; + 1F91E0D71292CA8C003A0BFD /* LatestResultBackground@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1F91E0D61292CA8C003A0BFD /* LatestResultBackground@2x.png */; }; + 1F91E0E31292D1DC003A0BFD /* clickHere.png in Resources */ = {isa = PBXBuildFile; fileRef = 1F91E0E21292D1DC003A0BFD /* clickHere.png */; }; 1FB4301D128FFDCF002D63E8 /* libZXingWidget.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FB4301C128FFDCD002D63E8 /* libZXingWidget.a */; }; 1FB43030128FFF56002D63E8 /* icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 1FB4302E128FFF56002D63E8 /* icon.png */; }; 1FB43031128FFF56002D63E8 /* icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1FB4302F128FFF56002D63E8 /* icon@2x.png */; }; @@ -78,6 +82,10 @@ 1D3623250D0F684500981E51 /* BarcodesAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BarcodesAppDelegate.m; sourceTree = ""; }; 1D6058910D05DD3D006BFB54 /* Barcodes.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Barcodes.app; sourceTree = BUILT_PRODUCTS_DIR; }; 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 1F91E0BE1292BAC9003A0BFD /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default@2x.png"; path = "images/Default@2x.png"; sourceTree = ""; }; + 1F91E0C01292BAD5003A0BFD /* LatestResultBackground.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = LatestResultBackground.png; path = images/LatestResultBackground.png; sourceTree = ""; }; + 1F91E0D61292CA8C003A0BFD /* LatestResultBackground@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "LatestResultBackground@2x.png"; path = "images/LatestResultBackground@2x.png"; sourceTree = ""; }; + 1F91E0E21292D1DC003A0BFD /* clickHere.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = clickHere.png; path = images/clickHere.png; sourceTree = ""; }; 1FB43017128FFDCD002D63E8 /* ZXingWidget.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ZXingWidget.xcodeproj; path = ../ZXingWidget/ZXingWidget.xcodeproj; sourceTree = SOURCE_ROOT; }; 1FB4302E128FFF56002D63E8 /* icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = icon.png; path = images/icon.png; sourceTree = ""; }; 1FB4302F128FFF56002D63E8 /* icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "icon@2x.png"; path = "images/icon@2x.png"; sourceTree = ""; }; @@ -222,6 +230,10 @@ 1FB4302D128FFF46002D63E8 /* images */ = { isa = PBXGroup; children = ( + 1F91E0E21292D1DC003A0BFD /* clickHere.png */, + 1F91E0D61292CA8C003A0BFD /* LatestResultBackground@2x.png */, + 1F91E0C01292BAD5003A0BFD /* LatestResultBackground.png */, + 1F91E0BE1292BAC9003A0BFD /* Default@2x.png */, 1FB4365A12918E90002D63E8 /* business-card.png */, 1FB4365B12918E90002D63E8 /* Default.png */, 1FB4365C12918E90002D63E8 /* email.png */, @@ -393,6 +405,10 @@ 1FB4366E12918E90002D63E8 /* sms.png in Resources */, 1FB4366F12918E90002D63E8 /* text.png in Resources */, 1FB436DF129194E7002D63E8 /* scans.db in Resources */, + 1F91E0BF1292BAC9003A0BFD /* Default@2x.png in Resources */, + 1F91E0C11292BAD5003A0BFD /* LatestResultBackground.png in Resources */, + 1F91E0D71292CA8C003A0BFD /* LatestResultBackground@2x.png in Resources */, + 1F91E0E31292D1DC003A0BFD /* clickHere.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/iphone/Barcodes/Classes/ScanViewController.m b/iphone/Barcodes/Classes/ScanViewController.m index ee40cc92d..7457b1cc1 100644 --- a/iphone/Barcodes/Classes/ScanViewController.m +++ b/iphone/Barcodes/Classes/ScanViewController.m @@ -103,6 +103,7 @@ textView.font = bodyFont; [textView setTag:TEXT_VIEW_TAG]; textView.editable = NO; + textView.dataDetectorTypes = UIDataDetectorTypeAll; [textView setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)]; [cell.contentView addSubview:textView]; [textView release]; diff --git a/iphone/Barcodes/Classes/ZXMainViewController.h b/iphone/Barcodes/Classes/ZXMainViewController.h index 44b5d6fca..baa568079 100644 --- a/iphone/Barcodes/Classes/ZXMainViewController.h +++ b/iphone/Barcodes/Classes/ZXMainViewController.h @@ -19,11 +19,15 @@ UniversalResultParser *resultParser; NSArray *actions; ParsedResult *result; + IBOutlet UILabel *latestResultLabel; + IBOutlet UITextView *resultView; } -@property(nonatomic,retain) UniversalResultParser *resultParser; +@property (nonatomic,retain) UniversalResultParser *resultParser; @property (nonatomic,assign) NSArray *actions; @property (nonatomic,assign) ParsedResult *result; +@property (nonatomic,retain) IBOutlet UITextView *resultView; +@property (nonatomic,retain) IBOutlet UILabel *latestResultLabel; - (IBAction)scan:(id)sender; - (IBAction)info:(id)sender; diff --git a/iphone/Barcodes/Classes/ZXMainViewController.mm b/iphone/Barcodes/Classes/ZXMainViewController.mm index 31a1a8094..1825df6dd 100644 --- a/iphone/Barcodes/Classes/ZXMainViewController.mm +++ b/iphone/Barcodes/Classes/ZXMainViewController.mm @@ -18,6 +18,7 @@ @synthesize resultParser; @synthesize actions; @synthesize result; +@synthesize resultView; // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. /* @@ -33,10 +34,14 @@ // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { - [super viewDidLoad]; - UniversalResultParser *parser = [[UniversalResultParser alloc] initWithDefaultParsers]; - self.resultParser = parser; - [parser release]; + [super viewDidLoad]; + UniversalResultParser *parser = [[UniversalResultParser alloc] initWithDefaultParsers]; + self.resultParser = parser; + [parser release]; + NSString *lastResult = [[NSUserDefaults standardUserDefaults] objectForKey:@"lastScan"]; + if (!lastResult) lastResult = NSLocalizedString(@"MainViewLatestResultDefault",@"Last result will appear here once you have scanned a barcode at least once"); + self.resultView.text = (NSString*)[[NSUserDefaults standardUserDefaults] objectForKey:@"lastScan"]; + } @@ -115,6 +120,7 @@ - (void)dealloc { [resultParser release]; + [resultView release]; actions = nil; result = nil; [super dealloc]; @@ -131,7 +137,9 @@ #ifdef DEBUG NSLog(@"result has %d actions", actions ? 0 : actions.count); #endif + self.resultView.text = resultString; [[Database sharedDatabase] addScanWithText:resultString]; + [[NSUserDefaults standardUserDefaults] setObject:resultString forKey:@"lastScan"]; [self performResultAction]; } diff --git a/iphone/Barcodes/Classes/ZXMainViewController.xib b/iphone/Barcodes/Classes/ZXMainViewController.xib index 43a5b8523..a777a8794 100644 --- a/iphone/Barcodes/Classes/ZXMainViewController.xib +++ b/iphone/Barcodes/Classes/ZXMainViewController.xib @@ -42,22 +42,22 @@ 274 YES - + - 274 - {{96, 81}, {128, 128}} + 292 + {{199, 42}, {120, 66}} NO IBCocoaTouchFramework NSImage - ZxingLarge.png + clickHere.png 292 - {{68, 30}, {183, 21}} + {{68, 20}, {183, 21}} NO YES @@ -70,7 +70,7 @@ 17 16 - + 1 MCAwIDAAA @@ -84,7 +84,7 @@ 292 - {{96, 240}, {128, 61}} + {{95, 109}, {128, 128}} NO IBCocoaTouchFramework @@ -95,8 +95,6 @@ 15 16 - 1 - Scan! 1 @@ -106,25 +104,10 @@ 3 MC41AA - - - - 292 - {{96, 412}, {128, 28}} - - NO - IBCocoaTouchFramework - 0 - 0 - - 1 - Archives - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + NSImage + ZxingLarge.png - @@ -145,6 +128,79 @@ + + + 292 + {{4, 258}, {311, 152}} + + NO + IBCocoaTouchFramework + + NSImage + LatestResultBackground.png + + + + + 292 + {{25, 269}, {94, 18}} + + NO + YES + 7 + NO + IBCocoaTouchFramework + Latest result : + + Helvetica-Bold + 14 + 16 + + + + 1 + 10 + + + + 292 + {{19, 292}, {280, 95}} + + + 3 + MSAwAA + + YES + YES + IBCocoaTouchFramework + 1 + NO + + + 2 + IBCocoaTouchFramework + + 15 + + + + 292 + {{15, 418}, {106, 26}} + + NO + IBCocoaTouchFramework + 0 + 0 + + 1 + View Archive + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + {320, 460} @@ -188,12 +244,20 @@ showArchive: - + 7 14 + + + resultView + + + + 16 + @@ -209,11 +273,14 @@ YES - - - + + + + + + @@ -228,11 +295,6 @@ - - 4 - - - 8 @@ -240,7 +302,7 @@ 10 - + @@ -253,6 +315,26 @@ + + 15 + + + + + 17 + + + + + 19 + + + + + 20 + + + @@ -265,8 +347,13 @@ 1.IBPluginDependency 10.IBPluginDependency 10.IBViewBoundsToFrameTransform - 4.IBPluginDependency - 4.IBViewBoundsToFrameTransform + 15.IBPluginDependency + 15.IBViewBoundsToFrameTransform + 17.IBPluginDependency + 19.IBPluginDependency + 19.IBViewBoundsToFrameTransform + 20.IBPluginDependency + 20.IBViewBoundsToFrameTransform 5.IBPluginDependency 5.IBViewBoundsToFrameTransform 6.IBPluginDependency @@ -282,19 +369,28 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - AULAAABDzgAAA + P4AAAL+AAABDCQAAw90AAA com.apple.InterfaceBuilder.IBCocoaTouchPlugin - P4AAAL+AAABCoAAAwzYAAA + P4AAAL+AAABBoAAAw8iAAA + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + P4AAAL+AAABAoAAAw9UAAA com.apple.InterfaceBuilder.IBCocoaTouchPlugin - AUKIAABB8AAAA + P4AAAL+AAABDSQAAwsYAAA com.apple.InterfaceBuilder.IBCocoaTouchPlugin - AULAAABDcAAAA + P4AAAL+AAABCiAAAwiQAAA + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + P4AAAL+AAABCvgAAw3gAAA com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -318,7 +414,7 @@ - 14 + 20 @@ -365,6 +461,38 @@ + + YES + + YES + latestResultLabel + resultView + + + YES + UILabel + UITextView + + + + YES + + YES + latestResultLabel + resultView + + + YES + + latestResultLabel + UILabel + + + resultView + UITextView + + + IBProjectSource Classes/ZXMainViewController.h @@ -501,6 +629,14 @@ NSObject + + UIScrollView + UIView + + IBFrameworkSource + UIKit.framework/Headers/UIScrollView.h + + UISearchBar UIView @@ -517,6 +653,14 @@ UIKit.framework/Headers/UISearchDisplayController.h + + UITextView + UIScrollView + + IBFrameworkSource + UIKit.framework/Headers/UITextView.h + + UIView @@ -591,8 +735,19 @@ ../Barcodes.xcodeproj 3 - ZxingLarge.png - {128, 128} + YES + + YES + LatestResultBackground.png + ZxingLarge.png + clickHere.png + + + YES + {311, 158} + {128, 128} + {179, 99} + 132 diff --git a/iphone/Barcodes/images/LatestResultBackground.png b/iphone/Barcodes/images/LatestResultBackground.png new file mode 100644 index 000000000..e34dc5c8a Binary files /dev/null and b/iphone/Barcodes/images/LatestResultBackground.png differ diff --git a/iphone/Barcodes/images/LatestResultBackground@2x.png b/iphone/Barcodes/images/LatestResultBackground@2x.png new file mode 100644 index 000000000..5654f3e44 Binary files /dev/null and b/iphone/Barcodes/images/LatestResultBackground@2x.png differ diff --git a/iphone/Barcodes/images/clickHere.png b/iphone/Barcodes/images/clickHere.png new file mode 100644 index 000000000..7f5f19ca0 Binary files /dev/null and b/iphone/Barcodes/images/clickHere.png differ