an class="pull-left del"> - 0 display-server/web/biz/js/plugin/voice.js
Parādīt failu
@ -0,0 +1,23 @@
1
require(['jcl','wadeMobile'], function($,WadeMobile) {
2
	$('#voiceRecognize').on('touchstart', function() {
3
		WadeMobile.startListen();
4
	});
5

6
	$('#voiceRecognize').on('touchend', function() {
7
		WadeMobile.endListen(function(val){
8
			$('#voiceText').text(val);
9
		});
10
	});
11
	
12
	$('#voiceRecognize').on('touchcancel', function() {
13
		WadeMobile.endListen(function(val){
14
			$('#voiceText').text(val);
15
		});
16
	});
17
	
18

19
	$('#vocicSynthesize').on('touchend', function() {
20
		WadeMobile.voiceSpeak($('#synthesize-content').val());
21
	});
22

23
});

+ 111 - 0
display-server/web/biz/js/ui/hammer.js

@ -0,0 +1,111 @@
1
require([ "domReady!", "mobile", "hammer", "jquery", "util" ], function(doc, Mobile, Hammer, jQuery) {
2
	new iScroll("content");
3
	
4
	// rotate
5
	var rotateHam = new Hammer($(".rotate")[0], {
6
		domEvents : true
7
	});
8
	var liveScale = 1;
9
	var currentRotation = 0;
10
	rotateHam.get('rotate').set({
11
		enable : true
12
	});
13
	jQuery(".rotate").on("rotate",function(e) {
14
		var rotation = currentRotation + Math.round(liveScale* e.originalEvent.gesture.rotation);
15
		jQuery(this).find("img").css("transform", "rotate( " + rotation + "deg)");
16
	});
17
	jQuery(".rotate").on("rotateend", function(e) {
18
		currentRotation += Math.round(e.originalEvent.gesture.rotation);
19
	});
20

21
	// pinch
22
    var pinchHam = new Hammer($(".pinch")[0], {
23
    	domEvents : true
24
	});
25
	var width = 1900;
26
	var height = 400;
27
	var left = 950;
28
	var top = 220;
29
	pinchHam.get('pinch').set({
30
		enable : true
31
	});
32
	jQuery(".pinch").on("pinch", function(e) {
33
		if (width * e.originalEvent.gesture.scale >= 300) {
34
			jQuery(this).find("img").css({
35
				width : width * e.originalEvent.gesture.scale,
36
				"margin-left" : -left * e.originalEvent.gesture.scale,
37
				height : height * e.originalEvent.gesture.scale,
38
				"margin-top" : -top * e.originalEvent.gesture.scale
39
			});
40
		}
41
		console.log(e.originalEvent.gesture.scale);
42
	});
43
	jQuery(".pinch").on("pinchend", function(e) {
44
		width = width * e.originalEvent.gesture.scale;
45
		height = height * e.originalEvent.gesture.scale;
46
		left = left * e.originalEvent.gesture.scale;
47
		top = top * e.originalEvent.gesture.scale;
48
		console.log(width);
49
	});
50
	
51
	// press
52
	new Hammer($( ".press")[0], {
53
      domEvents: true
54
    });
55
    $(".press").on("press", function(e) {
56
       $(".demo-overlay").toggle();
57
    });
58
    
59
    // pan
60
	var panImg, panMargin;
61
	new Hammer($(".pan")[0], {
62
		domEvents : true
63
	});
64
	jQuery(".pan").on("panstart", function(e) {
65
		panImg = $(".pan img");
66
		panMargin = parseInt(panImg.css("margin-left"), 10);
67
	});
68
	jQuery(".pan").on("pan", function(e) {
69
		console.log("pan");
70
		var delta = panMargin + e.originalEvent.gesture.deltaX;
71
		console.log(delta);
72
		if (delta >= -1750 && delta <= -150) {
73
			panImg.css({"margin-left" : panMargin + e.originalEvent.gesture.deltaX});
74
		}
75
	});
76
    
77
    // tap
78
	new Hammer($(".tap")[0], {
79
		domEvents : true
80
	});
81
	var tapCurrent = 0;
82
	var tapImgs = $(".demo-box.tap img");
83
	$(".tap").on("tap", function(e) {
84
		if (tapImgs[tapCurrent + 1]) {
85
			tapCurrent++;
86
		} else {
87
			tapCurrent = 0;
88
		}
89
		tapImgs.removeClass("active");
90
		tapImgs.eq(tapCurrent).addClass("active");
91
	});
92
	
93
	// swipe
94
	new Hammer($(".swipe")[0], {
95
		domEvents : true
96
	});
97
	var swipeCurrent = 0;
98
	var swipeImgs = $(".demo-box.swipe img");
99
	$(".swipe").on("swipeleft", function(e) {
100
		if (swipeImgs[swipeCurrent + 1]) {
101
			swipeImgs.removeClass("active");
102
			swipeImgs.eq(++swipeCurrent).addClass("active");
103
		}
104
	});
105
	$(".swipe").on("swiperight", function(e) {
106
		if (swipeImgs[swipeCurrent - 1]) {
107
			swipeImgs.removeClass("active");
108
			swipeImgs.eq(--swipeCurrent).addClass("active");
109
		}
110
	});
111
});

