forked from apache/incubator-weex
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'github/master' into develop-data-render…
…-script
- Loading branch information
Showing
338 changed files
with
2,902 additions
and
38,193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
name: Bug report | ||
about: Report a reproducible bug in the Weex library. | ||
|
||
--- | ||
|
||
<!-- | ||
Thanks for using Weex. Please follow the [Bug Report Guidelines](http://weex-project.io/bug-report-guidelines.html) to file issues. A good bug report should include the following information: | ||
--> | ||
|
||
<!-- Requirements: please go through this checklist before opening a new issue --> | ||
- [ ] Review the documentation: https://weex.apache.org/index.html | ||
- [ ] Search for existing issues: https://github.com/apache/incubator-weex/issues | ||
- [ ] Use the latest Weex release: https://github.com/apache/incubator-weex/releases | ||
|
||
## Describe the bug | ||
A clear and concise description of what the bug is. | ||
|
||
## To Reproduce | ||
Steps to reproduce the behavior. Include a MCVE using http://dotwe.org/vue , crash stacktrace or share your app project. Please follow the guidelines for providing a MCVE: https://stackoverflow.com/help/mcve | ||
|
||
## Environment | ||
* Device: [e.g. iPhone6] | ||
* OS: [e.g. iOS8.1] | ||
* Version [e.g. 22] | ||
* Build from source [e.g. yes/no] | ||
|
||
## Expected behavior | ||
A clear and concise description of what you expected to happen. | ||
|
||
## Screenshots | ||
If applicable, add screenshots to help explain your problem. | ||
|
||
## Additional context | ||
Add any other context about the problem here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for Weex | ||
|
||
--- | ||
|
||
**Is your feature request related to a problem? Please describe.** | ||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
**Describe the solution you'd like** | ||
A clear and concise description of what you want to happen. | ||
|
||
**Describe alternatives you've considered** | ||
A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
**Additional context** | ||
Add any other context or screenshots about the feature request here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
108 changes: 108 additions & 0 deletions
108
...id/commons/src/main/java/com/alibaba/weex/commons/adapter/PicassoBasedDrawableLoader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package com.alibaba.weex.commons.adapter; | ||
|
||
import android.content.Context; | ||
import android.graphics.Bitmap; | ||
import android.graphics.Canvas; | ||
import android.graphics.ColorFilter; | ||
import android.graphics.PixelFormat; | ||
import android.graphics.drawable.BitmapDrawable; | ||
import android.graphics.drawable.Drawable; | ||
import android.view.Gravity; | ||
|
||
import com.squareup.picasso.Picasso; | ||
import com.squareup.picasso.Target; | ||
import com.taobao.weex.WXSDKManager; | ||
import com.taobao.weex.adapter.DrawableStrategy; | ||
import com.taobao.weex.adapter.IDrawableLoader; | ||
|
||
public class PicassoBasedDrawableLoader implements IDrawableLoader { | ||
|
||
private Context mContext; | ||
|
||
public PicassoBasedDrawableLoader(Context context) { | ||
mContext = context; | ||
} | ||
|
||
@Override | ||
public void setDrawable(final String url, | ||
final DrawableTarget drawableTarget, | ||
final DrawableStrategy drawableStrategy) { | ||
WXSDKManager.getInstance().postOnUiThread(new Runnable() { | ||
@Override | ||
public void run() { | ||
String temp = url; | ||
if (url.startsWith("//")) { | ||
temp = "http:" + url; | ||
} | ||
|
||
/** This is a hack for picasso, as Picasso hold weakReference to Target. | ||
* http://stackoverflow.com/questions/24180805/onbitmaploaded-of-target-object-not-called-on-first-load | ||
*/ | ||
class PlaceHolderDrawableTarget extends Drawable implements Target { | ||
|
||
@Override | ||
public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) { | ||
BitmapDrawable bitmapDrawable = new BitmapDrawable(mContext.getResources(), bitmap); | ||
bitmapDrawable.setGravity(Gravity.FILL); | ||
drawableTarget.setDrawable(bitmapDrawable, true); | ||
} | ||
|
||
@Override | ||
public void onBitmapFailed(Drawable errorDrawable) { | ||
|
||
} | ||
|
||
@Override | ||
public void onPrepareLoad(Drawable placeHolderDrawable) { | ||
drawableTarget.setDrawable(this, true); | ||
} | ||
|
||
@Override | ||
public void draw(Canvas canvas) { | ||
|
||
} | ||
|
||
@Override | ||
public void setAlpha(int alpha) { | ||
|
||
} | ||
|
||
@Override | ||
public void setColorFilter(ColorFilter colorFilter) { | ||
|
||
} | ||
|
||
@Override | ||
public int getOpacity() { | ||
return PixelFormat.UNKNOWN; | ||
} | ||
} | ||
Picasso. | ||
with(mContext). | ||
load(temp). | ||
resize(drawableStrategy.width, drawableStrategy.height). | ||
onlyScaleDown(). | ||
into(new PlaceHolderDrawableTarget()); | ||
} | ||
}, 0); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
.../playground/app/src/main/java/com/alibaba/weex/extend/adapter/WXAnalyzerDemoListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package com.alibaba.weex.extend.adapter; | ||
|
||
import android.util.Log; | ||
import com.taobao.weex.BuildConfig; | ||
import com.taobao.weex.performance.IWXAnalyzer; | ||
import com.taobao.weex.performance.WXAnalyzerDataTransfer; | ||
|
||
/** | ||
* @author zhongcang | ||
* @date 2018/9/17 | ||
*/ | ||
public class WXAnalyzerDemoListener implements IWXAnalyzer { | ||
@Override | ||
public void transfer(String group, String module, String type, String data) { | ||
//WXAnalyzerDataTransfer.switchInteractionLog(true); | ||
if (BuildConfig.DEBUG){ | ||
// Log.d("WXAnalyzerDemoListener", "transfer: "); | ||
} | ||
} | ||
} |
Oops, something went wrong.