Avoid overlapping snackbar with nav buttons in tablets
Fix: 249378243
Test: manual
Change-Id: Ibbd0e917b1cbe657b2424acbad0134d6de807f62
diff --git a/src/com/android/launcher3/views/Snackbar.java b/src/com/android/launcher3/views/Snackbar.java
index e582114..86b3419 100644
--- a/src/com/android/launcher3/views/Snackbar.java
+++ b/src/com/android/launcher3/views/Snackbar.java
@@ -31,6 +31,7 @@
import androidx.annotation.Nullable;
import com.android.launcher3.AbstractFloatingView;
+import com.android.launcher3.DeviceProfile;
import com.android.launcher3.R;
import com.android.launcher3.anim.Interpolators;
import com.android.launcher3.compat.AccessibilityManagerCompat;
@@ -97,7 +98,11 @@
dragLayer.getWidth() - maxMarginLeftRight * 2 - insets.left - insets.right,
absoluteMaxWidth);
params.width = minWidth;
- params.setMargins(0, 0, 0, marginBottom + insets.bottom);
+ DeviceProfile deviceProfile = activity.getDeviceProfile();
+ params.setMargins(0, 0, 0, marginBottom
+ + (deviceProfile.isTaskbarPresent
+ ? deviceProfile.taskbarSize + deviceProfile.getTaskbarOffsetY()
+ : insets.bottom));
TextView labelView = snackbar.findViewById(R.id.label);
String labelText = res.getString(labelStringResId);