diff --git a/.idea/caches/deviceStreaming.xml b/.idea/caches/deviceStreaming.xml index cd6fd37..51d2b61 100644 --- a/.idea/caches/deviceStreaming.xml +++ b/.idea/caches/deviceStreaming.xml @@ -548,6 +548,18 @@ + + + + + + + + + + + + @@ -754,6 +766,18 @@ + + + + + + + + + + + + @@ -1044,6 +1068,18 @@ + + + + + + + + + + + + @@ -1116,6 +1152,18 @@ + + + + + + + + + + + + diff --git a/src/main/assets/demo.rml b/src/main/assets/demo.rml index 4879b46..f0586e3 100644 --- a/src/main/assets/demo.rml +++ b/src/main/assets/demo.rml @@ -5,15 +5,11 @@ Fullscreen Mobile UI - - 22:47 + + {{time}} 📶 🔋 - 📶 - 🔋 - 📶 - 🔋 @@ -27,9 +23,6 @@ Home Apps Settings - Home - Apps - Settings diff --git a/src/main/assets/phone.rcss b/src/main/assets/phone.rcss index ac5a740..c2c46f9 100644 --- a/src/main/assets/phone.rcss +++ b/src/main/assets/phone.rcss @@ -11,21 +11,21 @@ body { /* Status Bar pinned to top */ #status-bar { + font-size: 3em; display: block; - height: 140px; - padding: 10px 20px 0; - background-color: rgba(255, 0, 0, 0.2); + padding: 30px; + height: 35px; + background-color: gray; } .time { float: left; font-weight: bold; - font-size: 2em; } .status-icons { float: right; - font-size: 2em; + font-family: Noto Emoji } .icon { @@ -46,7 +46,7 @@ body { } h1 { - font-size: 2.5em; + font-size: 5em; font-weight: bold; } @@ -84,27 +84,25 @@ h1 { position: absolute; bottom: 0; width: 100%; - height: 65px; - background-color: #16161a; + height: 150px; + background-color: gray; display: flex; justify-content: space-around; align-items: center; - border-top: 1px solid #333; } .nav-item { - font-size: 1.9em; - color: #888; - background-color: red; - width: 100px; + font-size: 3em; + color: black; + background-color: #AAAAAA; + width: 150px; height: 100px; text-align: center; vertical-align: middle; - line-height: 90px; + line-height: 100px; border-radius: 10px; } .nav-item:hover { - color: #3498db; - background-color: blue; + background-color: white; } \ No newline at end of file diff --git a/src/main/cpp/kernel.cpp b/src/main/cpp/kernel.cpp index 7e44501..fa4b189 100644 --- a/src/main/cpp/kernel.cpp +++ b/src/main/cpp/kernel.cpp @@ -8,8 +8,10 @@ #include #include #include "RmlUi_Renderer_GL3.h" -#include #include +#include +#include +#include using namespace aidl::com::omixlab::mosis; using namespace aidl::android::hardware; @@ -128,6 +130,14 @@ void Kernel::main_loop() Rml::LoadFontFace("LatoLatin-Regular.ttf"); Rml::LoadFontFace("NotoEmoji-Regular.ttf", true); + std::string status_time = "0"; + Rml::DataModelHandle status_time_handle; + if (Rml::DataModelConstructor status_data_ctor = context->CreateDataModel("status-data")) + { + status_data_ctor.Bind("time", &status_time); + status_time_handle = status_data_ctor.GetModelHandle(); + } + // Now we are ready to load our document. Rml::ElementDocument* document = context->LoadDocument("demo.rml"); document->Show(); @@ -147,6 +157,10 @@ void Kernel::main_loop() glClear(GL_COLOR_BUFFER_BIT); glViewport(0, 0, 540, 960); + status_time = std::format("{:%H:%M:%S}", + std::chrono::floor(std::chrono::system_clock::now())); + status_time_handle.DirtyAllVariables(); + context->Update(); rmlui_render_interface.SetViewport(540, 960); rmlui_render_interface.BeginFrame(); diff --git a/src/main/java/com/omixlab/mosis/MainActivity.kt b/src/main/java/com/omixlab/mosis/MainActivity.kt index 638b90a..a94c637 100644 --- a/src/main/java/com/omixlab/mosis/MainActivity.kt +++ b/src/main/java/com/omixlab/mosis/MainActivity.kt @@ -39,6 +39,7 @@ class MainActivity : ComponentActivity() { statusText.value = "Service Connected" remote_service = IMosisService.Stub.asInterface(service) serviceConnected(service) + initOS() } override fun onServiceDisconnected(arg0: ComponentName) {