Merging duplicate logic for deferred drop handling in Worksace and Folder

> All the logic is contained in UninstallDropTarget
> Also fixing a bug were mWaitingForResume was not cleared

Bug: 34692289
Change-Id: I617475ce53062902d6817954fb608198e6e03d3c
This commit is contained in:
Sunny Goyal
2017-10-05 11:40:05 -07:00
parent a9e345f886
commit 3dce5f3f50
12 changed files with 170 additions and 212 deletions

View File

@@ -42,6 +42,7 @@ import android.widget.TextView;
import com.android.launcher3.IconCache.IconLoadRequest;
import com.android.launcher3.IconCache.ItemInfoUpdateReceiver;
import com.android.launcher3.Launcher.OnResumeCallback;
import com.android.launcher3.badge.BadgeInfo;
import com.android.launcher3.badge.BadgeRenderer;
import com.android.launcher3.folder.FolderIcon;
@@ -59,7 +60,7 @@ import java.text.NumberFormat;
* because we want to make the bubble taller than the text and TextView's clip is
* too aggressive.
*/
public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver {
public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver, OnResumeCallback {
private static final int DISPLAY_WORKSPACE = 0;
private static final int DISPLAY_ALL_APPS = 1;
@@ -330,6 +331,13 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver {
refreshDrawableState();
}
@Override
public void onLauncherResume() {
// Reset the pressed state of icon that was locked in the press state while activity
// was launching
setStayPressed(false);
}
void clearPressedBackground() {
setPressed(false);
setStayPressed(false);