Stash taskbar when software keyboard is docked

Stash taskbar when
1) Software keybaord is docked
2) Input toolbar is placed at the taskbar area (stash so toolbar and taskbar would not overlap)

Testing result:
https://drive.google.com/file/d/1NMDexHl0FgyHFaOUh_GSEEUU2k08STJH/view?usp=sharing

Bug: 317251202
Test: TaplTestsQuickstep#testQuickSwitchToPreviousAppForTablet
Flag: N/A

Change-Id: I90662bc6e68f644e919f5c702059476b02519ed6
This commit is contained in:
helencheuk
2024-02-09 15:36:44 +00:00
parent a6def81654
commit 00ddb5e3a9
11 changed files with 81 additions and 7 deletions
@@ -72,6 +72,8 @@ import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import androidx.core.graphics.Insets;
import androidx.core.view.WindowInsetsCompat;
import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.BubbleTextView;
@@ -417,6 +419,28 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
return isPhoneMode() && !isThreeButtonNav();
}
/**
* Returns if software keyboard is docked or input toolbar is placed at the taskbar area
*/
public boolean isImeDocked() {
View dragLayer = getDragLayer();
WindowInsets insets = dragLayer.getRootWindowInsets();
if (insets == null) {
return false;
}
WindowInsetsCompat insetsCompat =
WindowInsetsCompat.toWindowInsetsCompat(insets, dragLayer.getRootView());
if (insetsCompat.isVisible(WindowInsetsCompat.Type.ime())) {
Insets imeInsets = insetsCompat.getInsets(WindowInsetsCompat.Type.ime());
return imeInsets.bottom >= getResources().getDimensionPixelSize(
R.dimen.floating_ime_inset_height);
} else {
return false;
}
}
/**
* Show Taskbar upon receiving broadcast
*/