Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import android.content.Intent;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.SystemClock;
Expand All @@ -41,20 +42,20 @@
import android.util.DisplayMetrics;
import android.util.Log;

import android.view.inputmethod.InputConnection;

import android.view.KeyEvent;
import android.view.KeyCharacterMap;
import android.view.MotionEvent;
import android.view.Surface;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.view.inputmethod.BaseInputConnection;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
import android.view.inputmethod.InputMethodManager;
import android.widget.FrameLayout;

Expand Down Expand Up @@ -100,12 +101,17 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(mViewGroup);
instance = this;

// Apply edge-to-edge display
ViewCompat.setOnApplyWindowInsetsListener(mView, (v, insets) -> {
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
return insets;
});
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { // > 34
// Prevent edge-to-edge display, keeping the view outside the systemBars
// Warning: this doesn't set the color of the SystemBars, which can be done
// by the StatusBarService in Attach
View decorView = getWindow().getDecorView();
ViewCompat.setOnApplyWindowInsetsListener(decorView, (v, insets) -> {
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
decorView.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
return insets;
});
}

imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
Log.v(TAG, "onCreate done");
Expand Down
Loading