+ 64 - 0
display-server/web/template/webapp/plugin/Voice.html

@ -0,0 +1,64 @@
1
<!DOCTYPE HTML>
2
<html class="s_bs">
3
<head>
4
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
	<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1" />
6
	<title>语音</title>
7
	{%>template/common/Head.html%}
8
	<script type="text/javascript" src="biz/js/plugin/voice.js"></script>
9
<style>
10
.no-border {
11
	border: 0;
12
}
13
</style>
14
</head>
15
<body>
16
17
<div class="c_navBar">
18
	<div class="left">
19
		<div class="back">
20
			<span class="e_ico-back"></span>
21
			<span class="text">语音</span>
22
		</div>
23
	</div>
24
</div>
25
26
<div class="m_content m_content-nofooter" id="content" >
27
<div>
28
	<div class="c_title">语音识别</div>
29
	<div class="c_list">
30
		<ul>
31
			<li>
32
				<div class="content">
33
					<div class="main">
34
						<div class="title">语音识别</div>
35
						<div class="info">单击语音识别,录制一段语音</div>
36
					</div>
37
					<div class="fn fn-2" id="voiceRecognize">语音识别</div>
38
				</div>
39
			</li>
40
			<li ontap=";">
41
				<div class="content">
42
					<div class="main" id="voiceText">&nbsp;</div>
43
				</div>
44
			</li>
45
		</ul>
46
	</div>
47
	<div class="c_title">语音合成</div>
48
	<div class="c_list">
49
		<ul>
50
			<li>
51
				<div class="content">
52
					<div class="main">
53
						<input type="text" placeholder="请输入语音内容" id="synthesize-content" class="no-border">
54
					</div>
55
					<div class="fn fn-2" id="vocicSynthesize">语音合成</div>
56
				</div>
57
			</li>
58
		</ul>
59
	</div>
60
</div>
61
</div>
62
63
</body>
64
</html>

+ 191 - 0
display-server/web/template/webapp/ui/Hammer.html

