After trying to solve a memory leak issue with the InputMethodManager caused by the keyboard when triggered from a DialogFragment. and other related issues with the imputMethodManager + Dialogs + configurationChanges, which included changes to the manifest like:
android:windowSoftInputMode="adjustPan"
android:windowSoftInputMode="adjustPan|stateUnchanged"
Plus various overrides to onStart(), onStop(), onDestroy() inside Dialog's LifeCycle. Overrides to onDestroy() and onCreate() on Activity.
GlobalLayoutListener's and GlobalFocusChangeListener's with Handlers where also tested.
Changes that for the most part (all of them) have already been discarded as they did not worked.
A portion of the screen began to appear not covered by the default transparency of the DialogFragment on ALL dialog Fragments of the project which include: DialogFragment.class, AppCompatDialogFragment.class and normal AlertDialog.Builder()
I tried to roll back all changes, which at the end, ended up being a single line in FragmentActivity:
@Override
protected void onDestroy() {
super.onDestroy();
ViewToolUtils.fixInputMethod(this);
}
Which uses reflection to access the leaking field.
Field declaredField = inputMethodManager.getClass().getDeclaredField("mCurRootView");
if (declaredField == null) continue;
if (!declaredField.isAccessible()) {
declaredField.setAccessible(true);
}
Object obj = declaredField.get(inputMethodManager);
...
declaredField.set(inputMethodManager, null);
, but the uncovered portion of the screen still persists.
Sadly the last version on git was committed before the past week which was dedicated to fix some memory leak issues that were thought to be easily fixable but ended up transforming in some heavy overhauls, so I don't think that's an option...
The changes where first applied on a Samsung j7 Pro, and the dialogs are working with complete normalcy.
But when the changes where tested on a Samsung J5 the project never went back to normal on that device, even when all the changes were rolled back, with caches being invalidated and restarted.
Both devices have been part of this process and the first sign of this issue appeared after this particular fix was applied.
The very suspicious thing about this is that the white uncovered part actually resembles the keyboard... even though is smaller by some millimeters.
I don't mind If I could FORCE the opacity all the way down or DISABLE it entirely, at this point I don't care..., I am kinda desperate tbh.
Well, the solution was forgetting about everything, taking a bath, some pills and going to sleep.
Also some important tips:
That seemed to be the solution.