Merge "Center drop target icons in landscape mode." into sc-dev am: 3287dd9fa7

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14980961

Change-Id: Id3f175c250acc0a40b9662c20c28c73c9fd35c13
This commit is contained in:
Yogisha Dixit authored and Automerger Merge Worker committed 2021-06-17 09:45:50 +00:00
commit d417d36615
3 files changed
+7 -16

No files matched your search

@@ -121,19 +121,11 @@ public abstract class ButtonDropTarget extends TextView
}
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) {
@@ -331,7 +323,7 @@ public abstract class ButtonDropTarget extends TextView
if (mTextVisible != isVisible || !TextUtils.equals(newText, getText())) {
mTextVisible = isVisible;
setText(newText);
setDrawable(mDrawable);
setCompoundDrawablesRelative(mDrawable, null, null, null);
}
}