Merge "Avoid overlapping snackbar with nav buttons in tablets" into tm-qpr-dev am: 3ad5eef4b8

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20736530

Change-Id: I52702a0a615b63359c1475ddad8278c2f03d271c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Alex Chau
2022-12-15 15:37:40 +00:00
committed by Automerger Merge Worker
@@ -31,6 +31,7 @@ import android.widget.TextView;
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 @@ public class Snackbar extends AbstractFloatingView {
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);