Fix issue when fullscreen
[rtmpclient.git] / app / src / main / java / ai / suanzi / rtmpclient / CameraView.java
index de88ca1..e4bc71c 100644 (file)
@@ -30,7 +30,7 @@ public class CameraView extends SurfaceView implements SurfaceHolder.Callback {
     public void setLayout(int width, int heitht){
         this.height = heitht;
         this.width = width;
-        gLogger.error("SurfacedCreated, screen size w: " + SCREEN_WIDTH + ", h:" + SCREEN_HEIGHT + ". preview size, w: " + width + ", h: " + height);
+        gLogger.error("setLayout, screen size w: " + SCREEN_WIDTH + ", h:" + SCREEN_HEIGHT + ". preview size, w: " + width + ", h: " + height);
 
         float ratio = (float) height / width; // 3/4,,,  640x480  1008x1344
         FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams)getLayoutParams();
@@ -46,6 +46,7 @@ public class CameraView extends SurfaceView implements SurfaceHolder.Callback {
             lp.leftMargin = 0;
             lp.topMargin = (SCREEN_HEIGHT - lp.height) / 2;
         }
+        gLogger.error("width=" + lp.width + ", height=" + lp.height + ". leftMargin=" + lp.leftMargin + ", topMargin=" + lp.topMargin);
         this.setLayoutParams(lp);
     }