mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-17 03:25:14 -04:00
Android: Display cutout fix
This commit is contained in:
parent
02a2410925
commit
6033d5d794
@ -1,7 +1,7 @@
|
|||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 26
|
compileSdkVersion 28
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId = 'com.classicube.android.client'
|
applicationId = 'com.classicube.android.client'
|
||||||
@ -26,4 +26,4 @@ android {
|
|||||||
path 'CMakeLists.txt'
|
path 'CMakeLists.txt'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@ import android.content.res.Configuration;
|
|||||||
import android.graphics.PixelFormat;
|
import android.graphics.PixelFormat;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.Build;
|
||||||
import android.os.StrictMode;
|
import android.os.StrictMode;
|
||||||
import android.provider.Settings.Secure;
|
import android.provider.Settings.Secure;
|
||||||
import android.text.Editable;
|
import android.text.Editable;
|
||||||
@ -180,6 +181,11 @@ public class MainActivity extends Activity {
|
|||||||
window.setFormat(PixelFormat.RGBX_8888);
|
window.setFormat(PixelFormat.RGBX_8888);
|
||||||
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_UNSPECIFIED | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_UNSPECIFIED | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
||||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||||
|
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||||
|
window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
|
||||||
|
window.getAttributes().layoutInDisplayCutoutMode =
|
||||||
|
WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
|
||||||
|
}
|
||||||
// TODO: semaphore for destroyed and surfaceDestroyed
|
// TODO: semaphore for destroyed and surfaceDestroyed
|
||||||
|
|
||||||
// avoid FileUriExposed exception when taking screenshots on recent Android versions
|
// avoid FileUriExposed exception when taking screenshots on recent Android versions
|
||||||
|
0
android/gradlew
vendored
Normal file → Executable file
0
android/gradlew
vendored
Normal file → Executable file
Loading…
x
Reference in New Issue
Block a user