Skip to content

Commit c2d57e2

Browse files
committed
Merge branch 'dev' of github.com:alibaba/weex into doc
2 parents cf5deff + 7447fcc commit c2d57e2

File tree

1,117 files changed

+36907
-61357
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,117 files changed

+36907
-61357
lines changed

.eslintignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# do not lint test case source files
2+
html5/test/case/*/*.source.js
3+
html5/test/case/*/*.output.js

.eslintrc

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"window": false,
1717
"location": false,
1818
"callNative": false,
19+
"callAddElement":false,
1920
"callJS": false
2021
},
2122

.gitignore

+9-3
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,16 @@ pids
2222
*.pid
2323
*.seed
2424

25-
# build framework options by script
26-
html5/runtime/config.js
27-
2825
# e2e test
2926
html5/test/e2e/reports
3027
html5/test/e2e/screenshots
3128
html5/test/e2e/logs
29+
30+
# Created by Weex Web Packer
31+
html5/browser/extend/packer.js
32+
html5/render/browser/extend/packer.js
33+
34+
android/playground/app/gradlew
35+
android/playground/app/gradlew.bat
36+
android/playground/app/gradle/wrapper/gradle-wrapper.jar
37+
android/playground/app/gradle/wrapper/gradle-wrapper.properties

.wwprc

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"componentsPath": "./html5/render/browser/extend/components",
3+
"apisPath": "./html5/render/browser/extend/api",
4+
"loadersPath": "./html5/render/browser/extend/loader",
5+
"packer": "./html5/render/browser/extend/packer.js",
6+
"components": [
7+
"image",
8+
"text",
9+
"scrollable",
10+
"slider",
11+
"indicator",
12+
"tabheader",
13+
"input",
14+
"textarea",
15+
"video",
16+
"switch",
17+
"a",
18+
"embed",
19+
"spinner",
20+
"web"
21+
],
22+
"apis": [
23+
"animation",
24+
"clipboard",
25+
"dom",
26+
"event",
27+
"geolocation",
28+
"globalEvent",
29+
"modal",
30+
"navigator",
31+
"pageInfo",
32+
"storage",
33+
"stream",
34+
"webview"
35+
]
36+
}

README.md

