Merge "[Search] [Race condition] Fix wrong titles showing on BubbleTextHolder" into sc-v2-dev
This commit is contained in:
@@ -68,6 +68,7 @@ import com.android.launcher3.model.data.SearchActionItemInfo;
|
||||
import com.android.launcher3.model.data.WorkspaceItemInfo;
|
||||
import com.android.launcher3.util.SafeCloseable;
|
||||
import com.android.launcher3.views.ActivityContext;
|
||||
import com.android.launcher3.views.BubbleTextHolder;
|
||||
import com.android.launcher3.views.IconLabelDotView;
|
||||
|
||||
import java.text.NumberFormat;
|
||||
@@ -167,7 +168,7 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
|
||||
private HandlerRunnable mIconLoadRequest;
|
||||
|
||||
private boolean mEnableIconUpdateAnimation = false;
|
||||
private ItemInfoUpdateReceiver mItemInfoUpdateReceiver;
|
||||
private BubbleTextHolder mBubbleTextHolder;
|
||||
|
||||
public BubbleTextView(Context context) {
|
||||
this(context, null, 0);
|
||||
@@ -245,7 +246,6 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
|
||||
mDotParams.scale = 0f;
|
||||
mForceHideDot = false;
|
||||
setBackground(null);
|
||||
mItemInfoUpdateReceiver = null;
|
||||
}
|
||||
|
||||
private void cancelDotScaleAnim() {
|
||||
@@ -345,14 +345,14 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
|
||||
|
||||
private void setItemInfo(ItemInfoWithIcon itemInfo) {
|
||||
setTag(itemInfo);
|
||||
if (mItemInfoUpdateReceiver != null) {
|
||||
mItemInfoUpdateReceiver.reapplyItemInfo(itemInfo);
|
||||
if (mBubbleTextHolder != null) {
|
||||
mBubbleTextHolder.onItemInfoUpdated(itemInfo);
|
||||
}
|
||||
}
|
||||
|
||||
public void setItemInfoUpdateReceiver(
|
||||
ItemInfoUpdateReceiver itemInfoUpdateReceiver) {
|
||||
mItemInfoUpdateReceiver = itemInfoUpdateReceiver;
|
||||
public void setBubbleTextHolder(
|
||||
BubbleTextHolder bubbleTextHolder) {
|
||||
mBubbleTextHolder = bubbleTextHolder;
|
||||
}
|
||||
|
||||
@UiThread
|
||||
|
||||
@@ -16,14 +16,13 @@
|
||||
package com.android.launcher3.views;
|
||||
|
||||
import com.android.launcher3.BubbleTextView;
|
||||
import com.android.launcher3.icons.IconCache;
|
||||
import com.android.launcher3.model.data.ItemInfo;
|
||||
import com.android.launcher3.model.data.ItemInfoWithIcon;
|
||||
|
||||
/**
|
||||
* Views that contain {@link BubbleTextView} should implement this interface.
|
||||
*/
|
||||
public interface BubbleTextHolder extends IconCache.ItemInfoUpdateReceiver {
|
||||
public interface BubbleTextHolder {
|
||||
BubbleTextView getBubbleText();
|
||||
|
||||
/**
|
||||
@@ -31,6 +30,6 @@ public interface BubbleTextHolder extends IconCache.ItemInfoUpdateReceiver {
|
||||
*
|
||||
* @param itemInfo the new itemInfo
|
||||
*/
|
||||
@Override
|
||||
default void reapplyItemInfo(ItemInfoWithIcon itemInfo){};
|
||||
default void onItemInfoUpdated(ItemInfoWithIcon itemInfo) {
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user