Skip to content

Commit deaf248

Browse files
author
videopls
committed
Merge branch 'dev_2.9.0'
2 parents 7192548 + ecff455 commit deaf248

File tree

11 files changed

+51
-12
lines changed

11 files changed

+51
-12
lines changed

VideoOS/LuaViewSDK/src/cn/com/venvy/lua/maper/LVWebViewMethodMapper.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ public class LVWebViewMethodMapper<U extends VenvyUDWebView> extends UIViewMetho
3838
"url",//9
3939
"pullRefreshEnable",//10
4040
"callJS",//11
41-
"callback", // 12
42-
"setInitData" // 13
41+
"webViewCallback", // 12
42+
"setInitData", // 13
43+
"setZoomScale" // 14
4344
};
4445

4546
@Override
@@ -79,6 +80,8 @@ public Varargs invoke(int code, U target, Varargs varargs) {
7980
return webViewCallback(target, varargs);
8081
case 13:
8182
return setInitData(target, varargs);
83+
case 14:
84+
return setZoomScale(target, varargs);
8285
}
8386
return super.invoke(code, target, varargs);
8487
}
@@ -174,4 +177,12 @@ public LuaValue setInitData(U view, Varargs varargs) {
174177
}
175178
return LuaValue.valueOf("");
176179
}
180+
181+
public LuaValue setZoomScale(U view, Varargs varargs) {
182+
Float scale = LuaUtil.getFloat(varargs, 2);
183+
if (scale > 0) {
184+
view.setZoomScale(scale);
185+
}
186+
return LuaValue.TRUE;
187+
}
177188
}

VideoOS/LuaViewSDK/src/cn/com/venvy/lua/ud/VenvyUDWebView.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,5 +203,12 @@ public VenvyUDWebView setInitData(String data){
203203
return this;
204204
}
205205

206+
public void setZoomScale(float scale) {
207+
final VenvyLVWebView view = this.getView();
208+
if (view != null) {
209+
view.setZoomScale(scale);
210+
}
211+
}
212+
206213
}
207214

VideoOS/LuaViewSDK/src/cn/com/venvy/lua/view/VenvyLVWebView.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ public boolean getLoadingState() {
9494
return mIsLoading;
9595
}
9696

97+
public void setZoomScale(float scale) {
98+
mWebView.setZoomScale(scale);
99+
}
97100

