summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZak Cohen <zakcohen@google.com>2019-06-03 14:58:18 -0700
committerSunny Goyal <sunnygoyal@google.com>2019-06-05 11:18:09 -0700
commit8d19146b7b90664e1290d1c186c93e6d17fa94e8 (patch)
treefacb294bd33e840769cfdd8380bc170234d22116
parentff9fe09b3f6cdf3a5046e22f8bcf30e99890f4c2 (diff)
downloadandroid_packages_apps_Trebuchet-8d19146b7b90664e1290d1c186c93e6d17fa94e8.tar.gz
android_packages_apps_Trebuchet-8d19146b7b90664e1290d1c186c93e6d17fa94e8.tar.bz2
android_packages_apps_Trebuchet-8d19146b7b90664e1290d1c186c93e6d17fa94e8.zip
Remove unused hints code.
This layout is handled by the provider of the hints now. Bug: 132886768 Test: manual Change-Id: Ifc0db2395a7503b1b03dcb796961ef6647c0413b (cherry picked from commit f3231f417db08185ec204b247d331dba6a9b0383)
-rw-r--r--quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsViewStateController.java18
-rw-r--r--quickstep/recents_ui_overrides/src/com/android/quickstep/hints/HintUtil.java78
-rw-r--r--quickstep/recents_ui_overrides/src/com/android/quickstep/hints/HintView.java71
-rw-r--r--quickstep/recents_ui_overrides/src/com/android/quickstep/hints/ProactiveHintsContainer.java55
-rw-r--r--quickstep/recents_ui_overrides/src/com/android/quickstep/hints/UiHintListenerConstants.java28
-rw-r--r--quickstep/recents_ui_overrides/src/com/android/quickstep/hints/UiInterfaceConstants.java34
-rw-r--r--quickstep/recents_ui_overrides/src/com/android/quickstep/views/LauncherRecentsView.java64
-rw-r--r--res/layout/launcher.xml5
-rw-r--r--res/layout/proactive_hints_container.xml20
-rw-r--r--res/values/dimens.xml5
-rw-r--r--src/com/android/launcher3/DeviceProfile.java7
11 files changed, 0 insertions, 385 deletions
diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsViewStateController.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsViewStateController.java
index 1d36d1aae..b5d84247a 100644
--- a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsViewStateController.java
+++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsViewStateController.java
@@ -32,7 +32,6 @@ import com.android.launcher3.LauncherState;
import com.android.launcher3.LauncherStateManager.AnimationConfig;
import com.android.launcher3.anim.AnimatorSetBuilder;
import com.android.launcher3.anim.PropertySetter;
-import com.android.quickstep.hints.ProactiveHintsContainer;
import com.android.quickstep.views.ClearAllButton;
import com.android.quickstep.views.LauncherRecentsView;
import com.android.quickstep.views.RecentsView;
@@ -55,14 +54,6 @@ public final class RecentsViewStateController extends
if (state.overviewUi) {
mRecentsView.updateEmptyMessage();
mRecentsView.resetTaskVisuals();
- mRecentsView.setHintVisibility(1f);
- } else {
- mRecentsView.setHintVisibility(0f);
- ProactiveHintsContainer
- proactiveHintsContainer = mRecentsView.getProactiveHintsContainer();
- if (proactiveHintsContainer != null) {
- proactiveHintsContainer.removeAllViews();
- }
}
setAlphas(PropertySetter.NO_ANIM_PROPERTY_SETTER, state.getVisibleElements(mLauncher));
mRecentsView.setFullscreenProgress(state.getOverviewFullscreenProgress());
@@ -75,14 +66,6 @@ public final class RecentsViewStateController extends
if (!toState.overviewUi) {
builder.addOnFinishRunnable(mRecentsView::resetTaskVisuals);
- mRecentsView.setHintVisibility(0f);
- builder.addOnFinishRunnable(() -> {
- ProactiveHintsContainer
- proactiveHintsContainer = mRecentsView.getProactiveHintsContainer();
- if (proactiveHintsContainer != null) {
- proactiveHintsContainer.removeAllViews();
- }
- });
}
if (toState.overviewUi) {
@@ -94,7 +77,6 @@ public final class RecentsViewStateController extends
updateAnim.setDuration(config.duration);
builder.play(updateAnim);
mRecentsView.updateEmptyMessage();
- builder.addOnFinishRunnable(() -> mRecentsView.setHintVisibility(1f));
}
PropertySetter propertySetter = config.getPropertySetter(builder);
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/hints/HintUtil.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/hints/HintUtil.java
deleted file mode 100644
index f2d40ecc4..000000000
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/hints/HintUtil.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.quickstep.hints;
-
-import android.app.PendingIntent;
-import android.graphics.drawable.Icon;
-import android.os.Bundle;
-
-public final class HintUtil {
-
- public static final String ID_KEY = "id";
- public static final String ICON_KEY = "icon";
- public static final String TEXT_KEY = "text";
- public static final String TAP_ACTION_KEY = "tap_action";
-
- private HintUtil() {}
-
- public static Bundle makeHint(String id, Icon icon, CharSequence text) {
- Bundle hint = new Bundle();
- hint.putString(ID_KEY, id);
- hint.putParcelable(ICON_KEY, icon);
- hint.putCharSequence(TEXT_KEY, text);
- return hint;
- }
-
- public static Bundle makeHint(Icon icon, CharSequence text, PendingIntent tapAction) {
- Bundle hint = new Bundle();
- hint.putParcelable(ICON_KEY, icon);
- hint.putCharSequence(TEXT_KEY, text);
- hint.putParcelable(TAP_ACTION_KEY, tapAction);
- return hint;
- }
-
- public static String getId(Bundle hint) {
- String id = hint.getString(ID_KEY);
- if (id == null) {
- throw new IllegalArgumentException("Hint does not contain an ID");
- }
- return id;
- }
-
- public static Icon getIcon(Bundle hint) {
- Icon icon = hint.getParcelable(ICON_KEY);
- if (icon == null) {
- throw new IllegalArgumentException("Hint does not contain an icon");
- }
- return icon;
- }
-
- public static CharSequence getText(Bundle hint) {
- CharSequence text = hint.getCharSequence(TEXT_KEY);
- if (text == null) {
- throw new IllegalArgumentException("Hint does not contain text");
- }
- return text;
- }
-
- public static PendingIntent getTapAction(Bundle hint) {
- PendingIntent tapAction = hint.getParcelable(TAP_ACTION_KEY);
- if (tapAction == null) {
- throw new IllegalArgumentException("Hint does not contain a tap action");
- }
- return tapAction;
- }
-}
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/hints/HintView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/hints/HintView.java
deleted file mode 100644
index 5399cc4ef..000000000
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/hints/HintView.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.quickstep.hints;
-
-import static com.android.quickstep.hints.HintUtil.getIcon;
-import static com.android.quickstep.hints.HintUtil.getText;
-
-import android.content.Context;
-import android.graphics.drawable.Icon;
-import android.os.Bundle;
-import android.util.AttributeSet;
-import android.widget.ImageView;
-import android.widget.LinearLayout;
-import android.widget.TextView;
-
-import androidx.annotation.Nullable;
-
-import com.android.launcher3.R;
-
-public class HintView extends LinearLayout {
- private ImageView mIconView;
- private TextView mLabelView;
-
- public HintView(Context context) {
- super(context);
- }
-
- public HintView(Context context, @Nullable AttributeSet attrs) {
- super(context, attrs);
- }
-
- public HintView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
- super(context, attrs, defStyleAttr);
- }
-
- public HintView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
- super(context, attrs, defStyleAttr, defStyleRes);
- }
-
- public void setHint(Bundle hint) {
- mLabelView.setText(getText(hint));
-
- Icon icon = getIcon(hint);
- if (icon == null) {
- mIconView.setVisibility(GONE);
- } else {
- mIconView.setImageIcon(icon);
- mIconView.setVisibility(VISIBLE);
- }
- }
-
- @Override
- protected void onFinishInflate() {
- super.onFinishInflate();
- mIconView = findViewById(R.id.icon);
- mLabelView = findViewById(R.id.label);
- }
-}
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/hints/ProactiveHintsContainer.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/hints/ProactiveHintsContainer.java
deleted file mode 100644
index 74a48517b..000000000
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/hints/ProactiveHintsContainer.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package com.android.quickstep.hints;
-
-import android.content.Context;
-import android.util.AttributeSet;
-import android.util.FloatProperty;
-import android.view.View;
-import android.widget.FrameLayout;
-
-public class ProactiveHintsContainer extends FrameLayout {
-
- public static final FloatProperty<ProactiveHintsContainer> HINT_VISIBILITY =
- new FloatProperty<ProactiveHintsContainer>("hint_visibility") {
- @Override
- public void setValue(ProactiveHintsContainer proactiveHintsContainer, float v) {
- proactiveHintsContainer.setHintVisibility(v);
- }
-
- @Override
- public Float get(ProactiveHintsContainer proactiveHintsContainer) {
- return proactiveHintsContainer.mHintVisibility;
- }
- };
-
- private float mHintVisibility;
-
- public ProactiveHintsContainer(Context context) {
- super(context);
- }
-
- public ProactiveHintsContainer(Context context, AttributeSet attrs) {
- super(context, attrs);
- }
-
- public ProactiveHintsContainer(Context context, AttributeSet attrs, int defStyleAttr) {
- super(context, attrs, defStyleAttr);
- }
-
- public ProactiveHintsContainer(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
- super(context, attrs, defStyleAttr, defStyleRes);
- }
-
- public void setView(View v) {
- removeAllViews();
- addView(v);
- }
-
- public void setHintVisibility(float v) {
- if (v == 1) {
- setVisibility(VISIBLE);
- } else {
- setVisibility(GONE);
- }
- mHintVisibility = v;
- }
-}
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/hints/UiHintListenerConstants.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/hints/UiHintListenerConstants.java
deleted file mode 100644
index 420033dd6..000000000
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/hints/UiHintListenerConstants.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.quickstep.hints;
-
-public final class UiHintListenerConstants {
-
- private UiHintListenerConstants() {}
-
- // Operations
- public static final int ON_HINTS_RETURNED_CODE = 5;
-
- // Keys
- public static final String SESSION_ID_KEY = "session_id";
- public static final String HINTS_KEY = "hints";
-}
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/hints/UiInterfaceConstants.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/hints/UiInterfaceConstants.java
deleted file mode 100644
index 01406130f..000000000
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/hints/UiInterfaceConstants.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.quickstep.hints;
-
-public final class UiInterfaceConstants {
-
- private UiInterfaceConstants() {}
-
- // Operations
- public static final int ON_HINT_TAP_CODE = 4;
-
- public static final int REQUEST_HINTS_CODE = 7;
-
- // Keys
- public static final String SESSION_ID_KEY = "session_id";
- public static final String HINT_ID_KEY = "hint_id";
- public static final String WIDTH_PX_KEY = "width_px";
- public static final String HEIGHT_PX_KEY = "height_px";
- public static final String HINT_SPACE_WIDTH_PX_KEY = "hint_space_width_px";
- public static final String HINT_SPACE_HEIGHT_PX_KEY = "hint_space_height_px";
-}
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/LauncherRecentsView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/LauncherRecentsView.java
index 41628459c..8ad5f27c3 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/LauncherRecentsView.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/LauncherRecentsView.java
@@ -35,8 +35,6 @@ import android.os.Build;
import android.util.AttributeSet;
import android.view.View;
-import androidx.annotation.Nullable;
-
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
@@ -45,11 +43,8 @@ import com.android.launcher3.R;
import com.android.launcher3.anim.Interpolators;
import com.android.launcher3.appprediction.PredictionUiStateManager;
import com.android.launcher3.appprediction.PredictionUiStateManager.Client;
-import com.android.launcher3.util.PendingAnimation;
-import com.android.launcher3.views.BaseDragLayer;
import com.android.launcher3.views.ScrimView;
import com.android.quickstep.SysUINavigationMode;
-import com.android.quickstep.hints.ProactiveHintsContainer;
import com.android.quickstep.util.ClipAnimationHelper;
import com.android.quickstep.util.ClipAnimationHelper.TransformParams;
import com.android.quickstep.util.LayoutUtils;
@@ -61,8 +56,6 @@ import com.android.quickstep.util.LayoutUtils;
public class LauncherRecentsView extends RecentsView<Launcher> implements StateListener {
private final TransformParams mTransformParams = new TransformParams();
- private final int mChipOverhang;
- @Nullable private ProactiveHintsContainer mProactiveHintsContainer;
public LauncherRecentsView(Context context) {
this(context, null);
@@ -75,20 +68,10 @@ public class LauncherRecentsView extends RecentsView<Launcher> implements StateL
public LauncherRecentsView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
setContentAlpha(0);
- mChipOverhang = (int) context.getResources().getDimension(R.dimen.chip_hint_overhang);
mActivity.getStateManager().addStateListener(this);
}
@Override
- protected void onAttachedToWindow() {
- super.onAttachedToWindow();
- View hintContainer = mActivity.findViewById(R.id.hints);
- mProactiveHintsContainer =
- hintContainer instanceof ProactiveHintsContainer
- ? (ProactiveHintsContainer) hintContainer : null;
- }
-
- @Override
public void startHome() {
mActivity.getStateManager().goToState(NORMAL);
}
@@ -104,11 +87,6 @@ public class LauncherRecentsView extends RecentsView<Launcher> implements StateL
}
}
- @Nullable
- public ProactiveHintsContainer getProactiveHintsContainer() {
- return mProactiveHintsContainer;
- }
-
@Override
public void draw(Canvas canvas) {
maybeDrawEmptyMessage(canvas);
@@ -162,23 +140,6 @@ public class LauncherRecentsView extends RecentsView<Launcher> implements StateL
@Override
protected void getTaskSize(DeviceProfile dp, Rect outRect) {
LayoutUtils.calculateLauncherTaskSize(getContext(), dp, outRect);
- if (mProactiveHintsContainer != null) {
- BaseDragLayer.LayoutParams params = (BaseDragLayer.LayoutParams) mProactiveHintsContainer.getLayoutParams();
- params.bottomMargin = getHeight() - outRect.bottom - mChipOverhang;
- params.width = outRect.width();
- }
- }
-
- @Override
- public PendingAnimation createTaskLauncherAnimation(TaskView tv, long duration) {
- PendingAnimation anim = super.createTaskLauncherAnimation(tv, duration);
-
- if (mProactiveHintsContainer != null) {
- anim.anim.play(ObjectAnimator.ofFloat(
- mProactiveHintsContainer, ProactiveHintsContainer.HINT_VISIBILITY, 0));
- }
-
- return anim;
}
@Override
@@ -197,31 +158,6 @@ public class LauncherRecentsView extends RecentsView<Launcher> implements StateL
}
@Override
- public PendingAnimation createTaskDismissAnimation(TaskView taskView, boolean animateTaskView,
- boolean shouldRemoveTask, long duration) {
- PendingAnimation anim = super.createTaskDismissAnimation(taskView, animateTaskView,
- shouldRemoveTask, duration);
-
- if (mProactiveHintsContainer != null) {
- anim.anim.play(ObjectAnimator.ofFloat(
- mProactiveHintsContainer, ProactiveHintsContainer.HINT_VISIBILITY, 0));
- anim.addEndListener(onEndListener -> {
- if (!onEndListener.isSuccess) {
- mProactiveHintsContainer.setHintVisibility(1);
- }
- });
- }
-
- return anim;
- }
-
- public void setHintVisibility(float v) {
- if (mProactiveHintsContainer != null) {
- mProactiveHintsContainer.setHintVisibility(v);
- }
- }
-
- @Override
protected void onTaskLaunched(boolean success) {
if (success) {
mActivity.getStateManager().goToState(NORMAL, false /* animate */);
diff --git a/res/layout/launcher.xml b/res/layout/launcher.xml
index 9cab9c2a5..cca899bda 100644
--- a/res/layout/launcher.xml
+++ b/res/layout/launcher.xml
@@ -48,11 +48,6 @@
layout="@layout/overview_panel"
android:visibility="gone" />
- <include
- android:id="@+id/hints"
- layout="@layout/proactive_hints_container"
- android:visibility="gone"/>
-
<!-- Keep these behind the workspace so that they are not visible when
we go into AllApps -->
<com.android.launcher3.pageindicators.WorkspacePageIndicator
diff --git a/res/layout/proactive_hints_container.xml b/res/layout/proactive_hints_container.xml
deleted file mode 100644
index 2637f038c..000000000
--- a/res/layout/proactive_hints_container.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2016 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<Space
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="0dp"
- android:layout_height="0dp" /> \ No newline at end of file
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 0da56dafb..4bcb8a7f4 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -232,11 +232,6 @@
<dimen name="snackbar_min_text_size">12sp</dimen>
<dimen name="snackbar_max_text_size">14sp</dimen>
-<!-- Hints -->
- <dimen name="chip_hint_height">26dp</dimen>
- <dimen name="chip_hint_bottom_margin">194dp</dimen>
- <dimen name="chip_hint_overhang">15dp</dimen>
-
<!-- Theming related -->
<dimen name="default_dialog_corner_radius">8dp</dimen>
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index c1f898c5d..883e8c642 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -99,10 +99,6 @@ public class DeviceProfile {
public int folderChildTextSizePx;
public int folderChildDrawablePaddingPx;
- // Hints
- public int chipHintHeightPx;
- public int chipHintBottomMarginPx;
-
// Hotseat
public int hotseatCellHeightPx;
// In portrait: size = height, in landscape: size = width
@@ -200,9 +196,6 @@ public class DeviceProfile {
workspaceCellPaddingXPx = res.getDimensionPixelSize(R.dimen.dynamic_grid_cell_padding_x);
- chipHintHeightPx = res.getDimensionPixelSize(R.dimen.chip_hint_height);
- chipHintBottomMarginPx = res.getDimensionPixelSize(R.dimen.chip_hint_bottom_margin);
-
hotseatBarTopPaddingPx =
res.getDimensionPixelSize(R.dimen.dynamic_grid_hotseat_top_padding);
hotseatBarBottomPaddingPx = (isTallDevice ? 0