mirror of
https://github.com/mauiaaron/apple2.git
synced 2025-02-19 06:30:55 +00:00
Assure we use only landscape dimensions
This commit is contained in:
parent
e876cd03b6
commit
101d78d160
@ -166,6 +166,13 @@ public class Apple2Activity extends Activity {
|
|||||||
Rect rect = new Rect();
|
Rect rect = new Rect();
|
||||||
mView.getWindowVisibleDisplayFrame(rect);
|
mView.getWindowVisibleDisplayFrame(rect);
|
||||||
int h = rect.height();
|
int h = rect.height();
|
||||||
|
int w = rect.width();
|
||||||
|
if (w < h) {
|
||||||
|
// assure landscape dimensions
|
||||||
|
final int w_ = w;
|
||||||
|
w = h;
|
||||||
|
h = w_;
|
||||||
|
}
|
||||||
if (mView.getHeight() - h > SOFTKEYBOARD_THRESHOLD) {
|
if (mView.getHeight() - h > SOFTKEYBOARD_THRESHOLD) {
|
||||||
Log.d(TAG, "Soft keyboard appears to be occupying screen real estate ...");
|
Log.d(TAG, "Soft keyboard appears to be occupying screen real estate ...");
|
||||||
Apple2Activity.this.mSoftKeyboardShowing = true;
|
Apple2Activity.this.mSoftKeyboardShowing = true;
|
||||||
@ -173,7 +180,7 @@ public class Apple2Activity extends Activity {
|
|||||||
Log.d(TAG, "Soft keyboard appears to be gone ...");
|
Log.d(TAG, "Soft keyboard appears to be gone ...");
|
||||||
Apple2Activity.this.mSoftKeyboardShowing = false;
|
Apple2Activity.this.mSoftKeyboardShowing = false;
|
||||||
}
|
}
|
||||||
nativeGraphicsChanged(rect.width(), h);
|
nativeGraphicsChanged(w, h);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -404,10 +411,18 @@ public class Apple2Activity extends Activity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void graphicsInitialized(int width, int height) {
|
public void graphicsInitialized(int w, int h) {
|
||||||
mWidth = width;
|
if (w < h) {
|
||||||
mHeight = height;
|
// assure landscape dimensions
|
||||||
nativeGraphicsInitialized(width, height);
|
final int w_ = w;
|
||||||
|
w = h;
|
||||||
|
h = w_;
|
||||||
|
}
|
||||||
|
|
||||||
|
mWidth = w;
|
||||||
|
mHeight = h;
|
||||||
|
|
||||||
|
nativeGraphicsInitialized(w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Apple2View getView() {
|
public Apple2View getView() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user