Skip to content

Commit

Permalink
made CUnityAndroidActivity opaque and fixed about layout.setBackgroun…
Browse files Browse the repository at this point in the history
…dColor().
  • Loading branch information
KojiNakamaru committed Nov 10, 2023
1 parent 93f36f5 commit 1ae7e8e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package net.gree.unitywebview;

import android.graphics.Color;
import android.graphics.Rect;
import android.os.Bundle;
import android.util.Log;
Expand All @@ -15,6 +16,13 @@ public class CUnityPlayerActivity
private List<WebView> _webViews = new ArrayList<WebView>();
private List<Rect> _masks = new ArrayList<Rect>();

@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
getWindow().getDecorView().setBackgroundColor(Color.BLACK);
}

@Override
public boolean dispatchTouchEvent(MotionEvent event) {
boolean ret = super.dispatchTouchEvent(event);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ public void Destroy() {
webView.stopLoading();
if (mVideoView != null) {
layout.removeView(mVideoView);
layout.setBackgroundColor(0x00000000);
layout.setBackgroundColor(0xff000000);
mVideoView = null;
}
layout.removeView(webView);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package net.gree.unitywebview;

import android.graphics.Color;
import android.graphics.Rect;
import android.os.Bundle;
import android.util.Log;
Expand All @@ -15,6 +16,13 @@ public class CUnityPlayerActivity
private List<WebView> _webViews = new ArrayList<WebView>();
private List<Rect> _masks = new ArrayList<Rect>();

@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
getWindow().getDecorView().setBackgroundColor(Color.BLACK);
}

@Override
public boolean dispatchTouchEvent(MotionEvent event) {
boolean ret = super.dispatchTouchEvent(event);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ public void Destroy() {
webView.stopLoading();
if (mVideoView != null) {
layout.removeView(mVideoView);
layout.setBackgroundColor(0x00000000);
layout.setBackgroundColor(0xff000000);
mVideoView = null;
}
layout.removeView(webView);
Expand Down

0 comments on commit 1ae7e8e

Please sign in to comment.