Skip to content

Commit

Permalink
remove unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
DerGoogler committed Sep 14, 2024
1 parent f0cfcb3 commit 57fd352
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 31 deletions.
43 changes: 15 additions & 28 deletions app/src/main/java/com/dergoogler/mmrl/MainActivity.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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 {

Expand All @@ -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();
}
}
});
Expand Down
4 changes: 1 addition & 3 deletions app/src/main/res/xml/config.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.dergoogler.mmrl"
version="1.6.0"
xmlns:android="http://schemas.android.com/apk/res/android">
<widget id="com.dergoogler.mmrl" version="1.6.0">
<name>MMRL</name>
<description>No description</description>
<author email="[email protected]" href="https://dergoogler.com">
Expand Down

0 comments on commit 57fd352

Please sign in to comment.