From 3bf448ae8675421a22dfb5148d5259435d55ecff Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Mon, 8 Apr 2024 10:27:20 +0100 Subject: [PATCH] Simplify the variables used --- internal/driver/mobile/app/android.go | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/internal/driver/mobile/app/android.go b/internal/driver/mobile/app/android.go index 7b1f410948..dad70470e9 100644 --- a/internal/driver/mobile/app/android.go +++ b/internal/driver/mobile/app/android.go @@ -76,7 +76,6 @@ import ( var mimeMap = map[string]string{ ".txt": "text/plain", } -var currentSize size.Event // GoBack asks the OS to go to the previous app / activity func GoBack() { @@ -292,8 +291,8 @@ var ( windowConfigChange = make(chan windowConfig) activityDestroyed = make(chan struct{}) - screenInsetTop, screenInsetBottom, screenInsetLeft, screenInsetRight int - darkMode bool + currentSize size.Event + darkMode bool ) func init() { @@ -355,12 +354,10 @@ func filePickerReturned(str *C.char) { //export insetsChanged func insetsChanged(top, bottom, left, right int) { - screenInsetTop, screenInsetBottom, screenInsetLeft, screenInsetRight = top, bottom, left, right - - currentSize.InsetTopPx = screenInsetTop - currentSize.InsetBottomPx = screenInsetBottom - currentSize.InsetLeftPx = screenInsetLeft - currentSize.InsetRightPx = screenInsetRight + currentSize.InsetTopPx = top + currentSize.InsetBottomPx = bottom + currentSize.InsetLeftPx = left + currentSize.InsetRightPx = right theApp.events.In() <- currentSize }