mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-28 15:56:49 +00:00
Generalize the icon popup menu types.
Generalized popup menu types and logic to allow wider uses outside of launcher. Bug: 198438631 Test: long pressed launcher icons and pressed menu options Change-Id: Iadcbb1796496c0061dcee362784e426ff55dc94a
This commit is contained in:
@@ -69,6 +69,7 @@ import android.view.ViewConfiguration;
|
||||
import android.view.animation.Interpolator;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.graphics.ColorUtils;
|
||||
import androidx.core.os.BuildCompat;
|
||||
|
||||
@@ -846,6 +847,12 @@ public final class Utilities {
|
||||
view.setLayoutParams(lp);
|
||||
}
|
||||
|
||||
public static Rect getViewBounds(@NonNull View v) {
|
||||
int[] pos = new int[2];
|
||||
v.getLocationOnScreen(pos);
|
||||
return new Rect(pos[0], pos[1], pos[0] + v.getWidth(), pos[1] + v.getHeight());
|
||||
}
|
||||
|
||||
private static class FixedSizeEmptyDrawable extends ColorDrawable {
|
||||
|
||||
private final int mSize;
|
||||
|
||||
Reference in New Issue
Block a user