Skip to content

Commit 68c52af

Browse files
committed
ANDROID: fix layout issue with samsung mobiles
1 parent e427eb2 commit 68c52af

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

ChangeLog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2020-06-14 (12.19)
2+
ANDROID: fix layout issue with samsung mobiles
3+
14
2020-06-14 (12.19)
25
UI: Use theme colours in main display #94
36
UI: Added theme menu

src/platform/android/app/src/main/java/net/sourceforge/smallbasic/MainActivity.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,12 @@ public boolean getUntrusted() {
343343
return this._untrusted;
344344
}
345345

346+
public int getWindowHeight() {
347+
Rect rect = new Rect();
348+
findViewById(android.R.id.content).getWindowVisibleDisplayFrame(rect);
349+
return rect.height();
350+
}
351+
346352
@Override
347353
public void onGlobalLayout() {
348354
super.onGlobalLayout();

src/platform/android/jni/runtime.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,12 @@ void Runtime::loadConfig() {
504504
int fontSize = getInteger("getStartupFontSize");
505505
trace("fontSize = %d", fontSize);
506506

507+
int height = getInteger("getWindowHeight");
508+
if (height != _graphics->getHeight()) {
509+
// height adjustment for bottom virtual navigation bar
510+
onResize(_graphics->getWidth(), height);
511+
}
512+
507513
_output->setTextColor(DEFAULT_FOREGROUND, DEFAULT_BACKGROUND);
508514
_output->setFontSize(fontSize);
509515
_initialFontSize = _output->getFontSize();

0 commit comments

Comments
 (0)