Sfoglia il codice sorgente

Merge branch 'master' of http://10.1.235.20:3000/ipu/android-share

Conflicts:
	wade-mobile-common/.classpath
	wade-mobile-common/libs/wade-mobile-com.jar
leijie 8 anni fa
parent
commit
56063e327d

+ 4 - 0
display-client/AndroidManifest.xml

@ -112,6 +112,10 @@
112 112
        <activity
113 113
            android:name="com.wade.mobile.ui.activity.OpenUrlActivity">
114 114
        </activity>
115
        <!-- 打开自定义浏览器 -->
116
        <activity
117
            android:name="com.wade.mobile.common.browser.BrowserActivity">
118
        </activity>
115 119
        <!-- 侧滑菜单 -->
116 120
        <activity android:name="com.wade.mobile.ui.activity.SlidingMenuActivity"
117 121
            android:theme="@style/SlidingMenuTheme" >

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

@ -22,6 +22,8 @@
22 22
	<action name="downloadWithServlet" class="com.wade.mobile.func.MobileNetWork" method="downloadWithServlet"></action>
23 23
	<action name="uploadWithServlet" class="com.wade.mobile.func.MobileNetWork" method="uploadWithServlet"></action>
24 24
	<action name="openBrowser" class="com.wade.mobile.func.MobileNetWork" method="openBrowser" ></action>
25
	<!-- 打开浏览器插件 -->
26
	<action name="openIpuBrowser" class="com.wade.mobile.func.MobileBrowser" method="openIpuBrowser" ></action>
25 27
	<!-- NFC -->
26 28
	<action name="initNfc" class="com.wade.mobile.func.MobileDevice" method="initNfc"></action>
27 29
	

+ 7 - 0
display-server/src/main/webapp/biz/js/plugin/pageHandler/pageHandler.js

