浏览代码

【提交内容】:更新 ScreenLock API

wangyj18 9 年之前
父节点
当前提交
eb6aeef361
共有 1 个文件被更改,包括 6 次插入26 次删除
  1. 6 26
      wade-mobile-func/src/com/wade/mobile/func/MobileScreenLock.java

+ 6 - 26
wade-mobile-func/src/com/wade/mobile/func/MobileScreenLock.java

@ -8,7 +8,6 @@ import android.content.SharedPreferences;
8 8

9 9
import com.ailk.common.data.IData;
10 10
import com.ailk.common.data.impl.DataMap;
11
import com.wade.mobile.common.MobileThread;
12 11
import com.wade.mobile.common.screenlock.ScreenUnlockActivity;
13 12
import com.wade.mobile.common.screenlock.SetScreenLockActivity;
14 13
import com.wade.mobile.common.screenlock.view.LocusPassWordView;
@ -26,14 +25,12 @@ public class MobileScreenLock extends Plugin {
26 25
	}
27 26

28 27
	public void setScreenLock(JSONArray param) throws Exception {
29
		String dataAction = param.getString(0);
30
		String dataParam = param.getString(1);
31
		setScreenLock(dataAction, dataParam);
28
		String dataParam = param.getString(0);
29
		setScreenLock(dataParam);
32 30
	}
33 31

34
	public void setScreenLock(String dataAction, String dataParam) throws Exception {
32
	public void setScreenLock(String dataParam) throws Exception {
35 33
		Intent intent = new Intent(context, SetScreenLockActivity.class);
36
		intent.putExtra("dataAction", dataAction);
37 34
		intent.putExtra("dataParam", dataParam);
38 35
		startActivityForResult(intent, LOCK);
39 36
	}
@ -70,31 +67,14 @@ public class MobileScreenLock extends Plugin {
70 67
	public void onActivityResult(int requestCode, int resultCode, Intent intent) {
71 68
		if (requestCode == LOCK) {
72 69
			if (resultCode == SetScreenLockActivity.SCREEN_LOCK) {
73
				callback("screenLockSuccess");
70
				String dataParam = intent.getStringExtra("dataParam");
71
				callback(dataParam);
74 72
			}
75 73
		} else if (requestCode == UN_LOCK) {
76 74
			if (resultCode == ScreenUnlockActivity.SCREEN_UNLOCK) {
77 75
				try {
78
					final String dataAction = intent.getStringExtra("dataAction");
79 76
					String dataParam = intent.getStringExtra("dataParam");
80
					IData temp = new DataMap();
81
					if (!isNull(dataParam)) {
82
						temp = new DataMap(dataParam);
83
						temp.put("isAutoLogin", true);
84
					}
85
					final IData param = temp;
86

87
					if (!isNull(dataAction)) {
88
						new MobileThread("unLock") {
89
							protected void execute() throws Exception {
90
								MobileNetWork mobileNetWork = wademobile.getPluginManager()
91
										.getPlugin(MobileNetWork.class);
92
								mobileNetWork.dataRequest(dataAction, param);
93
							}
94
						}.start();
95
					}
96

97
					callback("screenUnlockSuccess");
77
					callback(dataParam);
98 78

99 79
				} catch (Exception e) {
100 80
					e.printStackTrace();