Merge "Revert^3 "Change Overview Actions to round buttons."" into udc-qpr-dev

This commit is contained in:
Andy Wickham
2023-08-08 20:58:04 +00:00
committed by Android (Google) Code Review
20 changed files with 87 additions and 127 deletions
@@ -125,33 +125,8 @@ public class OverviewState extends LauncherState {
@Override
public int getFloatingSearchBarRestingMarginBottom(Launcher launcher) {
if (!areElementsVisible(launcher, FLOATING_SEARCH_BAR)) {
return super.getFloatingSearchBarRestingMarginBottom(launcher);
}
RecentsView recentsView = launcher.getOverviewPanel();
DeviceProfile dp = launcher.getDeviceProfile();
int activeTaskMarginBottom = LayoutUtils.getShelfTrackingDistance(launcher, dp,
recentsView.getPagedOrientationHandler());
// Center between task bottom and bottom of the screen.
return (activeTaskMarginBottom - dp.overviewActionsHeight) / 2
- launcher.getResources().getDimensionPixelSize(R.dimen.qsb_shadow_height);
}
@Override
public int getFloatingSearchBarRestingMarginStart(Launcher launcher) {
return getFloatingSearchBarRestingMarginHorizontal(launcher);
}
@Override
public int getFloatingSearchBarRestingMarginEnd(Launcher launcher) {
return getFloatingSearchBarRestingMarginHorizontal(launcher);
}
private static int getFloatingSearchBarRestingMarginHorizontal(Launcher launcher) {
// Width if the search bar were to be expanded (focused).
int expandedWidth = launcher.getResources().getDimensionPixelSize(
R.dimen.overview_floating_search_width);
return (launcher.getDeviceProfile().widthPx - expandedWidth) / 2;
return areElementsVisible(launcher, FLOATING_SEARCH_BAR) ? 0
: super.getFloatingSearchBarRestingMarginBottom(launcher);
}
@Override
@@ -20,7 +20,6 @@ import static android.app.ActivityTaskManager.INVALID_TASK_ID;
import static com.android.launcher3.LauncherState.ALL_APPS;
import static com.android.launcher3.LauncherState.CLEAR_ALL_BUTTON;
import static com.android.launcher3.LauncherState.EDIT_MODE;
import static com.android.launcher3.LauncherState.FLOATING_SEARCH_BAR;
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.LauncherState.OVERVIEW;
import static com.android.launcher3.LauncherState.OVERVIEW_MODAL_TASK;
@@ -99,12 +98,6 @@ public class LauncherRecentsView extends RecentsView<QuickstepLauncher, Launcher
return mActivity.canStartHomeSafely();
}
@Override
public boolean isFloatingSearchVisible() {
return FeatureFlags.ENABLE_FLOATING_SEARCH_BAR.get()
&& OVERVIEW.areElementsVisible(mActivity, FLOATING_SEARCH_BAR);
}
@Override
protected void onTaskLaunchAnimationEnd(boolean success) {
if (success) {
@@ -22,14 +22,12 @@ import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.ImageButton;
import androidx.annotation.IntDef;
import androidx.annotation.Nullable;
import com.android.launcher3.BaseActivity;
import com.android.launcher3.BaseDraggingActivity;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Insettable;
import com.android.launcher3.R;
@@ -51,7 +49,6 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo
implements OnClickListener, Insettable {
private final Rect mInsets = new Rect();
private BaseDraggingActivity mActivity;
@IntDef(flag = true, value = {
HIDDEN_NON_ZERO_ROTATION,
@@ -99,7 +96,7 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo
public static final int FLAG_SINGLE_TASK = 1 << 0;
private MultiValueAlpha mMultiValueAlpha;
private ImageButton mSplitButton;
private Button mSplitButton;
@ActionsHiddenFlags
private int mHiddenFlags;
@@ -135,8 +132,6 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo
@Override
protected void onFinishInflate() {
super.onFinishInflate();
mActivity = BaseActivity.fromContext(getContext());
mMultiValueAlpha = new MultiValueAlpha(findViewById(R.id.action_buttons), NUM_ALPHAS);
mMultiValueAlpha.setUpdateVisibility(true);
@@ -285,7 +280,7 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo
LayoutParams actionParams = (LayoutParams) findViewById(
R.id.action_buttons).getLayoutParams();
actionParams.setMargins(
actionParams.leftMargin, 0,
actionParams.leftMargin, mDp.overviewActionsTopMarginPx,
actionParams.rightMargin, getBottomMargin());
}
@@ -298,11 +293,6 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo
return mDp.stashedTaskbarHeight;
}
if (isFloatingSearchVisible()) {
// Center between task and bottom of the screen.
return (mDp.heightPx - mTaskSize.bottom - mDp.overviewActionsHeight) / 2;
}
// Align to bottom of task Rect.
return mDp.heightPx - mTaskSize.bottom - mDp.overviewActionsTopMarginPx
- mDp.overviewActionsHeight;
@@ -318,12 +308,9 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo
requestLayout();
mSplitButton.setImageResource(
dp.isLandscape ? R.drawable.ic_split_horizontal : R.drawable.ic_split_vertical);
}
protected boolean isFloatingSearchVisible() {
return ((RecentsView) mActivity.getOverviewPanel()).isFloatingSearchVisible();
mSplitButton.setCompoundDrawablesRelativeWithIntrinsicBounds(
(dp.isLandscape ? R.drawable.ic_split_horizontal : R.drawable.ic_split_vertical),
0, 0, 0);
}
/**
@@ -5221,11 +5221,6 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
});
}
/** @return {@code true} if floating search bar is visible in Recents. */
public boolean isFloatingSearchVisible() {
return false;
}
public RemoteTargetHandle[] getRemoteTargetHandles() {
return mRemoteTargetHandles;
}