Skip to content

Commit

Permalink
Merge pull request #568 from FrancMunoz/master
Browse files Browse the repository at this point in the history
Resolve compatibility plugin issues with toBack
  • Loading branch information
westonganger committed Aug 27, 2019
2 parents e3347ed + 86d0243 commit e87f159
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions src/android/CameraPreview.java
Expand Up @@ -14,6 +14,7 @@
import android.util.Size;
import android.util.SizeF;
import android.util.TypedValue;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.widget.FrameLayout;
Expand Down Expand Up @@ -285,9 +286,23 @@ public void run() {
//display camera bellow the webview
if(toBack){

webView.getView().setBackgroundColor(0x00000000);
webViewParent = webView.getView().getParent();
((ViewGroup)webView.getView()).bringToFront();
View view = webView.getView();
ViewParent rootParent = containerView.getParent();
ViewParent curParent = view.getParent();

view.setBackgroundColor(0x00000000);
// If parents do not match look for.
if(curParent.getParent() != rootParent) {
while(curParent.getParent() != rootParent) {
curParent = curParent.getParent();
}
((ViewGroup)curParent).setBackgroundColor(0x00000000);
((ViewGroup)curParent).bringToFront();
} else {
// Default
webViewParent = curParent;
((ViewGroup)view).bringToFront();
}

}else{

Expand Down

0 comments on commit e87f159

Please sign in to comment.