summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2022-10-20 21:45:41 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2022-10-20 21:45:41 +0000
commit35157974d49e70f03687edb9408e5897d04ff845 (patch)
tree895dbb516e0a4cc36642414752378aee4e031cab
parentcf36563f879b2ed9a924aedc32879477f2fe1267 (diff)
parent50ec4afe25730e130abb55228fc04a7417a1b1db (diff)
downloadLauncher3-35157974d49e70f03687edb9408e5897d04ff845.tar.gz
Merge "Fix errorprone warnings that should be errors"
-rw-r--r--quickstep/src/com/android/launcher3/QuickstepTransitionManager.java2
-rw-r--r--quickstep/src/com/android/launcher3/taskbar/DesktopTaskbarUIController.java2
-rw-r--r--src/com/android/launcher3/LauncherFiles.java13
-rw-r--r--src/com/android/launcher3/PagedView.java2
4 files changed, 12 insertions, 7 deletions
diff --git a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
index e1a3b729c1..1539c9fee8 100644
--- a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
+++ b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
@@ -1001,7 +1001,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
mAppWindowScale = widgetBackgroundBounds.width() / windowTargetBounds.width();
// Crop scaled app window to match widget
appWindowCrop.set(0 /* left */, 0 /* top */,
- Math.round(windowTargetBounds.width()) /* right */,
+ windowTargetBounds.width() /* right */,
Math.round(widgetBackgroundBounds.height() / mAppWindowScale) /* bottom */);
matrix.setTranslate(widgetBackgroundBounds.left, widgetBackgroundBounds.top);
matrix.postScale(mAppWindowScale, mAppWindowScale, widgetBackgroundBounds.left,
diff --git a/quickstep/src/com/android/launcher3/taskbar/DesktopTaskbarUIController.java b/quickstep/src/com/android/launcher3/taskbar/DesktopTaskbarUIController.java
index e2359c0d5e..bb55a9b15f 100644
--- a/quickstep/src/com/android/launcher3/taskbar/DesktopTaskbarUIController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/DesktopTaskbarUIController.java
@@ -30,11 +30,13 @@ public class DesktopTaskbarUIController extends TaskbarUIController {
mLauncher = launcher;
}
+ @SuppressWarnings("MissingSuperCall") // TODO: Fix me
@Override
protected void init(TaskbarControllers taskbarControllers) {
mLauncher.getHotseat().setIconsAlpha(0f);
}
+ @SuppressWarnings("MissingSuperCall") // TODO: Fix me
@Override
protected void onDestroy() {
mLauncher.getHotseat().setIconsAlpha(1f);
diff --git a/src/com/android/launcher3/LauncherFiles.java b/src/com/android/launcher3/LauncherFiles.java
index e59eac8dd2..d730cea804 100644
--- a/src/com/android/launcher3/LauncherFiles.java
+++ b/src/com/android/launcher3/LauncherFiles.java
@@ -47,9 +47,12 @@ public class LauncherFiles {
DEVICE_PREFERENCES_KEY + XML,
APP_ICONS_DB));
- public static final List<String> ALL_FILES = Collections.unmodifiableList(
- new ArrayList<String>() {{
- addAll(GRID_DB_FILES);
- addAll(OTHER_FILES);
- }});
+ private static List<String> createAllFiles() {
+ ArrayList<String> result = new ArrayList<>();
+ result.addAll(GRID_DB_FILES);
+ result.addAll(OTHER_FILES);
+ return Collections.unmodifiableList(result);
+ }
+
+ public static final List<String> ALL_FILES = createAllFiles();
}
diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java
index cba0b7d709..ef363f5334 100644
--- a/src/com/android/launcher3/PagedView.java
+++ b/src/com/android/launcher3/PagedView.java
@@ -1604,7 +1604,7 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
}
private int getDisplacementFromScreenCenter(int childIndex, int screenCenter) {
- int childSize = Math.round(getChildVisibleSize(childIndex));
+ int childSize = getChildVisibleSize(childIndex);
int halfChildSize = (childSize / 2);
int childCenter = getChildOffset(childIndex) + halfChildSize;
return childCenter - screenCenter;