@ -0,0 +1,191 @@
1
<!DOCTYPE HTML>
2
<html class="s_bs">
3
<head>
4
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1" />
6
<title>Hammer</title>
7
{%>template/common/Head.html%}
8
<script type="text/javascript" src="biz/js/ui/hammer.js"></script>
9
</head>
10
<style type="text/css">
11
.hammer-wrap {
12
	text-align: center;
13
	margin-top: 0.22rem;
14
}
15
.hammer-wrap .hammer-icon {
16
	width: 1rem;
17
}
18
.hammer-wrap h1 {
19
	margin-top: 0.22rem;
20
}
21
.hammer-wrap h2 {
22
	font-weight: normal;
23
    line-height: 1.4;
24
}
25
.demo-box-wrap {
26
  border: 1px solid #333;
27
  /* font-family: sans-serif; */
28
  background: #333;
29
  text-align: center;
30
  color: white;
31
  width: 302px;
32
  margin-left: auto;
33
  margin-right: auto;
34
  margin-bottom: 3em;
35
}
36
.demo-box-wrap .demo-box {
37
  width: 300px;
38
  height: 200px;
39
  overflow: hidden;
40
  position: relative;
41
}
42
.demo-box-wrap .demo-box > img {
43
  height: 400px;
44
  width: 1900px;
45
  position: absolute;
46
  margin-left: -950px;
47
  display: none;
48
  pointer-events: none;
49
  margin-top: -220px;
50
  left: 50%;
51
  top: 50%;
52
  max-width: none;
53
}
54
.demo-box-wrap h2 {
55
  pointer-events: none;
56
  color: white;
57
}
58
.demo-box-wrap .demo-box img.active {
59
  display: block;
60
}
61
.demo-overlay {
62
    position: absolute;
63
    top: 0;
64
    left: 0;
65
    right: 0;
66
    bottom: 0;
67
    background: rgba(70, 70, 70, 0.8);
68
    display: none;
69
}
70
.demo-overlay img {
71
    width: 50px;
72
    height: 50px;
73
    position: absolute;
74
    top: 50%;
75
    left: 50%;
76
    margin-left: -25px;
77
    margin-top: -25px;
78
}
79
</style>
80
<body>
81
<div class="c_navBar">
82
	<div class="left">
83
		<div class="back">
84
			<span class="e_ico-back"></span><span class="text">手势</span>
85
		</div>
86
	</div>
87
</div>
88

89
<div class="m_content" id="content">
90
<div>
91
	<div class="hammer-wrap">
92
		<img src="biz/img/plugin/hammer/tap.png" class="hammer-icon">
93
		<h1>Try it!</h1>
94
		<h2 class="desc">你可以尝试单点图片,实现图片的切换</h2>
95
		<div class="row">
96
			<div class="column large-4 medium-6 small-12">
97
				<div class="demo-box-wrap">
98
					<h2>单点</h2>
99
					<div class="demo-box tap" style="touch-action: pan-y; -webkit-user-select: none; -webkit-user-drag: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);">
100
						<img class="active" src="biz/img/plugin/hammer/pano_1.jpg">
101
						<img src="biz/img/plugin/hammer/pano_2.jpg">
102
						<img src="biz/img/plugin/hammer/pano_3.jpg">
103
					</div>
104
				</div>
105
			</div>
106
		</div>
107
	</div>
108
	<div class="hammer-wrap">
109
		<img src="biz/img/plugin/hammer/press.png" class="hammer-icon">
110
		<h1>Try it!</h1>
111
		<h2 class="desc">您可以尝试按住图片,选中图片/取消选中</h2>
112
		<div class="row">
113
			<div class="column large-4 medium-6 small-12">
114
				<div class="demo-box-wrap">
115
				  	<h2>按住</h2>
116
					<div class="demo-box press" style="touch-action: pan-y; -webkit-user-select: none; -webkit-user-drag: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);">
117
						<img class="active" src="biz/img/plugin/hammer/pano_1.jpg">
118
					 	<div class="demo-overlay">
119
							<img src="biz/img/plugin/hammer/circle-check.svg">
120
						</div>
121
					</div>
122
				</div>
123
			</div>
124
		</div>
125
	</div>
126
	<div class="hammer-wrap">
127
		<img src="biz/img/plugin/hammer/pan.png" class="hammer-icon">
128
		<h1>Try it!</h1>
129
		<h2 class="desc">您可以尝试平移图片,查看图片更多</h2>
130
		<div class="row">
131
			<div class="column large-4 medium-6 small-12">
132
				<div class="demo-box-wrap">
133
					<h2>平移</h2>
134
					<div class="demo-box pan" style="touch-action: pan-y; -webkit-user-select: none; -webkit-user-drag: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);">
