mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-09 20:41:29 -04:00
adjust logging to use std funcs, hide all system bars from showing
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
android:hardwareAccelerated="true"
|
||||
android:icon="@android:drawable/sym_def_app_icon"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
|
||||
android:theme="@android:style/Theme.NoTitleBar"
|
||||
android:enableOnBackInvokedCallback="false">
|
||||
|
||||
<activity
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
package com.twilitrealm.dusk;
|
||||
|
||||
import android.app.ActionBar;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.WindowInsets;
|
||||
|
||||
import org.libsdl.app.SDLActivity;
|
||||
|
||||
@@ -53,6 +58,24 @@ public class DuskActivity extends SDLActivity {
|
||||
return out.toArray(new String[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
getWindow().getDecorView().getWindowInsetsController().hide(WindowInsets.Type.systemBars());
|
||||
}else {
|
||||
View decorView = getWindow().getDecorView();
|
||||
// Hide the status bar.
|
||||
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
|
||||
decorView.setSystemUiVisibility(uiOptions);
|
||||
// Remember that you should never show the action bar if the
|
||||
// status bar is hidden, so hide that too if necessary.
|
||||
ActionBar actionBar = getActionBar();
|
||||
actionBar.hide();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String[] getLibraries() {
|
||||
// SDL3 is statically linked into libmain.so in this build.
|
||||
|
||||
+6
-12
@@ -6,6 +6,8 @@
|
||||
|
||||
#if ANDROID
|
||||
#include "android/log.h"
|
||||
#include <vector>
|
||||
#include <sstream>
|
||||
#endif
|
||||
|
||||
bool StubLogEnabled = true;
|
||||
@@ -64,18 +66,10 @@ void aurora_log_callback(AuroraLogLevel level, const char* module, const char* m
|
||||
break;
|
||||
}
|
||||
|
||||
const char* start = message;
|
||||
const char* end = message + len;
|
||||
while (start < end) {
|
||||
const char* newline = static_cast<const char*>(memchr(start, '\n', end - start));
|
||||
if (!newline) {
|
||||
__android_log_print(android_log_level, module, "%.*s", static_cast<int>(end - start), start);
|
||||
break;
|
||||
}
|
||||
if (newline > start) {
|
||||
__android_log_print(android_log_level, module, "%.*s", static_cast<int>(newline - start), start);
|
||||
}
|
||||
start = newline + 1;
|
||||
std::stringstream msgStream(message);
|
||||
std::string segment;
|
||||
while(std::getline(msgStream, segment)) {
|
||||
__android_log_print(android_log_level, module, "%s\n", segment.c_str());
|
||||
}
|
||||
|
||||
if (level == LOG_FATAL) {
|
||||
|
||||
Reference in New Issue
Block a user