Add margins to KQS view that is triggered from taskbar

Bug: 368119679
Test: open KQS via taskbar and observe the bounds change
Flag: com.android.launcher3.taskbar_overflow
Change-Id: I5060a339cf0cdf70a2a11b57a325767405772ef8
This commit is contained in:
Wen-Chien Wang
2024-10-23 03:38:00 +00:00
parent 08f950245e
commit 69ed08ef86
2 changed files with 9 additions and 0 deletions
@@ -20,6 +20,7 @@ import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.content.res.Resources;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.MotionEvent;
@@ -30,6 +31,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.android.internal.jank.Cuj;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.anim.AnimatorListeners;
import com.android.launcher3.desktop.DesktopAppLaunchTransition;
@@ -115,6 +117,12 @@ public class KeyboardQuickSwitchViewController {
BaseDragLayer.LayoutParams lp = new BaseDragLayer.LayoutParams(
mKeyboardQuickSwitchView.getLayoutParams());
final Resources resources = mKeyboardQuickSwitchView.getResources();
final int marginHorizontal = resources.getDimensionPixelSize(
R.dimen.keyboard_quick_switch_margin_ends);
final int marginBottom = resources.getDimensionPixelSize(
R.dimen.keyboard_quick_switch_margin_bottom);
lp.setMargins(marginHorizontal, 0, marginHorizontal, marginBottom);
lp.width = BaseDragLayer.LayoutParams.WRAP_CONTENT;
lp.gravity = Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL;
mKeyboardQuickSwitchView.setLayoutParams(lp);