98101
public void setJsData(String jsData){
99102
mJsBridge.setJsData(jsData);

VideoOS/VenvyLibrary/src/main/assets/lua/main.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,6 @@ local function getTaglist()
378378
return
379379
end
380380
responseData = Native:aesDecrypt(response.encryptData, OS_HTTP_PUBLIC_KEY, OS_HTTP_PUBLIC_KEY)
381-
print("luaview "..responseData)
382381

383382
response = toTable(responseData)
384383
if (response.resCode ~= "00") then

VideoOS/VenvyLibrary/src/main/assets/lua/os_string.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ OS_ICON_BUBBLE_PROMPT_LEFT = OS_ICON_HEAD .. "[email protected]"
3030
OS_ICON_BUBBLE_PROMPT_RIGHT = OS_ICON_HEAD .. "[email protected]"
3131
OS_ICON_WEDGE_BACK = OS_ICON_HEAD .. "[email protected]"
3232
OS_ICON_WEDGE_CLOSE = OS_ICON_HEAD .. "[email protected]"
33-
OS_ICON_WIN_LINK_BACK = OS_ICON_HEAD .. "[email protected]"
33+
OS_ICON_WIN_LINK_BACK = OS_ICON_HEAD .. "[email protected]"

VideoOS/VenvyLibrary/src/main/java/cn/com/venvy/common/webview/IVenvyWebView.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ public interface IVenvyWebView {
2929

3030
void stopLoading();
3131

32+
void setZoomScale(float scale);
33+
3234
String getTitle();
3335

3436
String getUrl();

VideoOS/VenvyLibrary/src/main/java/cn/com/venvy/common/webview/VenvyWebView.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,17 @@ public void setWebChromeClient(IVenvyWebChromeClient webChromeClient) {
6969
}
7070

7171

72+
@Override
73+
public void setZoomScale(float scale) {
74+
if (mAgentWeb != null && mAgentWeb.getWebCreator() != null) {
75+
WebView webView = mAgentWeb.getWebCreator().getWebView();
76+
if (webView == null) {
77+
return;
78+
}
79+
webView.setInitialScale((int) (scale * 100));
80+
}
81+
}
82+
7283
@Override
7384
public boolean canGoBack() {
7485
if (mAgentWeb == null || mAgentWeb.getWebCreator() == null) {

VideoOS/venvy_pub/src/main/java/cn/com/videopls/pub/IStartQueryResult.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
public interface IStartQueryResult {
8-
void successful(Object result,String miniAppInfo, ServiceQueryAdsInfo queryAdsInfo);
8+
void successful(Object result,String miniAppInfo, String originData, ServiceQueryAdsInfo queryAdsInfo);
99

1010
void failed(Throwable throwable);
1111
}

VideoOS/venvy_pub/src/main/java/cn/com/videopls/pub/VideoPlusController.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public void startService(final ServiceType serviceType, final HashMap<String, St
156156
params.put(VenvySchemeUtil.QUERY_PARAMETER_ADS_TYPE, String.valueOf(serviceType.getId()));
157157
startQueryConnect(serviceType, params, new IStartQueryResult() {
158158
@Override
159-
public void successful(Object result, String miniAppInfo, final ServiceQueryAdsInfo queryAdsInfo) {
159+
public void successful(Object result, String miniAppInfo, String originData, final ServiceQueryAdsInfo queryAdsInfo) {
160160
if (queryAdsInfo == null) {
161161
if (callback != null) {
162162
callback.onFailToCompleteForService(new Exception("error query ads params" +
@@ -195,6 +195,11 @@ public void successful(Object result, String miniAppInfo, final ServiceQueryAdsI
195195
} else {
196196
builder.appendQueryParameter(VenvySchemeUtil.QUERY_MINIAPP_ID, "");
197197
}
198+
199+
if (!TextUtils.isEmpty(originData)) {
200+
jsonObject.put(VenvyObservableTarget.Constant.CONSTANT_LABEL_CONF_DATA, new JSONObject(originData));
201+
}
202+
198203
skipParams.put(CONSTANT_DATA, jsonObject.toString());
199204
} catch (JSONException e) {
200205
e.printStackTrace();
@@ -478,9 +483,9 @@ private void startQueryConnect(ServiceType serviceType, final Map<String, String
478483
// 视联网模式
479484
mQueryAdsModel = new VideoServiceQueryChainModel(mPlatform, params, serviceType == ServiceTypeVideoMode_TAG, new VideoServiceQueryChainModel.ServiceQueryChainCallback() {
480485
@Override
481-
public void queryComplete(Object queryAdsData, String miniAppInfo, ServiceQueryAdsInfo queryAdsInfo) {
486+
public void queryComplete(Object queryAdsData, String miniAppInfo, String originData, ServiceQueryAdsInfo queryAdsInfo) {
482487
if (result != null) {
483-
result.successful(queryAdsData, miniAppInfo, queryAdsInfo);
488+
result.successful(queryAdsData, miniAppInfo, originData, queryAdsInfo);
484489
}
485490
}
486491

@@ -569,7 +574,7 @@ public void downError(Throwable t) {
569574
@Override
570575
public void queryComplete(Object queryAdsData, String miniAppInfo, ServiceQueryAdsInfo queryAdsInfo) {
571576
if (result != null) {
572-
result.successful(queryAdsData, miniAppInfo, queryAdsInfo);
577+
result.successful(queryAdsData, miniAppInfo, "", queryAdsInfo);
573578
}
574579
}
575580

VideoOS/venvy_pub/src/main/java/cn/com/videopls/pub/VideoPlusView.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import android.support.annotation.NonNull;
88
import android.text.TextUtils;
99
import android.util.AttributeSet;
10+
import android.util.Log;
1011
import android.util.Pair;
1112
import android.widget.FrameLayout;
1213

@@ -305,7 +306,7 @@ public void launchDesktopProgram(String targetName, String miniAppInfo, String v
305306
jsonObject.put(VenvyObservableTarget.Constant.CONSTANT_VIDEO_MODE_X_OFFSET, videoModeDeskOffset.first);
306307
jsonObject.put(VenvyObservableTarget.Constant.CONSTANT_VIDEO_MODE_Y_OFFSET, videoModeDeskOffset.second);
307308
}
308-
jsonObject.put(VenvyObservableTarget.Constant.CONSTANT_LABEL_CONF_DATA, originData);
309+
jsonObject.put(VenvyObservableTarget.Constant.CONSTANT_LABEL_CONF_DATA, new JSONObject(originData));
309310

310311
} catch (JSONException e) {
311312
e.printStackTrace();

0 commit comments

Comments
 (0)