Loading src/com/android/launcher3/DeviceProfile.java +7 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ import android.graphics.Point; import android.graphics.PointF; import android.graphics.Rect; import android.util.DisplayMetrics; import android.util.Log; import android.util.SparseArray; import android.view.Surface; Loading Loading @@ -363,6 +364,12 @@ public class DeviceProfile { mTypeIndex = INDEX_DEFAULT; } } if (InvariantDeviceProfile.sDebug) { Log.d("b/298077774", "DeviceProfile - mTypeIndex: " + mTypeIndex + ": " + dpPointFToString( "minCellSize", inv.minCellSize[mTypeIndex])); } isTransientTaskbar = DisplayController.isTransientTaskbar(context); if (isTransientTaskbar) { Loading src/com/android/launcher3/InvariantDeviceProfile.java +23 −0 Original line number Diff line number Diff line Loading @@ -72,6 +72,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Locale; import java.util.stream.Collectors; public class InvariantDeviceProfile { Loading @@ -81,6 +82,9 @@ public class InvariantDeviceProfile { public static final MainThreadInitializedObject<InvariantDeviceProfile> INSTANCE = new MainThreadInitializedObject<>(InvariantDeviceProfile::new); @VisibleForTesting public static boolean sDebug = false; @Retention(RetentionPolicy.SOURCE) @IntDef({TYPE_PHONE, TYPE_MULTI_DISPLAY, TYPE_TABLET}) public @interface DeviceType {} Loading Loading @@ -683,10 +687,29 @@ public class InvariantDeviceProfile { for (int i = 0; i < points.size() && i < KNEARESTNEIGHBOR; ++i) { DisplayOption p = points.get(i); float w = weight(width, height, p.minWidthDps, p.minHeightDps, WEIGHT_POWER); if (sDebug) { for (int j = INDEX_DEFAULT; j < COUNT_SIZES; j++) { Log.d("b/298077774", "invDistWeightedInterpolate - points[" + i + "]: " + String.format( Locale.ENGLISH, "\t%s: PointF(%.1f, %.1f)dp", "minCellSize[" + j + "]", p.minCellSize[j].x, p.minCellSize[j].y)); } Log.d("b/298077774", "invDistWeightedInterpolate - w[" + i + "]: " + w); } weights += w; out.add(new DisplayOption().add(p).multiply(w)); } out.multiply(1.0f / weights); if (sDebug) { Log.d("b/298077774", "invDistWeightedInterpolate - weights: " + weights); for (int j = INDEX_DEFAULT; j < COUNT_SIZES; j++) { Log.d("b/298077774", "invDistWeightedInterpolate - out: " + String.format(Locale.ENGLISH, "\t%s: PointF(%.1f, %.1f)dp", "minCellSize[" + j + "]", out.minCellSize[j].x, out.minCellSize[j].y)); } } // Since the bitmaps are persisted, ensure that all bitmap sizes are not larger than // predefined size to avoid cache invalidation Loading Loading
src/com/android/launcher3/DeviceProfile.java +7 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ import android.graphics.Point; import android.graphics.PointF; import android.graphics.Rect; import android.util.DisplayMetrics; import android.util.Log; import android.util.SparseArray; import android.view.Surface; Loading Loading @@ -363,6 +364,12 @@ public class DeviceProfile { mTypeIndex = INDEX_DEFAULT; } } if (InvariantDeviceProfile.sDebug) { Log.d("b/298077774", "DeviceProfile - mTypeIndex: " + mTypeIndex + ": " + dpPointFToString( "minCellSize", inv.minCellSize[mTypeIndex])); } isTransientTaskbar = DisplayController.isTransientTaskbar(context); if (isTransientTaskbar) { Loading
src/com/android/launcher3/InvariantDeviceProfile.java +23 −0 Original line number Diff line number Diff line Loading @@ -72,6 +72,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Locale; import java.util.stream.Collectors; public class InvariantDeviceProfile { Loading @@ -81,6 +82,9 @@ public class InvariantDeviceProfile { public static final MainThreadInitializedObject<InvariantDeviceProfile> INSTANCE = new MainThreadInitializedObject<>(InvariantDeviceProfile::new); @VisibleForTesting public static boolean sDebug = false; @Retention(RetentionPolicy.SOURCE) @IntDef({TYPE_PHONE, TYPE_MULTI_DISPLAY, TYPE_TABLET}) public @interface DeviceType {} Loading Loading @@ -683,10 +687,29 @@ public class InvariantDeviceProfile { for (int i = 0; i < points.size() && i < KNEARESTNEIGHBOR; ++i) { DisplayOption p = points.get(i); float w = weight(width, height, p.minWidthDps, p.minHeightDps, WEIGHT_POWER); if (sDebug) { for (int j = INDEX_DEFAULT; j < COUNT_SIZES; j++) { Log.d("b/298077774", "invDistWeightedInterpolate - points[" + i + "]: " + String.format( Locale.ENGLISH, "\t%s: PointF(%.1f, %.1f)dp", "minCellSize[" + j + "]", p.minCellSize[j].x, p.minCellSize[j].y)); } Log.d("b/298077774", "invDistWeightedInterpolate - w[" + i + "]: " + w); } weights += w; out.add(new DisplayOption().add(p).multiply(w)); } out.multiply(1.0f / weights); if (sDebug) { Log.d("b/298077774", "invDistWeightedInterpolate - weights: " + weights); for (int j = INDEX_DEFAULT; j < COUNT_SIZES; j++) { Log.d("b/298077774", "invDistWeightedInterpolate - out: " + String.format(Locale.ENGLISH, "\t%s: PointF(%.1f, %.1f)dp", "minCellSize[" + j + "]", out.minCellSize[j].x, out.minCellSize[j].y)); } } // Since the bitmaps are persisted, ensure that all bitmap sizes are not larger than // predefined size to avoid cache invalidation Loading