commit | 20bbaa3390fc6e0f91de164c6c22199adacca2ee | [log] [tgz] |
---|---|---|
author | Schneider Victor-tulias <victortulias@google.com> | Tue Dec 15 15:33:25 2020 -0500 |
committer | Andy Wickham <awickham@google.com> | Tue Dec 22 16:10:09 2020 -0800 |
tree | 769c1ffeed400c82a38fdcfe9602a6835c148512 | |
parent | 79ec120b3f41cff68507076a7105ee1a8ca834d0 [diff] |
Add additional fake task views on overview gesture completion. Added motion pause listening to animate an additional fake task view on overview gestures in the sandbox. Test: manual Demo: https://drive.google.com/file/d/1EpewbIAxiMUEz0Fqdfbok5q9xpWS6NWz/view?usp=sharing Change-Id: Ifd0aed0a2bbb3204ae32c833b8466952679700e3
diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java index 1e023df..5c2f35b 100644 --- a/src/com/android/launcher3/Utilities.java +++ b/src/com/android/launcher3/Utilities.java
@@ -404,6 +404,11 @@ return (size / densityRatio); } + /** Converts a dp value to pixels for the current device. */ + public static int dpToPx(float dp) { + return (int) (dp * Resources.getSystem().getDisplayMetrics().density); + } + public static int pxFromSp(float size, DisplayMetrics metrics) { return (int) Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, size, metrics));