Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -127,23 +127,15 @@ public void run() {
}

public static void setBackgroundTransparent(final int index) {
if(android.os.Build.VERSION.SDK_INT >10) {
sCocos2dxActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
Cocos2dxWebView webView = webViews.get(index);
if (webView != null) {
webView.setBackgroundColor(Color.TRANSPARENT);
try {
Method method = webView.getClass().getMethod("setLayerType",int.class,Paint.class);
method.invoke(webView,WebView.LAYER_TYPE_SOFTWARE,null);
} catch (Exception e) {
e.printStackTrace();
}
}
sCocos2dxActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
Cocos2dxWebView webView = webViews.get(index);
if (webView != null) {
webView.setBackgroundColor(Color.TRANSPARENT);
}
});
}
}
});
}

public static void setOpacityWebView(final int index, final float opacity) {
Expand Down