Center drop target icons in landscape mode.
Spec: https://docs.google.com/presentation/d/1UxdDh8EFhPbdRWRwzjbpgL-j02ew4Ew3eG3XBCeoYdo/edit#slide=id.vXfwHn8
Test: manual
Bug: 187376586
Change-Id: I2025ba75061a5ca3a004dfef2b33cdbcc17a1408
diff --git a/src/com/android/launcher3/ButtonDropTarget.java b/src/com/android/launcher3/ButtonDropTarget.java
index 13bf437..d1cb5b8 100644
--- a/src/com/android/launcher3/ButtonDropTarget.java
+++ b/src/com/android/launcher3/ButtonDropTarget.java
@@ -121,19 +121,11 @@
}
protected void setDrawable(int resId) {
- mDrawable = getContext().getDrawable(resId).mutate();
- mDrawable.setBounds(0, 0, mDrawableSize, mDrawableSize);
- setDrawable(mDrawable);
- }
-
- private void setDrawable(Drawable drawable) {
// We do not set the drawable in the xml as that inflates two drawables corresponding to
// drawableLeft and drawableStart.
- if (mTextVisible) {
- setCompoundDrawablesRelative(drawable, null, null, null);
- } else {
- setCompoundDrawablesRelative(null, drawable, null, null);
- }
+ mDrawable = getContext().getDrawable(resId).mutate();
+ mDrawable.setBounds(0, 0, mDrawableSize, mDrawableSize);
+ setCompoundDrawablesRelative(mDrawable, null, null, null);
}
public void setDropTargetBar(DropTargetBar dropTargetBar) {
@@ -334,7 +326,7 @@
if (mTextVisible != isVisible || !TextUtils.equals(newText, getText())) {
mTextVisible = isVisible;
setText(newText);
- setDrawable(mDrawable);
+ setCompoundDrawablesRelative(mDrawable, null, null, null);
}
}