Disable extrakeys for screen reseeding

Screen reseeding currently doesn't support extrakeys.. The views overlap
This commit is contained in:
suhan-paradkar 2021-07-08 12:59:08 +05:30 committed by Wisest_wizard
parent 87f9e2de01
commit b91ab8dea5
5 changed files with 19 additions and 9 deletions

View File

@ -14,8 +14,9 @@ import android.view.MotionEvent;
import android.view.View;
import android.view.ViewTreeObserver;
import android.widget.HorizontalScrollView;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.view.SurfaceView;
import java.util.HashMap;
import java.util.Map;
@ -63,6 +64,11 @@ public class AdditionalKeyboardView extends HorizontalScrollView implements View
setVisibility(View.GONE);
return;
}
if (preferences.getBoolean("Reseed", true)) {
if (getVisibility() != View.GONE)
setVisibility(View.GONE);
return;
}
Rect r = new Rect();
getWindowVisibleDisplayFrame(r);

View File

@ -7,7 +7,8 @@ import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.content.Context;
import android.view.inputmethod.InputMethodManager;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import java.util.HashMap;
/**
@ -100,11 +101,12 @@ public class KeyboardUtils implements ViewTreeObserver.OnGlobalLayoutListener
* Force closes the soft keyboard
* @param activeView the view with the keyboard focus
*/
public static void forceCloseKeyboard(View activeView)
public void forceCloseKeyboard(View activeView)
{
InputMethodManager inputMethodManager = (InputMethodManager) activeView.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
if(inputMethodManager != null)
if(inputMethodManager != null) {
inputMethodManager.hideSoftInputFromWindow(activeView.getWindowToken(), 0);
}
}
private void removeListener()
@ -124,4 +126,4 @@ public class KeyboardUtils implements ViewTreeObserver.OnGlobalLayoutListener
mScreenDensity = act.getResources().getDisplayMetrics().density;
}
}
}

View File

@ -109,4 +109,5 @@ public class MainActivity extends AppCompatActivity {
@Override
public void onBackPressed() {}
}

View File

@ -1,11 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent">
android:layout_width="match_parent"
android:layout_height="match_parent">
<SurfaceView
android:id="@+id/lorieView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"/>
<com.termux.x11.AdditionalKeyboardView
android:id="@+id/additionalKbd"
@ -16,4 +17,4 @@
<View
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>
</FrameLayout>

View File

@ -22,6 +22,6 @@
android:title="Reseed Screen While Soft Keybourd is open"
android:defaultValue="false"
android:key="Reseed"
android:summary="The screen size will be adjusted while Soft Keybourd is open" />
android:summary="The screen size will be adjusted while Soft Keybourd is open. Additional Keybaord is not supported by this option." />
</PreferenceScreen>