@ -12,15 +12,22 @@ require(["domReady!","wadeMobile","mobile","util"], function(doc,WadeMobile,Mobi
12 12
	$("#loadTemplate").tap(function(){
13 13
		Mobile.loadTemplate("PageA");
14 14
	});
15
	// 被打开的url,不管停留在哪一层页面,按返回会提示退出
15 16
	$("#openUrl").tap(function(){
16 17
		Mobile.openUrl("https://www.baidu.com");
17 18
	});
19
	// 被打开的url,不管停留在哪一层页面,直接退出至ipu主页面
18 20
	$("#loadUrl").tap(function(){
19 21
		Mobile.loadUrl("https://www.baidu.com");
20 22
	});
23
	// 打开原生的浏览器窗口
21 24
	$("#openBrowser").tap(function(){
22 25
		WadeMobile.openBrowser("https://www.baidu.com");
23 26
	});
27
	// 在IPU应用中集成浏览器功能,打开自定义浏览器
28
	$("#openIpuBroswer").tap(function() {
29
		WadeMobile.openIpuBrowser("https://www.baidu.com","true");
30
	});
24 31
	$("#back").tap(function(){
25 32
		Mobile.openPage("KeyDownListen");
26 33
	});

+ 2 - 0
display-server/src/main/webapp/res/js/mobile/expand-mobile.js

@ -162,6 +162,8 @@ define(["require"],function(require) {
162 162
				execute("shareByBluetooth", [],err);
163 163
			},openBrowser:function(url,err){
164 164
				execute("openBrowser",[url],err);
165
			},openIpuBrowser:function(url,hasTitle,err){
166
				execute("openIpuBrowser",[url,hasTitle],err);
165 167
			},setSmsListener:function(callback,telString,err){
166 168
				storageCallback("setSmsListener", callback);
167 169
				execute("setSmsListener", [telString],err);

+ 7 - 0
display-server/src/main/webapp/template/webapp/plugin/PageHandler/PageHandler.html

@ -69,6 +69,13 @@
69 69
						<div class="fn fn-2">测试</div>
70 70
					</div>
71 71
				</li>
72
				
73
				<li id="openIpuBroswer">
74
					<div class="content">
75
						<div class="main">openIpuBroswer</div>
76
						<div class="fn fn-2">测试</div>
77
					</div>
78
				</li>
72 79
			</ul>
73 80
		</div>
74 81
		

+ 8 - 8
wade-mobile-common/.classpath

@ -1,8 +1,8 @@
1
<?xml version="1.0" encoding="UTF-8"?>
2
<classpath>
3
	<classpathentry kind="src" path="gen"/>
4
	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
5
	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
6
	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
7
	<classpathentry kind="output" path="bin/classes"/>
8
</classpath>
1
<?xml version="1.0" encoding="UTF-8"?>
2
<classpath>
3
	<classpathentry kind="src" path="gen"/>
4
	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
5
	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
6
	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
7
	<classpathentry kind="output" path="bin/classes"/>
8
</classpath>

BIN
wade-mobile-common/libs/wade-mobile-func.jar


+ 1 - 1
wade-mobile-common/project.properties

@ -11,5 +11,5 @@
11 11
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 12
13 13
# Project target.
14
target=android-22
14
target=android-19
15 15
android.library=true

+ 77 - 0
wade-mobile-common/res/layout/browser.xml

@ -0,0 +1,77 @@
1
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2
    xmlns:tools="http://schemas.android.com/tools"
3
    android:layout_width="fill_parent"
4
    android:layout_height="fill_parent"
5
    android:background="#ffffff"
6
    android:orientation="vertical" >
7

8
    <LinearLayout
9
        android:layout_width="fill_parent"
10
        android:layout_height="wrap_content"
11
        android:orientation="vertical" >
12

13
        <LinearLayout
14
            android:id="@+id/layout"
15
            android:layout_width="fill_parent"
16
            android:layout_height="wrap_content"
17
            android:orientation="horizontal"
18
            android:visibility="gone" >
19

20
            <EditText
21
                android:id="@+id/et_url"
22
                android:layout_width="0dp"
23
                android:layout_height="wrap_content"
24
                android:layout_weight="1"
25
                android:inputType="textUri"
26
                android:singleLine="true" />
27

28
            <Button
29
                android:id="@+id/btn_visit"
30
                android:layout_width="wrap_content"
31
                android:layout_height="wrap_content"
32
                android:text="@string/visit" />
33
        </LinearLayout>
34

35
        <LinearLayout
36
            android:id="@+id/ll_btn"
37
            android:layout_width="fill_parent"
38
            android:layout_height="wrap_content"
39
            android:gravity="center_horizontal"
40
            android:orientation="horizontal" >
41

42
            <Button
43
                android:id="@+id/btn_home"
44
                android:layout_width="wrap_content"
45
                android:layout_height="wrap_content"
46
                android:layout_weight="1"
47
                android:text="@string/home" />
48

49
            <Button
50
                android:id="@+id/btn_left"
51
                android:layout_width="wrap_content"
52
                android:layout_height="wrap_content"
53
                android:layout_weight="1"
54
                android:text="@string/left" />
55

56
            <Button
57
                android:id="@+id/btn_right"
58
                android:layout_width="wrap_content"
59
                android:layout_height="wrap_content"
60
                android:layout_weight="1"
61
                android:text="@string/right" />
62

63
            <Button
64
                android:id="@+id/btn_exit"
65
                android:layout_width="wrap_content"
66
                android:layout_height="wrap_content"
67
                android:layout_weight="1"
68
                android:text="@string/exit" />
69
        </LinearLayout>
70

71
        <WebView
72
            android:id="@+id/web"
73
            android:layout_width="fill_parent"
74
            android:layout_height="fill_parent" />
75
    </LinearLayout>
76

77
</LinearLayout>

+ 8 - 0
wade-mobile-common/res/values/strings_browser.xml

@ -0,0 +1,8 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<resources>
3
    <string name="home">主页</string>
4
    <string name="left">后退</string>
5
    <string name="right">前进</string>
6
    <string name="exit">退出</string>
7
    <string name="visit">访问</string>
8
</resources>

BIN
wade-mobile-func/libs/wade-mobile-com.jar


+ 35 - 0
wade-mobile-func/src/com/wade/mobile/func/MobileBrowser.java

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

3
import org.json.JSONArray;
4

5
import android.content.Intent;
6
import android.os.Bundle;
7

8
import com.wade.mobile.common.browser.BrowserActivity;
9
import com.wade.mobile.frame.IWadeMobile;
10
import com.wade.mobile.frame.plugin.Plugin;
11

12
/**
13
 * 打开浏览器插件
14
 * @author wangyujuan
15
 *
16
 */
17
public class MobileBrowser extends Plugin {
18
	
19
	private int BROWSER = 90004;
20

21
	public MobileBrowser(IWadeMobile wademobile) {
22
		super(wademobile);
23
	}
24

25
	public void openIpuBrowser(JSONArray param) throws Exception {
26
		String url = param.getString(0);
27
		String hasTitle = param.getString(1);
28
		Intent intent = new Intent(context, BrowserActivity.class);
29
	    Bundle bundle=new Bundle();
30
	    bundle.putString("url", url);
31
	    bundle.putString("hasTitle", hasTitle);
32
	    intent.putExtras(bundle);
33
	    startActivityForResult(intent, BROWSER);
34
	}
35
}