135
						<img class="active" src="biz/img/plugin/hammer/pano_1.jpg">
136
					</div>
137
				</div>
138
			</div>
139
		</div>
140
	</div>
141
	<div class="hammer-wrap">
142
		<img src="biz/img/plugin/hammer/swipe.png" class="hammer-icon">
143
		<h1>Try it!</h1>
144
		<h2 class="desc">您可以尝试左右滑动,实现图片的切换</h2>
145
		<div class="row">
146
			<div class="column large-4 medium-6 small-12">
147
				<div class="demo-box-wrap">
148
					<h2>滑动</h2>
149
					<div class="demo-box swipe" style="touch-action: pan-y; -webkit-user-select: none; -webkit-user-drag: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);">
150
						<img class="active" src="biz/img/plugin/hammer/pano_1.jpg">
151
						<img src="biz/img/plugin/hammer/pano_2.jpg">
152
						<img src="biz/img/plugin/hammer/pano_3.jpg">
153
					</div>
154
				</div>
155
			</div>
156
		</div>
157
	</div>
158
	<div class="hammer-wrap">
159
		<img src="biz/img/plugin/hammer/rotate.png" class="hammer-icon">
160
		<h1>Try it!</h1>
161
		<h2 class="desc">您可以尝试旋转,实现图片的旋转</h2>
162
		<div class="row">
163
			<div class="column large-4 medium-6 small-12">
164
				<div class="demo-box-wrap">
165
					<h2>旋转</h2>
166
					<div class="demo-box rotate" style="touch-action: none; -webkit-user-select: none; -webkit-user-drag: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);">
167
						<img class="active" src="biz/img/plugin/hammer/pano_1.jpg" style="transform: rotate(-2deg);">
168
					</div>
169
				</div>
170
			</div>
171
		</div>
172
	</div>
173
	<div class="hammer-wrap">
174
		<img src="biz/img/plugin/hammer/pinch.png" class="hammer-icon">
175
		<h1>Try it!</h1>
176
		<h2 class="desc">您可以尝试捏放,实现图片的放大/缩小</h2>
177
		<div class="row">
178
			<div class="column large-4 medium-6 small-12">
179
				<div class="demo-box-wrap">
180
					<h2>捏放</h2>
181
					<div class="demo-box pinch" style="touch-action: none; -webkit-user-select: none; -webkit-user-drag: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);">
182
						<img class="active" src="biz/img/plugin/hammer/pano_1.jpg" style="width: 2269.85px; margin-left: -1134.93px; height: 477.864px; margin-top: -262.825px;">
183
					</div>
184
				</div>
185
			</div>
186
		</div>
187
	</div>
188
</div>
189
</div>
190
</body>
191
</html>

android-share - Nuosi Git Service

ipu的trunk版的android工程和服务端工程。

wangkang3 bd8dd01639 SONAR扫描问题 лет назад: 4
..
assets bd8dd01639 SONAR扫描问题 лет назад: 4
build 6af9355106 PathMenu代码优化,相机部分功能优化 лет назад: 8
res c2152d0bec pathmenu时间变更0.3s&& 图标变更 лет назад: 8
src 206657ea5e 解决sonar违规 лет назад: 4
.classpath 9753ad45b9 重置工程配置文件 лет назад: 6
.gitignore 6b4c5954d2 发布自建推送平台内容 лет назад: 9
.project 22bd19543c 初始化 лет назад: 10
AndroidManifest.xml a1d5a8bdc2 更新高德地图key лет назад: 7
clean-res.cmd 22bd19543c 初始化 лет назад: 10
display.keystore 25828ea66a 1 лет назад: 9
mac.bak.classpath 3f37a33a95 mac.classpath保留 —— 别删除了啊 лет назад: 9
proguard-project.txt b9d1e6f325 修改proguard配置 лет назад: 5
project.properties 34a58b5204 依赖ipu-mobile-xxx而非wade-mobile-xxx лет назад: 7
工程依赖说明.txt 4d1867f6b4 ceshi лет назад: 8