Browse Source

【提交内容】:main/sub分开

wangyj18 9 years ago
parent
commit
2558916f31

+ 7 - 0
display-client/AndroidManifest.xml

@ -124,6 +124,13 @@
124 124
        <activity android:name="com.wade.mobile.common.keyboard.keyboardActivity"
125 125
            android:theme="@android:style/Theme.Translucent">
126 126
        </activity>
127
        <!-- 手势锁 -->
128
        <activity android:name="com.wade.mobile.common.screenlock.ScreenUnlockActivity" 
129
            android:theme="@android:style/Theme.NoTitleBar">
130
        </activity> 
131
        <activity android:name="com.wade.mobile.common.screenlock.SetScreenLockActivity" 
132
            android:theme="@android:style/Theme.NoTitleBar">
133
        </activity>
127 134
        
128 135
         <!-- YunBa Start -->
129 136


+ 4 - 0
display-client/assets/mobile-action.xml

@ -119,4 +119,8 @@
119 119
	
120 120
	<!-- keyboard -->
121 121
	<action name="openKeyboard" class="com.wade.mobile.func.MobileKeyboard" method="openKeyboard"></action>
122
	
123
	<action name="setScreeLock" class="com.wade.mobile.func.MobileScreenLock" method="setScreeLock"></action>
124
	<action name="screeUnlock" class="com.wade.mobile.func.MobileScreenLock" method="screeUnlock"></action>
125
	
122 126
</actions>

+ 6 - 0
display-client/src/com/ai/mobile/display/MainActivity.java

@ -32,6 +32,12 @@ public class MainActivity extends TemplateMainActivity {
32 32
			super.onCreate(savedInstanceState);
33 33
		}
34 34
	}
35
	
36
//	@Override
37
//	protected void initActivity() throws Exception {
38
//		MobileScreenLock plugin = getPluginManager().getPlugin(MobileScreenLock.class);
39
//		plugin.screeUnlock(null);
40
//	}
35 41

36 42
	@Override
