Browse Source

【提交内容】:手势锁

wangyj18 9 years ago
parent
commit
05586c6ad8

+ 7 - 0
display-client/AndroidManifest.xml

124
        <activity android:name="com.wade.mobile.common.keyboard.keyboardActivity"
124
        <activity android:name="com.wade.mobile.common.keyboard.keyboardActivity"
125
            android:theme="@android:style/Theme.Translucent">
125
            android:theme="@android:style/Theme.Translucent">
126
        </activity>
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
         <!-- YunBa Start -->
135
         <!-- YunBa Start -->
129

136


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

119
	
119
	
120
	<!-- keyboard -->
120
	<!-- keyboard -->
121
	<action name="openKeyboard" class="com.wade.mobile.func.MobileKeyboard" method="openKeyboard"></action>
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
</actions>
126
</actions>

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

32
			super.onCreate(savedInstanceState);
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
	@Override
42
	@Override
37
	public void onBackPressed() {
43
	public void onBackPressed() {

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

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

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

291
				execute("openBrowser",[url],err);
291
				execute("openBrowser",[url],err);
292
			},openKeyboard:function(value,err){
292
			},openKeyboard:function(value,err){
293
				execute("openKeyboard",[value],err);
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
	})();

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

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
}