Skip to content

Commit

Permalink
Merge branch 'dev_2.9.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
videopls committed Feb 17, 2020
2 parents 7192548 + ecff455 commit deaf248
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ public class LVWebViewMethodMapper<U extends VenvyUDWebView> extends UIViewMetho
"url",//9
"pullRefreshEnable",//10
"callJS",//11
"callback", // 12
"setInitData" // 13
"webViewCallback", // 12
"setInitData", // 13
"setZoomScale" // 14
};

@Override
Expand Down Expand Up @@ -79,6 +80,8 @@ public Varargs invoke(int code, U target, Varargs varargs) {
return webViewCallback(target, varargs);
case 13:
return setInitData(target, varargs);
case 14:
return setZoomScale(target, varargs);
}
return super.invoke(code, target, varargs);
}
Expand Down Expand Up @@ -174,4 +177,12 @@ public LuaValue setInitData(U view, Varargs varargs) {
}
return LuaValue.valueOf("");
}

public LuaValue setZoomScale(U view, Varargs varargs) {
Float scale = LuaUtil.getFloat(varargs, 2);
if (scale > 0) {
view.setZoomScale(scale);
}
return LuaValue.TRUE;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -203,5 +203,12 @@ public VenvyUDWebView setInitData(String data){
return this;
}

public void setZoomScale(float scale) {
final VenvyLVWebView view = this.getView();
if (view != null) {
view.setZoomScale(scale);
}
}

}

Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ public boolean getLoadingState() {
return mIsLoading;
}

public void setZoomScale(float scale) {
mWebView.setZoomScale(scale);
}

