summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2019-01-02 21:44:26 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-01-02 21:44:26 +0000
commitefb8b836660bd367744c406b1a3ce7f20561e000 (patch)
tree88db0d94fda9b8915136034178cabdc1af773402
parent47a343e27fc662064f6696ea0e54230ad36f55f2 (diff)
parent6d55f66e13ab7692d56bb76678ddd7638d8848ff (diff)
downloadandroid_packages_apps_Trebuchet-efb8b836660bd367744c406b1a3ce7f20561e000.tar.gz
android_packages_apps_Trebuchet-efb8b836660bd367744c406b1a3ce7f20561e000.tar.bz2
android_packages_apps_Trebuchet-efb8b836660bd367744c406b1a3ce7f20561e000.zip
Merge "Fixing use of new API available only on API 24" into ub-launcher3-master
-rw-r--r--src/com/android/launcher3/InvariantDeviceProfile.java15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/com/android/launcher3/InvariantDeviceProfile.java b/src/com/android/launcher3/InvariantDeviceProfile.java
index 257e46c2f..dbefa4518 100644
--- a/src/com/android/launcher3/InvariantDeviceProfile.java
+++ b/src/com/android/launcher3/InvariantDeviceProfile.java
@@ -40,6 +40,7 @@ import org.xmlpull.v1.XmlPullParserException;
import java.io.IOException;
import java.util.ArrayList;
+import java.util.Collections;
import androidx.annotation.VisibleForTesting;
@@ -135,7 +136,7 @@ public class InvariantDeviceProfile {
float minWidthDps = Utilities.dpiFromPx(Math.min(smallestSize.x, smallestSize.y), dm);
float minHeightDps = Utilities.dpiFromPx(Math.min(largestSize.x, largestSize.y), dm);
// Sort the profiles based on the closeness to the device size
- allOptions.sort((a, b) ->
+ Collections.sort(allOptions, (a, b) ->
Float.compare(dist(minWidthDps, minHeightDps, a.minWidthDps, a.minHeightDps),
dist(minWidthDps, minHeightDps, b.minWidthDps, b.minHeightDps)));
DisplayOption interpolatedDisplayOption =
@@ -314,18 +315,6 @@ public class InvariantDeviceProfile {
return (float) Math.hypot(x1 - x0, y1 - y0);
}
- /**
- * Returns the closest device profiles ordered by closeness to the specified width and height
- */
- @VisibleForTesting
- static ArrayList<DisplayOption> sortByClosenessToSize(
- float width, float height, ArrayList<DisplayOption> points) {
- points.sort((a, b) ->
- Float.compare(dist(width, height, a.minWidthDps, a.minHeightDps),
- dist(width, height, b.minWidthDps, b.minHeightDps)));
- return points;
- }
-
@VisibleForTesting
static DisplayOption invDistWeightedInterpolate(float width, float height,
ArrayList<DisplayOption> points) {