Merge "Simpifying uninstall drop target to check item type instead of class instance" into ub-launcher3-dorval-polish2
diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java
index ede3bea..828a347 100644
--- a/src/com/android/launcher3/allapps/AllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java
@@ -224,8 +224,8 @@
mAppsRecyclerView.setLayoutManager(mLayoutManager);
mAppsRecyclerView.setAdapter(mAdapter);
mAppsRecyclerView.setHasFixedSize(true);
- // Removes the animation that can occur when updating the predicted apps in place.
- mAppsRecyclerView.getItemAnimator().setChangeDuration(0);
+ // No animations will occur when changes occur to the items in this RecyclerView.
+ mAppsRecyclerView.setItemAnimator(null);
if (FeatureFlags.LAUNCHER3_PHYSICS) {
mAppsRecyclerView.setSpringAnimationHandler(mSpringAnimationHandler);
}
diff --git a/src/com/android/launcher3/graphics/IconNormalizer.java b/src/com/android/launcher3/graphics/IconNormalizer.java
index 34d0b72..8ed62bc 100644
--- a/src/com/android/launcher3/graphics/IconNormalizer.java
+++ b/src/com/android/launcher3/graphics/IconNormalizer.java
@@ -32,10 +32,8 @@
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.Log;
-
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.Utilities;
-
import java.io.File;
import java.io.FileOutputStream;
import java.nio.ByteBuffer;
@@ -84,12 +82,12 @@
private final Rect mBounds;
private final Matrix mMatrix;
- private Paint mPaintIcon;
- private Canvas mCanvasARGB;
+ private final Paint mPaintIcon;
+ private final Canvas mCanvasARGB;
- private File mDir;
+ private final File mDir;
private int mFileId;
- private Random mRandom;
+ private final Random mRandom;
private IconNormalizer(Context context) {
// Use twice the icon size as maximum size to avoid scaling down twice.
@@ -122,7 +120,6 @@
mPaintMaskShapeOutline.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_OUT));
mMatrix = new Matrix();
- int[] mPixels = new int[mMaxSize * mMaxSize];
mAdaptiveIconScale = SCALE_NOT_INITIALIZED;
mDir = context.getExternalFilesDir(null);
@@ -174,7 +171,8 @@
boolean isTrans = isTransparentBitmap(mBitmapARGB);
if (DEBUG) {
- final File afterFile = new File(mDir, "isShape" + mFileId + "_after_" + isTrans + ".png");
+ final File afterFile = new File(mDir,
+ "isShape" + mFileId + "_after_" + isTrans + ".png");
try {
mBitmapARGB.compress(Bitmap.CompressFormat.PNG, 100,
new FileOutputStream(afterFile));
@@ -210,7 +208,9 @@
float percentageDiffPixels = ((float) sum) / (mBounds.width() * mBounds.height());
boolean transparentImage = percentageDiffPixels < PIXEL_DIFF_PERCENTAGE_THRESHOLD;
if (DEBUG) {
- Log.d(TAG, "Total # pixel that is different (id="+ mFileId + "):" + percentageDiffPixels + "="+ sum + "/" + mBounds.width() * mBounds.height());
+ Log.d(TAG,
+ "Total # pixel that is different (id=" + mFileId + "):" + percentageDiffPixels
+ + "=" + sum + "/" + mBounds.width() * mBounds.height());
}
return transparentImage;
}