Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Knossos.NET.Android/Properties/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto" package="com.knossosnet.knossosnet">
<uses-permission android:name="android.permission.INTERNET" />
<uses-feature android:glEsVersion="0x00030002" android:required="false" />
Expand Down Expand Up @@ -39,6 +39,7 @@

<activity
android:name=".GameActivity"
android:theme="@style/MyTheme.NoActionBar"
android:exported="false"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:screenOrientation="sensorLandscape"
Expand Down
6 changes: 3 additions & 3 deletions Knossos.NET.Android/Resources/values-v31/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
<style name="MyTheme">
</style>

<style name="MyTheme.NoActionBar" parent="@style/Theme.AppCompat.NoActionBar">
<style name="MyTheme.NoActionBar" parent="@style/Theme.AppCompat.NoActionBar">
<item name="android:windowActionBar">false</item>
<item name="android:windowBackground">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowSplashScreenBackground">@color/splash_background</item>
<item name="android:windowSplashScreenAnimatedIcon">@drawable/avalonia_anim</item>
<item name="android:windowSplashScreenAnimationDuration">1000</item>
<item name="postSplashScreenTheme">@style/MyTheme.Main</item>

</style>
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
</style>
<style name="MyTheme.Main"
parent ="MyTheme.NoActionBar">
<item name="android:windowIsTranslucent">true</item>
Expand Down
17 changes: 10 additions & 7 deletions Knossos.NET.Android/Resources/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<resources>

<style name="MyTheme">
</style>
<style name="MyTheme">
</style>

<style name="MyTheme.NoActionBar" parent="@style/Theme.AppCompat.DayNight.NoActionBar">
<item name="android:windowActionBar">false</item>
<item name="android:windowBackground">@drawable/splash_screen</item>
<item name="android:windowNoTitle">true</item>
</style>
<style name="MyTheme.NoActionBar" parent="@style/Theme.AppCompat.DayNight.NoActionBar">
<item name="android:windowActionBar">false</item>
<item name="android:windowBackground">@drawable/splash_screen</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
</style>


</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,26 @@ protected String getMainFunction() {
}

private void hideSystemUI() {
View decorView = getWindow().getDecorView();
decorView.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
Window window = getWindow();
View decorView = window.getDecorView();

if (Build.VERSION.SDK_INT >= 30) {
window.setDecorFitsSystemWindows(false);
WindowInsetsController c = window.getInsetsController();
if (c != null) {
c.hide(WindowInsets.Type.systemBars());
c.setSystemBarsBehavior(
WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE);
}
} else {
decorView.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
}
}

@Override
Expand Down Expand Up @@ -140,6 +152,12 @@ protected void onCreate(Bundle savedInstanceState) {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
} catch (Throwable ignored) {
}

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P)
{ // API 28+
getWindow().getAttributes().layoutInDisplayCutoutMode =
WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
}

hideSystemUI();

Expand All @@ -162,8 +180,8 @@ protected void onCreate(Bundle savedInstanceState) {
}

private static final String[] PREFERRED_ORDER = new String[] {
"libSDL2.so",
"libshaderc.so",
"libSDL3.so",
"libshaderc_shared.so",
"libopenal.so",
"libavutil.so",
"libswresample.so",
Expand Down Expand Up @@ -215,6 +233,10 @@ private static List<File> orderForLoad(File dir) {
private boolean tryLoad(File so)
{
try {
String name = so.getName();
if (name.equals("libSDL2.so")) {
return true;
}
if (so != null && so.isFile()) {
System.load(so.getAbsolutePath());
return true;
Expand Down
5 changes: 2 additions & 3 deletions Knossos.NET.Android/java/org/libsdl/app/HIDDevice.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ interface HIDDevice
public String getProductName();
public UsbDevice getDevice();
public boolean open();
public int sendFeatureReport(byte[] report);
public int sendOutputReport(byte[] report);
public boolean getFeatureReport(byte[] report);
public int writeReport(byte[] report, boolean feature);
public boolean readReport(byte[] report, boolean feature);
public void setFrozen(boolean frozen);
public void close();
public void shutdown();
Expand Down
Loading