+19-15
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,37 @@
1-
# Weex
1+
# Weex
2+
Android[![Download](https://api.bintray.com/packages/alibabaweex/maven/weex_sdk/images/download.svg)](https://bintray.com/alibabaweex/maven/weex_sdk/_latestVersion)
3+
iOS[![Pod version](https://badge.fury.io/co/WeexSDK.svg)](https://cocoapods.org/pods/WeexSDK)
4+
HTML5[![npm version](https://badge.fury.io/js/weex-html5.svg)](https://www.npmjs.com/package/weex-html5)
25

36
> A framework for building Mobile cross-platform UI.
47
58
[![CircleCI](https://circleci.com/gh/alibaba/weex/tree/dev.svg?style=svg&circle-token=b83b047a3a01f6ec26458a455530a5ddc261925f)](https://circleci.com/gh/alibaba/weex/tree/dev) [![Gitter](https://img.shields.io/gitter/room/weexteam/cn.svg?maxAge=2592000)](https://gitter.im/weexteam) <sub>(English Gitter)</sub> [![Gitter](https://img.shields.io/gitter/room/weexteam/cn.svg?maxAge=2592000)](https://gitter.im/weexteam/cn) <sub>(Chinese 中文聊天室)</sub>
69

7-
Support Android 4.1 (API 16) and iOS 7.0+. See [Weex website](http://alibaba.github.io/weex/) for more information.
10+
Support Android 4.1 (API 16) and iOS 7.0+. See [Weex website](https://alibaba.github.io/weex/) for more information.
811

912
## For Windows
1013

1114
Please ***INSTALL [Git for Windows](https://git-scm.com/download/win)*** and run all the following commands in git-bash.
1215

1316
## Meet Weex
1417

15-
* Install [Weex Playground App](http://alibaba.github.io/weex/download.html) to see examples we already written.
18+
* Install [Weex Playground App](https://alibaba.github.io/weex/download.html) to see examples we already written.
1619
* If you want to write a demo, install [weex-toolkit](https://www.npmjs.com/package/weex-toolkit) in [Node.js](http://nodejs.org/) 4.0+ and
1720
* Run `weex init` to generate & start a simple project in an empty folder.
1821
* Follow the instructions in the project README.
1922
* Enjoy it.
2023

2124
## Use Weex
2225

23-
* [Tutorial](http://alibaba.github.io/weex/doc/tutorial.html)
24-
* Doc: [English](http://alibaba.github.io/weex/doc/), [中文](https://github.com/weexteam/article/wiki/Weex%E4%B8%AD%E6%96%87%E6%96%87%E6%A1%A3)
26+
* [Tutorial](https://alibaba.github.io/weex/doc/tutorial.html)
27+
* Doc: [English](https://alibaba.github.io/weex/doc/), [中文](https://github.com/weexteam/article/wiki/Weex%E4%B8%AD%E6%96%87%E6%96%87%E6%A1%A3)
2528

26-
### Android
29+
### Android
2730

2831
0. Prerequisites
2932
0. Install [Node.js](http://nodejs.org/) 4.0+
30-
0. Under project root
31-
0. `npm install`, install project
33+
0. Under project root
34+
0. `npm install`, install project
3235
0. `./start`
3336
0. Install [Android Environment](http://developer.android.com/training/basics/firstapp/index.html)
3437
0. Run playground, In Android Studio
@@ -46,8 +49,8 @@ On Android Platform , Weex code is executed in [weex_v8core](https://github.com/
4649

4750
0. Prerequisites
4851
0. Install [Node.js](http://nodejs.org/) 4.0+
49-
0. Under project root
50-
0. `npm install`, install project
52+
0. Under project root
53+
0. `npm install`, install project
5154
0. `./start`
5255
0. Install [iOS Environment](https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppStoreDistributionTutorial/Setup/Setup.html)
5356
0. Install [CocoaPods](https://guides.cocoapods.org/using/getting-started.html)
@@ -64,16 +67,18 @@ On Android Platform , Weex code is executed in [weex_v8core](https://github.com/
6467
See [SCRIPTS.md](./SCRIPTS.md) for more information.
6568

6669

67-
## IDE Plugin & Syntax Highlight
70+
## IDE Plugin & Syntax Highlight & DevTool
6871

69-
See [Weex Community](https://github.com/alibaba/weex/wiki/Weex-Community) Wiki page
72+
See [Weex Community](https://github.com/alibaba/weex/wiki/Weex-Community) Wiki page
73+
74+
Weex team have developed a [DevTool](https://github.com/weexteam/weex-devtool) to help you to improve `we file` debug efficiency.
7075

7176
## FAQ
7277

73-
See [FAQ](http://alibaba.github.io/weex/doc/faq.html) for more information.
78+
See [FAQ](https://alibaba.github.io/weex/doc/faq.html) for more information.
7479

7580

76-
### Community based Weex knowledge site
81+
### Community based Weex knowledge site
7782

7883
* [weex article](https://github.com/weexteam/article/wiki) : article collection about Weex(文章集合)
7984
* [weex.help](http://weex.help/) : 3rd forum about Weex(第三方Weex中文技术论坛)
@@ -82,4 +87,3 @@ See [FAQ](http://alibaba.github.io/weex/doc/faq.html) for more information.
8287
## Contributing
8388

8489
See [Weex Contributing Guide](./CONTRIBUTING.md) for more information.
85-

android/commons/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ dependencies {
4949
compile 'com.squareup.picasso:picasso:2.5.2'
5050
compile 'com.facebook.fresco:fresco:0.10.0'
5151

52+
provided 'com.taobao.android:weex_analyzer:0.1.0.5'
5253

5354
testCompile 'junit:junit:4.12'
5455
testCompile 'org.hamcrest:hamcrest-core:1.3'

android/commons/src/main/java/com/alibaba/weex/commons/AbstractWeexActivity.java

+50
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,10 @@
206206

207207
import android.graphics.Rect;
208208
import android.os.Bundle;
209+
import android.support.annotation.CallSuper;
209210
import android.support.annotation.Nullable;
210211
import android.support.v7.app.AppCompatActivity;
212+
import android.view.KeyEvent;
211213
import android.view.View;
212214
import android.view.ViewGroup;
213215
import com.alibaba.weex.commons.util.ScreenUtil;
@@ -228,11 +230,15 @@ public abstract class AbstractWeexActivity extends AppCompatActivity implements
228230
private ViewGroup mContainer;
229231
private WXSDKInstance mInstance;
230232

233+
protected WXAnalyzerDelegate mWxAnalyzerDelegate;
234+
231235
@Override
232236
protected void onCreate(@Nullable Bundle savedInstanceState) {
233237
super.onCreate(savedInstanceState);
234238
createWeexInstance();
235239
mInstance.onActivityCreate();
240+
mWxAnalyzerDelegate = new WXAnalyzerDelegate(this);
241+
mWxAnalyzerDelegate.onCreate();
236242
}
237243

238244
protected final void setContainer(ViewGroup container){
@@ -307,6 +313,9 @@ public void onStart() {
307313
if(mInstance!=null){
308314
mInstance.onActivityStart();
309315
}
316+
if(mWxAnalyzerDelegate != null){
317+
mWxAnalyzerDelegate.onStart();
318+
}
310319
}
311320

312321
@Override
@@ -315,6 +324,9 @@ public void onResume() {
315324
if(mInstance!=null){
316325
mInstance.onActivityResume();
317326
}
327+
if(mWxAnalyzerDelegate != null){
328+
mWxAnalyzerDelegate.onResume();
329+
}
318330
}
319331

320332
@Override
@@ -323,6 +335,9 @@ public void onPause() {
323335
if(mInstance!=null){
324336
mInstance.onActivityPause();
325337
}
338+
if(mWxAnalyzerDelegate != null){
339+
mWxAnalyzerDelegate.onPause();
340+
}
326341
}
327342

328343
@Override
@@ -331,6 +346,9 @@ public void onStop() {
331346
if(mInstance!=null){
332347
mInstance.onActivityStop();
333348
}
349+
if(mWxAnalyzerDelegate != null){
350+
mWxAnalyzerDelegate.onStop();
351+
}
334352
}
335353

336354
@Override
@@ -339,10 +357,20 @@ public void onDestroy() {
339357
if(mInstance!=null){
340358
mInstance.onActivityDestroy();
341359
}
360+
if(mWxAnalyzerDelegate != null){
361+
mWxAnalyzerDelegate.onDestroy();
362+
}
342363
}
343364

344365
@Override
345366
public void onViewCreated(WXSDKInstance wxsdkInstance, View view) {
367+
View wrappedView = null;
368+
if(mWxAnalyzerDelegate != null){
369+
wrappedView = mWxAnalyzerDelegate.onWeexViewCreated(wxsdkInstance,view);
370+
}
371+
if(wrappedView != null){
372+
view = wrappedView;
373+
}
346374
if (mContainer != null) {
347375
mContainer.removeAllViews();
348376
mContainer.addView(view);
@@ -355,4 +383,26 @@ public void onViewCreated(WXSDKInstance wxsdkInstance, View view) {
355383
public void onRefreshSuccess(WXSDKInstance wxsdkInstance, int i, int i1) {
356384

357385
}
386+
387+
@Override
388+
@CallSuper
389+
public void onRenderSuccess(WXSDKInstance instance, int width, int height) {
390+
if(mWxAnalyzerDelegate != null){
391+
mWxAnalyzerDelegate.onWeexRenderSuccess(instance);
392+
}
393+
}
394+
395+
@Override
396+
@CallSuper
397+
public void onException(WXSDKInstance instance, String errCode, String msg) {
398+
if(mWxAnalyzerDelegate != null){
399+
mWxAnalyzerDelegate.onException(instance,errCode,msg);
400+
}
401+
}
402+
403+
@Override
404+
@CallSuper
405+
public boolean onKeyUp(int keyCode, KeyEvent event) {
406+
return (mWxAnalyzerDelegate != null && mWxAnalyzerDelegate.onKeyUp(keyCode,event)) || super.onKeyUp(keyCode, event);
407+
}
358408
}

android/commons/src/main/java/com/alibaba/weex/commons/SimpleWeexActivity.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,11 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
223223

224224
@Override
225225
public void onRenderSuccess(WXSDKInstance instance, int width, int height) {
226-
226+
super.onRenderSuccess(instance,width,height);
227227
}
228228

229229
@Override
230230
public void onException(WXSDKInstance instance, String errCode, String msg) {
231-
231+
super.onException(instance,errCode,msg);
232232
}
233233
}

0 commit comments

Comments
 (0)