From 685464cd80dd35776af88030efde27b47ac3ea37 Mon Sep 17 00:00:00 2001 From: Ethosa Date: Tue, 3 Sep 2024 23:29:42 +0700 Subject: [PATCH] upd --- src/happyx_native/android/autils.nim | 18 ++++++++++++++++++ src/happyx_native/app/app.nim | 16 ++++++++-------- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/src/happyx_native/android/autils.nim b/src/happyx_native/android/autils.nim index 5c287a6..b37497e 100644 --- a/src/happyx_native/android/autils.nim +++ b/src/happyx_native/android/autils.nim @@ -349,6 +349,24 @@ jClass android.app.AlertDialog$Builder as AlertDialogBuilder* of Dialog: proc show*: AlertDialog +jClass android.content.Window* of Object: + proc new* + proc setStatusBarColor*(var1: jint) + + +jClass android.content.ContextWrapper* of Context: + proc new* + + +jClass android.content.ContextThemeWrapper* of ContextWrapper: + proc new* + + +jClass android.content.Activity* of ContextThemeWrapper: + proc new* + proc getWindow*(): Window + + var runOnUiThreadEvents {.compileTime.}: seq[NimNode] = @[] argumentNames {.compileTime.} = newTable[int, seq[NimNode]]() diff --git a/src/happyx_native/app/app.nim b/src/happyx_native/app/app.nim index b9e4702..6cd2463 100644 --- a/src/happyx_native/app/app.nim +++ b/src/happyx_native/app/app.nim @@ -220,13 +220,13 @@ when defined(webview): proc optimizeJs*(filepath: string) {.compileTime.} = discard staticExec( - fmt"""uglifyjs "{filepath}" -c -m toplevel --mangle-props regex=/N[ST]I\w+/ -O semicolons -o "{filepath}" """ + fmt"""uglifyjs "{filepath}" -c --mangle-props regex=/N[ST]I\w+/ -O semicolons -o "{filepath}" """ ) discard staticExec( fmt"""terser "{filepath}" -c -m -o "{filepath}" """ ) discard staticExec( - fmt"""cmd /c uglifyjs "{filepath}" -c -m toplevel --mangle-props regex=/N[ST]I\w+/ -O semicolons -o "{filepath}" """ + fmt"""cmd /c uglifyjs "{filepath}" -c --mangle-props regex=/N[ST]I\w+/ -O semicolons -o "{filepath}" """ ) discard staticExec( fmt"""cmd /c terser "{filepath}" -c -m -o "{filepath}" """ @@ -338,12 +338,12 @@ template nativeAppImpl*(appDirectory: string = "/assets", port: int = 5123, data = data.replace( "", ( when defined(export2android): - """