mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-02 08:56:55 +00:00
Merge "Adding drop shadow effect in allapps" into ub-launcher3-burnaby
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user