37 43
	public void onBackPressed() {

+ 2 - 0
display-server/web/biz/js/scene/Login.js

@ -43,6 +43,8 @@ require(["wmTabbar","common","mobile","util"], function(WmTabbar,Common,Mobile)
43 43
		
44 44
		// 将前台输入的参数传至后台校验
45 45
		Common.callSvc("SceneBean.login",loginData,function(data){
46
			WadeMobile.setScreeLock("SceneBean.login",loginData,"Index");
47
			
46 48
			console.log("结果[用户登陆]:" + data);
47 49
			
48 50
			if(typeof(resultData) == "string" ){

+ 4 - 0
display-server/web/res/js/mobile/expand-mobile.js

@ -291,6 +291,10 @@ define(["require"],function(require) {
291 291
				execute("openBrowser",[url],err);
292 292
			},openKeyboard:function(value,err){
293 293
				execute("openKeyboard",[value],err);
294
			},setScreeLock:function(dataAction,param,indexPage,err){
295
				execute("setScreeLock",[dataAction,param,indexPage],err);
296
			},screeUnlock:function(err){
297
				execute("screeUnlock",[],err);
294 298
			}
295 299
		};
296 300
	})();

+ 0 - 3
multiple-client/src/com/ai/mobile/multiple/MainActivity.java

@ -5,12 +5,9 @@ import java.util.Map;
5 5

6 6
import android.content.Intent;
7 7
import android.content.SharedPreferences;
8
import android.content.pm.PackageInfo;
9
import android.net.Uri;
10 8
import android.os.AsyncTask;
11 9
import android.os.Bundle;
12 10
import android.text.TextUtils;
13
import android.util.Log;
14 11
import android.view.View;
15 12
import android.widget.Toast;
16 13


+ 12 - 13
multiple-client/src/com/ai/mobile/multiple/SubAppActivity.java

@ -3,7 +3,6 @@ package com.ai.mobile.multiple;
3 3
import java.util.HashMap;
4 4
import java.util.Map;
5 5

6
import android.content.pm.PackageManager.NameNotFoundException;
7 6
import android.os.Bundle;
8 7
import android.view.View;
9 8

@ -12,7 +11,7 @@ import com.ailk.common.data.impl.DataMap;
12 11
import com.wade.mobile.app.AppRecord;
13 12
import com.wade.mobile.app.MobileOperation;
14 13
import com.wade.mobile.app.MobileUtil;
15
import com.wade.mobile.frame.activity.TemplateMainActivity;
14
import com.wade.mobile.frame.activity.TemplateSubActivity;
16 15
import com.wade.mobile.frame.config.ServerConfig;
17 16
import com.wade.mobile.frame.multiple.MultipleManager;
18 17
import com.wade.mobile.frame.template.TemplateWebView;
@ -21,7 +20,7 @@ import com.wade.mobile.func.MobileUI;
21 20
import com.wade.mobile.ui.comp.dialog.ConfirmBlockDialog;
22 21
import com.wade.mobile.ui.view.FlipperLayout;
23 22

24
public class SubAppActivity extends TemplateMainActivity{
23
public class SubAppActivity extends TemplateSubActivity{
25 24
	private static Map<String,Boolean> firstStatus = new HashMap<String,Boolean>();//判断子应用第一次开启状态
26 25
	
27 26
	@Override
@ -62,7 +61,6 @@ public class SubAppActivity extends TemplateMainActivity{
62 61
	@Override
63 62
	protected void initActivity() throws Exception {
64 63
		// TODO Auto-generated method stub
65
		firstStatus.put(MultipleManager.getCurrAppId(), false);
66 64
		IData param = new DataMap();
67 65
		MobileStorage mobileStorage = getPluginManager().getPlugin(MobileStorage.class);
68 66
		param.put("SESSION_ID", mobileStorage.getMemoryCache("SESSION_ID", ""));
@ -72,24 +70,25 @@ public class SubAppActivity extends TemplateMainActivity{
72 70
		indexPage = indexPage == null ? ServerConfig.getInstance().getValue("indexPage") : indexPage;
73 71
		MobileUI mobileUI = getPluginManager().getPlugin(MobileUI.class);
74 72
		mobileUI.openPage(indexPage, param);
73
		firstStatus.put(MultipleManager.getCurrAppId(), false);
75 74
	}
76 75
	
77 76
	/**
78 77
	 * 第二次进入则不做资源更新和客户端更新
79 78
	 */
80
	protected boolean isUpdate() {
79
	protected boolean isInit() {
81 80
		// TODO Auto-generated method stub
82 81
		return firstStatus.get(MultipleManager.getCurrAppId()) == null;
83 82
	}
84 83
	
85
	/**
86
	 * 不做客户端更新
87
	 */
88
	@Override
89
	protected boolean isUpdateClient(String clientVersion) throws NameNotFoundException {
90
		// TODO Auto-generated method stub
91
		return false;
92
	}
84
//	/**
85
//	 * 不做客户端更新
86
//	 */
87
//	@Override
88
//	protected boolean isUpdateClient(String clientVersion) throws NameNotFoundException {
89
//		// TODO Auto-generated method stub
90
//		return false;
91
//	}
93 92
	
94 93
	/**
95 94
	 * 第二次进入则不使用欢迎页的延时配置

+ 74 - 0
wade-mobile-func/src/com/wade/mobile/func/MobileScreenLock.java

@ -0,0 +1,74 @@
1
package com.wade.mobile.func;
2

3
import org.json.JSONArray;
4

5
import android.content.Intent;
6

7
import com.ailk.common.data.IData;
8
import com.ailk.common.data.impl.DataMap;
9
import com.wade.mobile.common.screenlock.ScreenUnlockActivity;
10
import com.wade.mobile.common.screenlock.SetScreenLockActivity;
11
import com.wade.mobile.frame.IWadeMobile;
12
import com.wade.mobile.frame.plugin.Plugin;
13

14
public class MobileScreenLock extends Plugin {
15

16
	private static final int LOCK = 1;
17
	private static final int UN_LOCK = 2;
18

19
	public MobileScreenLock(IWadeMobile wademobile) {
20
		super(wademobile);
21
	}
22

23
	public void setScreeLock(JSONArray param) throws Exception {
24
		String dataAction = param.getString(0);
25
		String dataParam = param.getString(1);
26
		String indexPage = param.getString(2);
27
		Intent intent = new Intent(context, SetScreenLockActivity.class);
28
		intent.putExtra("dataAction", dataAction);
29
		intent.putExtra("dataParam", dataParam);
30
		intent.putExtra("indexPage", indexPage);
31
		startActivityForResult(intent, LOCK);
32
	}
33

34
	public void screeUnlock(JSONArray param) throws Exception {
35
		Intent intent = new Intent(context, ScreenUnlockActivity.class);
36
		startActivityForResult(intent, UN_LOCK);
37

38
	}
39

40
	public void onActivityResult(int requestCode, int resultCode, Intent intent) {
41
		if (requestCode == LOCK) {
42
			if (resultCode == SetScreenLockActivity.SCREEN_LOCK) {
43
				try {
44
					MobileUI plugin = wademobile.getPluginManager().getPlugin(
45
							MobileUI.class);
46
					String indexPage = intent.getStringExtra("indexPage");
47
					plugin.openPage(indexPage, null);
48
				} catch (Exception e) {
49
					e.printStackTrace();
50
				}
51
			}
52
		} else if (requestCode == UN_LOCK) {
53
			if (resultCode == ScreenUnlockActivity.SCREEN_UNLOCK) {
54
				try {
55
					String dataAction = intent.getStringExtra("dataAction");
56
					String dataParam = intent.getStringExtra("dataParam");
57
					String indexPage = intent.getStringExtra("indexPage");
58

59
					// 自动登陆,,,但是测试的时候好像有点问题呐!!!!!
60
					IData param = new DataMap(dataParam);
61
					MobileNetWork mobileNetWork = wademobile.getPluginManager()
62
							.getPlugin(MobileNetWork.class);
63
					mobileNetWork.dataRequest(dataAction, param);
64

65
					MobileUI plugin = wademobile.getPluginManager().getPlugin(
66
							MobileUI.class);
67
					plugin.openPage(indexPage, null);
68
				} catch (Exception e) {
69
					e.printStackTrace();
70
				}
71
			}
72
		}
73
	}
74
}