public void setJsData(String jsData){
mJsBridge.setJsData(jsData);
Expand Down
1 change: 0 additions & 1 deletion VideoOS/VenvyLibrary/src/main/assets/lua/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,6 @@ local function getTaglist()
return
end
responseData = Native:aesDecrypt(response.encryptData, OS_HTTP_PUBLIC_KEY, OS_HTTP_PUBLIC_KEY)
print("luaview "..responseData)

response = toTable(responseData)
if (response.resCode ~= "00") then
Expand Down
2 changes: 1 addition & 1 deletion VideoOS/VenvyLibrary/src/main/assets/lua/os_string.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ OS_ICON_BUBBLE_PROMPT_LEFT = OS_ICON_HEAD .. "[email protected]"
OS_ICON_BUBBLE_PROMPT_RIGHT = OS_ICON_HEAD .. "[email protected]"
OS_ICON_WEDGE_BACK = OS_ICON_HEAD .. "[email protected]"
OS_ICON_WEDGE_CLOSE = OS_ICON_HEAD .. "[email protected]"
OS_ICON_WIN_LINK_BACK = OS_ICON_HEAD .. "[email protected]"
OS_ICON_WIN_LINK_BACK = OS_ICON_HEAD .. "[email protected]"
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public interface IVenvyWebView {

void stopLoading();

void setZoomScale(float scale);

String getTitle();

String getUrl();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@ public void setWebChromeClient(IVenvyWebChromeClient webChromeClient) {
}


@Override
public void setZoomScale(float scale) {
if (mAgentWeb != null && mAgentWeb.getWebCreator() != null) {
WebView webView = mAgentWeb.getWebCreator().getWebView();
if (webView == null) {
return;
}
webView.setInitialScale((int) (scale * 100));
}
}

@Override
public boolean canGoBack() {
if (mAgentWeb == null || mAgentWeb.getWebCreator() == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

public interface IStartQueryResult {
void successful(Object result,String miniAppInfo, ServiceQueryAdsInfo queryAdsInfo);
void successful(Object result,String miniAppInfo, String originData, ServiceQueryAdsInfo queryAdsInfo);

void failed(Throwable throwable);
}
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public void startService(final ServiceType serviceType, final HashMap<String, St
params.put(VenvySchemeUtil.QUERY_PARAMETER_ADS_TYPE, String.valueOf(serviceType.getId()));
startQueryConnect(serviceType, params, new IStartQueryResult() {
@Override
public void successful(Object result, String miniAppInfo, final ServiceQueryAdsInfo queryAdsInfo) {
public void successful(Object result, String miniAppInfo, String originData, final ServiceQueryAdsInfo queryAdsInfo) {
if (queryAdsInfo == null) {
if (callback != null) {
callback.onFailToCompleteForService(new Exception("error query ads params" +
Expand Down Expand Up @@ -195,6 +195,11 @@ public void successful(Object result, String miniAppInfo, final ServiceQueryAdsI
} else {
builder.appendQueryParameter(VenvySchemeUtil.QUERY_MINIAPP_ID, "");
}

if (!TextUtils.isEmpty(originData)) {
jsonObject.put(VenvyObservableTarget.Constant.CONSTANT_LABEL_CONF_DATA, new JSONObject(originData));
}

skipParams.put(CONSTANT_DATA, jsonObject.toString());
} catch (JSONException e) {
e.printStackTrace();
Expand Down Expand Up @@ -478,9 +483,9 @@ private void startQueryConnect(ServiceType serviceType, final Map<String, String
// 视联网模式
mQueryAdsModel = new VideoServiceQueryChainModel(mPlatform, params, serviceType == ServiceTypeVideoMode_TAG, new VideoServiceQueryChainModel.ServiceQueryChainCallback() {
@Override
public void queryComplete(Object queryAdsData, String miniAppInfo, ServiceQueryAdsInfo queryAdsInfo) {
public void queryComplete(Object queryAdsData, String miniAppInfo, String originData, ServiceQueryAdsInfo queryAdsInfo) {
if (result != null) {
result.successful(queryAdsData, miniAppInfo, queryAdsInfo);
result.successful(queryAdsData, miniAppInfo, originData, queryAdsInfo);
}
}

Expand Down Expand Up @@ -569,7 +574,7 @@ public void downError(Throwable t) {
@Override
public void queryComplete(Object queryAdsData, String miniAppInfo, ServiceQueryAdsInfo queryAdsInfo) {
if (result != null) {
result.successful(queryAdsData, miniAppInfo, queryAdsInfo);
result.successful(queryAdsData, miniAppInfo, "", queryAdsInfo);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import android.support.annotation.NonNull;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.Log;
import android.util.Pair;
import android.widget.FrameLayout;

Expand Down Expand Up @@ -305,7 +306,7 @@ public void launchDesktopProgram(String targetName, String miniAppInfo, String v
jsonObject.put(VenvyObservableTarget.Constant.CONSTANT_VIDEO_MODE_X_OFFSET, videoModeDeskOffset.first);
jsonObject.put(VenvyObservableTarget.Constant.CONSTANT_VIDEO_MODE_Y_OFFSET, videoModeDeskOffset.second);
}
jsonObject.put(VenvyObservableTarget.Constant.CONSTANT_LABEL_CONF_DATA, originData);
jsonObject.put(VenvyObservableTarget.Constant.CONSTANT_LABEL_CONF_DATA, new JSONObject(originData));

} catch (JSONException e) {
e.printStackTrace();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public void updateComplete(JSONArray zipJsonDataArray) {
if (zipJsonDataArray != null && zipJsonDataArray.length() > 0) {
jsonObject.put("data", zipJsonDataArray);
}
callback.queryComplete(jsonObject, videoModeMiniAppInfoObj.toString(),
callback.queryComplete(jsonObject, videoModeMiniAppInfoObj.toString(), obj.toString(),
queryAdsInfo);
} catch (Exception e) {
e.printStackTrace();
Expand Down Expand Up @@ -296,7 +296,7 @@ private void loadDesktopProgram(String luaName, String miniAppInfo, String origi


public interface ServiceQueryChainCallback {
void queryComplete(Object queryAdsData, String miniAppInfo, ServiceQueryAdsInfo queryAdsInfo);
void queryComplete(Object queryAdsData, String miniAppInfo, String originData ,ServiceQueryAdsInfo queryAdsInfo);

void queryError(Throwable t);
}
Expand Down

0 comments on commit deaf248

Please sign in to comment.