Commit aafcd6a6 authored by fallenstardust's avatar fallenstardust

remove Window().setLayout(w,h)

parent 7a1a55c5
...@@ -101,7 +101,6 @@ public class YGOMobileActivity extends NativeActivity implements ...@@ -101,7 +101,6 @@ public class YGOMobileActivity extends NativeActivity implements
private SurfaceView mSurfaceView; private SurfaceView mSurfaceView;
private boolean replaced = false; private boolean replaced = false;
private static boolean USE_SURFACE = true; private static boolean USE_SURFACE = true;
private static boolean RESIZE_WINDOW = true;
// public static int notchHeight; // public static int notchHeight;
...@@ -251,11 +250,6 @@ public class YGOMobileActivity extends NativeActivity implements ...@@ -251,11 +250,6 @@ public class YGOMobileActivity extends NativeActivity implements
changeGameSize(); changeGameSize();
} else { } else {
int[] size = getGameSize(); int[] size = getGameSize();
if(RESIZE_WINDOW) {
if (app().isKeepScale()) {
getWindow().setLayout(size[0], size[1]);
}
}
} }
} }
...@@ -305,11 +299,9 @@ public class YGOMobileActivity extends NativeActivity implements ...@@ -305,11 +299,9 @@ public class YGOMobileActivity extends NativeActivity implements
changeGameSize(); changeGameSize();
} else { } else {
mLayout.addView(view, lp); mLayout.addView(view, lp);
if (RESIZE_WINDOW) {
getWindow().setLayout(w, h);
getWindow().setGravity(Gravity.CENTER);
}
super.setContentView(mLayout); super.setContentView(mLayout);
getWindow().setGravity(Gravity.CENTER);
} }
} }
...@@ -333,15 +325,6 @@ public class YGOMobileActivity extends NativeActivity implements ...@@ -333,15 +325,6 @@ public class YGOMobileActivity extends NativeActivity implements
// Log.i("ygo", "Android command setInputFix2:posX=" + spX + ",posY=" + spY); // Log.i("ygo", "Android command setInputFix2:posX=" + spX + ",posY=" + spY);
IrrlichtBridge.setInputFix(mPositionX, mPositionY); IrrlichtBridge.setInputFix(mPositionX, mPositionY);
} }
if(RESIZE_WINDOW) {
if (app().isKeepScale()) {
//设置为屏幕宽高
getWindow().setLayout(w, h);
} else {
//拉伸,画布设置为游戏宽高
getWindow().setLayout(size[0], size[1]);
}
}
} }
private void initExtraView() { private void initExtraView() {
......
...@@ -8,7 +8,7 @@ android { ...@@ -8,7 +8,7 @@ android {
applicationId "cn.garymb.ygomobile" applicationId "cn.garymb.ygomobile"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 28 targetSdkVersion 28
versionCode 351001010 versionCode 351001013
versionName "3.5.1" versionName "3.5.1"
flavorDimensions "versionCode" flavorDimensions "versionCode"
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment