You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by cx...@apache.org on 2017/04/11 06:38:37 UTC

[06/18] incubator-weex git commit: * [ios] add shortcut for scanner history

* [ios] add shortcut for scanner history


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/cf9fcf49
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/cf9fcf49
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/cf9fcf49

Branch: refs/heads/0.12-dev
Commit: cf9fcf49690c0c6295e472cc2fa979c7fa0c6766
Parents: 1ac185e
Author: acton393 <zh...@gmail.com>
Authored: Fri Mar 31 11:29:05 2017 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Fri Mar 31 11:29:05 2017 +0800

----------------------------------------------------------------------
 ios/playground/WeexDemo/AppDelegate.m |  5 +++++
 ios/playground/WeexDemo/DemoDefine.h  |  1 +
 ios/playground/WeexDemo/Info.plist    | 12 +++++++++++-
 3 files changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/cf9fcf49/ios/playground/WeexDemo/AppDelegate.m
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/AppDelegate.m b/ios/playground/WeexDemo/AppDelegate.m
index 4cb55de..d02a04c 100644
--- a/ios/playground/WeexDemo/AppDelegate.m
+++ b/ios/playground/WeexDemo/AppDelegate.m
@@ -15,6 +15,7 @@
 #import "WXImgLoaderDefaultImpl.h"
 #import "DemoDefine.h"
 #import "WXScannerVC.h"
+#import "WXScannerHistoryVC.h"
 #import "WXSyncTestModule.h"
 #import "UIView+UIThreadCheck.h"
 #import <WeexSDK/WeexSDK.h>
@@ -55,6 +56,10 @@
         WXScannerVC * scanViewController = [[WXScannerVC alloc] init];
         [(WXRootViewController*)self.window.rootViewController pushViewController:scanViewController animated:YES];
     }
+    if ([shortcutItem.type isEqualToString:QRSCAN_HISTORY]) {
+        WXScannerHistoryVC *scannerHistoryVC = [WXScannerHistoryVC new];
+        [(WXRootViewController*)self.window.rootViewController pushViewController:scannerHistoryVC animated:YES];
+    }
 }
 
 - (void)applicationDidEnterBackground:(UIApplication *)application

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/cf9fcf49/ios/playground/WeexDemo/DemoDefine.h
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/DemoDefine.h b/ios/playground/WeexDemo/DemoDefine.h
index 2c0be7c..9f3bdf9 100644
--- a/ios/playground/WeexDemo/DemoDefine.h
+++ b/ios/playground/WeexDemo/DemoDefine.h
@@ -25,5 +25,6 @@
 #define UITEST_HOME_URL @"http://test?_wx_tpl=http://localhost:12580/test/build/TC__Home.js"
 
 #define QRSCAN  @"com.taobao.WeexDemo.scan"
+#define QRSCAN_HISTORY  @"com.taobao.WeexDemo.scan.history"
 #define WEEX_COLOR [UIColor colorWithRed:0.27 green:0.71 blue:0.94 alpha:1]
 #define WX_SCANNER_HISTORY @"wx_scanner_history"

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/cf9fcf49/ios/playground/WeexDemo/Info.plist
----------------------------------------------------------------------
diff --git a/ios/playground/WeexDemo/Info.plist b/ios/playground/WeexDemo/Info.plist
index a60368b..12ee186 100644
--- a/ios/playground/WeexDemo/Info.plist
+++ b/ios/playground/WeexDemo/Info.plist
@@ -54,10 +54,20 @@
 	<key>UIApplicationShortcutItems</key>
 	<array>
 		<dict>
+			<key>UIApplicationShortcutItemTitle</key>
+			<string>Scan history</string>
+			<key>UIApplicationShortcutItemType</key>
+			<string>com.taobao.WeexDemo.scan.history</string>
+			<key>UIApplicationShortcutItemSubtitle</key>
+			<string>history</string>
+			<key>UIApplicationShortcutItemIconFile</key>
+			<string>scan_history</string>
+		</dict>
+		<dict>
 			<key>UIApplicationShortcutItemIconFile</key>
 			<string>scan</string>
 			<key>UIApplicationShortcutItemSubtitle</key>
-			<string>scan your QR code</string>
+			<string>scan QR code</string>
 			<key>UIApplicationShortcutItemTitle</key>
 			<string>Scan QR</string>
 			<key>UIApplicationShortcutItemType</key>