From 57fd352f74f87e5c5bc57e81c457f74a88da121f Mon Sep 17 00:00:00 2001 From: Der_Googler <54764558+DerGoogler@users.noreply.github.com> Date: Sat, 14 Sep 2024 17:18:30 +0200 Subject: [PATCH] remove unused imports --- .../com/dergoogler/mmrl/MainActivity.java | 43 +++++++------------ app/src/main/res/xml/config.xml | 4 +- 2 files changed, 16 insertions(+), 31 deletions(-) diff --git a/app/src/main/java/com/dergoogler/mmrl/MainActivity.java b/app/src/main/java/com/dergoogler/mmrl/MainActivity.java index 8eebe572..f4bcd673 100644 --- a/app/src/main/java/com/dergoogler/mmrl/MainActivity.java +++ b/app/src/main/java/com/dergoogler/mmrl/MainActivity.java @@ -1,20 +1,12 @@ package com.dergoogler.mmrl; import android.annotation.SuppressLint; -import android.content.Context; -import android.content.Intent; -import android.database.Cursor; import android.graphics.Rect; -import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.os.StrictMode; -import android.provider.DocumentsContract; -import android.provider.MediaStore; -import android.provider.OpenableColumns; import android.util.Log; import android.view.View; -import android.view.ViewTreeObserver; import android.webkit.ConsoleMessage; import android.webkit.WebSettings; import android.webkit.WebView; @@ -32,13 +24,11 @@ import com.dergoogler.core.NativeBuildConfig; import com.dergoogler.core.NativeView; import com.dergoogler.core.NativeSuZip; -import com.topjohnwu.superuser.io.SuFile; import org.apache.cordova.*; import org.apache.cordova.engine.SystemWebChromeClient; import org.apache.cordova.engine.SystemWebViewEngine; -import java.io.File; public class MainActivity extends CordovaActivity { @@ -65,24 +55,21 @@ public void onCreate(Bundle savedInstanceState) { CordovaWebViewEngine wve = appView.getEngine(); - rootView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { - @Override - public void onGlobalLayout() { - Rect r = new Rect(); - rootView.getWindowVisibleDisplayFrame(r); - int screenHeight = rootView.getRootView().getHeight(); - int keypadHeight = screenHeight - r.bottom; - - if (keypadHeight > screenHeight * 0.15) { // 0.15 ratio is perhaps enough to determine keypad height. - if (!isKeyboardShowing) { - isKeyboardShowing = true; - adjustWebViewHeight(keypadHeight); - } - } else { - if (isKeyboardShowing) { - isKeyboardShowing = false; - resetWebViewHeight(); - } + rootView.getViewTreeObserver().addOnGlobalLayoutListener(() -> { + Rect r = new Rect(); + rootView.getWindowVisibleDisplayFrame(r); + int screenHeight = rootView.getRootView().getHeight(); + int keypadHeight = screenHeight - r.bottom; + + if (keypadHeight > screenHeight * 0.15) { // 0.15 ratio is perhaps enough to determine keypad height. + if (!isKeyboardShowing) { + isKeyboardShowing = true; + adjustWebViewHeight(keypadHeight); + } + } else { + if (isKeyboardShowing) { + isKeyboardShowing = false; + resetWebViewHeight(); } } }); diff --git a/app/src/main/res/xml/config.xml b/app/src/main/res/xml/config.xml index 9901950b..61c6ea9c 100644 --- a/app/src/main/res/xml/config.xml +++ b/app/src/main/res/xml/config.xml @@ -1,7 +1,5 @@ - + MMRL No description