Merge "Adding drop shadow effect in allapps" into ub-launcher3-burnaby

This commit is contained in:
Sunny Goyal
2015-05-19 21:07:40 +00:00
committed by Android (Google) Code Review
7 changed files with 95 additions and 9 deletions

View File

@@ -34,6 +34,7 @@ import android.util.TypedValue;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.ViewConfiguration;
import android.view.ViewParent;
import android.widget.TextView;
import com.android.launcher3.IconCache.IconLoadRequest;
@@ -276,9 +277,10 @@ public class BubbleTextView extends TextView {
}
// Only show the shadow effect when persistent pressed state is set.
if (getParent() instanceof ShortcutAndWidgetContainer) {
CellLayout layout = (CellLayout) getParent().getParent();
layout.setPressedIcon(this, mPressedBackground);
ViewParent parent = getParent();
if (parent != null && parent.getParent() instanceof BubbleTextShadowHandler) {
((BubbleTextShadowHandler) parent.getParent()).setPressedIcon(
this, mPressedBackground);
}
updateIconState();
@@ -520,4 +522,11 @@ public class BubbleTextView extends TextView {
}
}
}
/**
* Interface to be implemented by the grand parent to allow click shadow effect.
*/
public static interface BubbleTextShadowHandler {
void setPressedIcon(BubbleTextView icon, Bitmap background);
}
}