Skip to content

Commit

Permalink
Merge branch 'dev' into html5
Browse files Browse the repository at this point in the history
  • Loading branch information
MrRaindrop committed Aug 10, 2016
2 parents b847c4b + 020507b commit e29ab7e
Showing 381 changed files with 21,080 additions and 8,986 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -59,6 +59,11 @@ On Android Platform , Weex code is executed in [weex_v8core](https://github.com/

See [SCRIPTS.md](./SCRIPTS.md) for more information.


## IDE Plugin & Syntax Highlight

See [Weex Community](https://github.com/alibaba/weex/wiki/Weex-Community) Wiki page

## FAQ

See [FAQ](http://alibaba.github.io/weex/doc/faq.html) for more information.
@@ -74,4 +79,3 @@ See [FAQ](http://alibaba.github.io/weex/doc/faq.html) for more information.

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


Original file line number Diff line number Diff line change
@@ -204,9 +204,11 @@
*/
package com.alibaba.weex.commons.adapter;

import android.net.Uri;
import android.text.TextUtils;
import android.widget.ImageView;

import com.squareup.picasso.Callback;
import com.squareup.picasso.Picasso;
import com.taobao.weex.WXEnvironment;
import com.taobao.weex.WXSDKManager;
@@ -221,7 +223,7 @@ public ImageAdapter() {

@Override
public void setImage(final String url, final ImageView view,
WXImageQuality quality, WXImageStrategy strategy) {
WXImageQuality quality, final WXImageStrategy strategy) {

WXSDKManager.getInstance().postOnUiThread(new Runnable() {

@@ -241,9 +243,38 @@ public void run() {
if (view.getLayoutParams().width <= 0 || view.getLayoutParams().height <= 0) {
return;
}


if(!TextUtils.isEmpty(strategy.placeHolder)){
Picasso.Builder builder=new Picasso.Builder(WXEnvironment.getApplication());
Picasso picasso=builder.build();
picasso.load(Uri.parse(strategy.placeHolder)).into(view);

view.setTag(strategy.placeHolder.hashCode(),picasso);
}


Picasso.with(WXEnvironment.getApplication())
.load(temp)
.into(view);
.into(view, new Callback() {
@Override
public void onSuccess() {
if(strategy.getImageListener()!=null){
strategy.getImageListener().onImageFinish(url,view,true,null);
}

if(!TextUtils.isEmpty(strategy.placeHolder)){
((Picasso) view.getTag(strategy.placeHolder.hashCode())).cancelRequest(view);
}
}

@Override
public void onError() {
if(strategy.getImageListener()!=null){
strategy.getImageListener().onImageFinish(url,view,false,null);
}
}
});
}
},0);
}
Original file line number Diff line number Diff line change
@@ -27,6 +27,24 @@ public WxDebug() {

}

@ChromeDevtoolsMethod
public void enable(JsonRpcPeer peer, JSONObject params) {
Context context = WXEnvironment.getApplication();
if (context != null) {
WXSDKEngine.reload(context, true);
context.sendBroadcast(new Intent(IWXDebugProxy.ACTION_DEBUG_INSTANCE_REFRESH));
}
}

@ChromeDevtoolsMethod
public void disable(JsonRpcPeer peer, JSONObject params) {
Context context = WXEnvironment.getApplication();
if (context != null) {
WXSDKEngine.reload(context, false);
context.sendBroadcast(new Intent(IWXDebugProxy.ACTION_DEBUG_INSTANCE_REFRESH));
}
}

@ChromeDevtoolsMethod
public void callNative(JsonRpcPeer peer, JSONObject params) {
if (params != null) {
1 change: 0 additions & 1 deletion android/playground/app/build.gradle
Original file line number Diff line number Diff line change
@@ -12,7 +12,6 @@ android {
versionName "0.5.2.2"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
ndk{
abiFilters "armeabi-v7a"
abiFilters "x86"
abiFilters "armeabi"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.alibaba.weex.uitest.TC_AG;
import com.alibaba.weex.WXPageActivity;
import com.alibaba.weex.util.TestFlow;
import java.util.HashMap;
import org.junit.Before;
import org.junit.Test;

public class AG_AHref_A_Href extends TestFlow {
public AG_AHref_A_Href() {
super(WXPageActivity.class);
}

@Before
public void setUp() throws InterruptedException {
super.setUp();
HashMap testMap = new <String, Object> HashMap();
testMap.put("testComponet", "AG_AHref");
testMap.put("testChildCaseInit", "AG_AHref_A_Href");
testMap.put("step1",new HashMap(){
{
put("click", "href0");
put("screenshot", "AG_AHref_A_Href_01_href0");
}
});
testMap.put("step2",new HashMap(){
{
put("click", "href1");
put("screenshot", "AG_AHref_A_Href_02_href1");
}
});
super.setTestMap(testMap);
}

@Test
public void doTest(){
super.testByTestMap();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.alibaba.weex.uitest.TC_AG;
import com.alibaba.weex.WXPageActivity;
import com.alibaba.weex.util.TestFlow;
import java.util.HashMap;
import org.junit.Before;
import org.junit.Test;

public class AG_Border_A_Border_Bottom_Color extends TestFlow {
public AG_Border_A_Border_Bottom_Color() {
super(WXPageActivity.class);
}

@Before
public void setUp() throws InterruptedException {
super.setUp();
HashMap testMap = new <String, Object> HashMap();
testMap.put("testComponet", "AG_Border");
testMap.put("testChildCaseInit", "AG_Border_A_Border_Bottom_Color");
testMap.put("step1",new HashMap(){
{
put("click", "#FF0000");
put("screenshot", "AG_Border_A_Border_Bottom_Color_01_#FF0000");
}
});
testMap.put("step2",new HashMap(){
{
put("click", "#00FFFF");
put("screenshot", "AG_Border_A_Border_Bottom_Color_02_#00FFFF");
}
});
super.setTestMap(testMap);
}

@Test
public void doTest(){
super.testByTestMap();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.alibaba.weex.uitest.TC_AG;
import com.alibaba.weex.WXPageActivity;
import com.alibaba.weex.util.TestFlow;
import java.util.HashMap;
import org.junit.Before;
import org.junit.Test;

public class AG_Border_A_Border_Bottom_Left_Radius extends TestFlow {
public AG_Border_A_Border_Bottom_Left_Radius() {
super(WXPageActivity.class);
}

@Before
public void setUp() throws InterruptedException {
super.setUp();
HashMap testMap = new <String, Object> HashMap();
testMap.put("testComponet", "AG_Border");
testMap.put("testChildCaseInit", "AG_Border_A_Border_Bottom_Left_Radius");
testMap.put("step1",new HashMap(){
{
put("click", "10");
put("screenshot", "AG_Border_A_Border_Bottom_Left_Radius_01_10");
}
});
testMap.put("step2",new HashMap(){
{
put("click", "20");
put("screenshot", "AG_Border_A_Border_Bottom_Left_Radius_02_20");
}
});
super.setTestMap(testMap);
}

@Test
public void doTest(){
super.testByTestMap();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.alibaba.weex.uitest.TC_AG;
import com.alibaba.weex.WXPageActivity;
import com.alibaba.weex.util.TestFlow;
import java.util.HashMap;
import org.junit.Before;
import org.junit.Test;

public class AG_Border_A_Border_Bottom_Right_Radius extends TestFlow {
public AG_Border_A_Border_Bottom_Right_Radius() {
super(WXPageActivity.class);
}

@Before
public void setUp() throws InterruptedException {
super.setUp();
HashMap testMap = new <String, Object> HashMap();
testMap.put("testComponet", "AG_Border");
testMap.put("testChildCaseInit", "AG_Border_A_Border_Bottom_Right_Radius");
testMap.put("step1",new HashMap(){
{
put("click", "10");
put("screenshot", "AG_Border_A_Border_Bottom_Right_Radius_01_10");
}
});
testMap.put("step2",new HashMap(){
{
put("click", "20");
put("screenshot", "AG_Border_A_Border_Bottom_Right_Radius_02_20");
}
});
super.setTestMap(testMap);
}

@Test
public void doTest(){
super.testByTestMap();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package com.alibaba.weex.uitest.TC_AG;
import com.alibaba.weex.WXPageActivity;
import com.alibaba.weex.util.TestFlow;
import java.util.HashMap;
import org.junit.Before;
import org.junit.Test;

public class AG_Border_A_Border_Bottom_Width extends TestFlow {
public AG_Border_A_Border_Bottom_Width() {
super(WXPageActivity.class);
}

@Before
public void setUp() throws InterruptedException {
super.setUp();
HashMap testMap = new <String, Object> HashMap();
testMap.put("testComponet", "AG_Border");
testMap.put("testChildCaseInit", "AG_Border_A_Border_Bottom_Width");
testMap.put("step1",new HashMap(){
{
put("click", "0");
put("screenshot", "AG_Border_A_Border_Bottom_Width_01_0");
}
});
testMap.put("step2",new HashMap(){
{
put("click", "1");
put("screenshot", "AG_Border_A_Border_Bottom_Width_02_1");
}
});
testMap.put("step3",new HashMap(){
{
put("click", "3");
put("screenshot", "AG_Border_A_Border_Bottom_Width_03_3");
}
});
super.setTestMap(testMap);
}

@Test
public void doTest(){
super.testByTestMap();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.alibaba.weex.uitest.TC_AG;
import com.alibaba.weex.WXPageActivity;
import com.alibaba.weex.util.TestFlow;
import java.util.HashMap;
import org.junit.Before;
import org.junit.Test;

public class AG_Border_A_Border_Color extends TestFlow {
public AG_Border_A_Border_Color() {
super(WXPageActivity.class);
}

@Before
public void setUp() throws InterruptedException {
super.setUp();
HashMap testMap = new <String, Object> HashMap();
testMap.put("testComponet", "AG_Border");
testMap.put("testChildCaseInit", "AG_Border_A_Border_Color");
testMap.put("step1",new HashMap(){
{
put("click", "#FF0000");
put("screenshot", "AG_Border_A_Border_Color_01_#FF0000");
}
});
testMap.put("step2",new HashMap(){
{
put("click", "#00FFFF");
put("screenshot", "AG_Border_A_Border_Color_02_#00FFFF");
}
});
super.setTestMap(testMap);
}

@Test
public void doTest(){
super.testByTestMap();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.alibaba.weex.uitest.TC_AG;
import com.alibaba.weex.WXPageActivity;
import com.alibaba.weex.util.TestFlow;
import java.util.HashMap;
import org.junit.Before;
import org.junit.Test;

public class AG_Border_A_Border_Left_Color extends TestFlow {
public AG_Border_A_Border_Left_Color() {
super(WXPageActivity.class);
}

@Before
public void setUp() throws InterruptedException {
super.setUp();
HashMap testMap = new <String, Object> HashMap();
testMap.put("testComponet", "AG_Border");
testMap.put("testChildCaseInit", "AG_Border_A_Border_Left_Color");
testMap.put("step1",new HashMap(){
{
put("click", "#FF0000");
put("screenshot", "AG_Border_A_Border_Left_Color_01_#FF0000");
}
});
testMap.put("step2",new HashMap(){
{
put("click", "#00FFFF");
put("screenshot", "AG_Border_A_Border_Left_Color_02_#00FFFF");
}
});
super.setTestMap(testMap);
}

@Test
public void doTest(){
super.testByTestMap();
}

}
Loading

0 comments on commit e29ab7e

Please sign in to comment.