Fix positioning of split instruction and share targets with taskbar in overview
- When taskbar is in overview, overview actions has dedicated space and no need to align to nav buttons - Add a bottom margin to split instruction and share targetse that is equal to the space below overview actions Bug: 245320601 Test: Test split select and share target with different screen sizes Change-Id: I6aec325da9cc4c43c84ba8bed5f0e087c57d6925
This commit is contained in:
@@ -50,6 +50,7 @@ import android.widget.LinearLayout;
|
||||
import com.android.launcher3.DeviceProfile;
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.config.FeatureFlags;
|
||||
import com.android.launcher3.util.DisplayController;
|
||||
import com.android.launcher3.util.SplitConfigurationOptions;
|
||||
import com.android.launcher3.util.SplitConfigurationOptions.SplitBounds;
|
||||
@@ -524,7 +525,9 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
|
||||
out.setRotation(getDegreesRotated());
|
||||
int distanceToEdge;
|
||||
if ((DisplayController.getNavigationMode(out.getContext()) == THREE_BUTTONS)
|
||||
&& (dp.isTwoPanels || dp.isTablet)) {
|
||||
&& (dp.isTwoPanels || dp.isTablet)
|
||||
// If taskbar is in overview, overview action has dedicated space above nav buttons
|
||||
&& !FeatureFlags.ENABLE_TASKBAR_IN_OVERVIEW.get()) {
|
||||
// If 3-button nav is active, align the splitInstructionsView with it.
|
||||
distanceToEdge = dp.getTaskbarOffsetY()
|
||||
+ ((dp.taskbarSize - splitInstructionsHeight) / 2);
|
||||
@@ -561,8 +564,12 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
|
||||
int insetCorrectionX = (dp.getInsets().right - dp.getInsets().left) / 2;
|
||||
// Adjust for any insets on the bottom edge
|
||||
int insetCorrectionY = dp.getInsets().bottom;
|
||||
// Adjust for taskbar in overview
|
||||
int taskbarCorrectionY =
|
||||
dp.isTaskbarPresent && FeatureFlags.ENABLE_TASKBAR_IN_OVERVIEW.get()
|
||||
? dp.taskbarSize : 0;
|
||||
out.setTranslationX(insetCorrectionX + threeButtonNavShift);
|
||||
out.setTranslationY(-distanceToEdge + insetCorrectionY);
|
||||
out.setTranslationY(-distanceToEdge + insetCorrectionY - taskbarCorrectionY);
|
||||
FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) out.getLayoutParams();
|
||||
lp.gravity = CENTER_HORIZONTAL | BOTTOM;
|
||||
out.setLayoutParams(lp);
|
||||
|
||||
Reference in New Issue
Block a user