summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/allapps
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2018-11-02 13:50:40 -0700
committerSunny Goyal <sunnygoyal@google.com>2018-11-05 13:36:41 -0800
commit876e462ffa47d297100a2c8c4427d749e1ed0ed8 (patch)
tree4407471b5acbfac0cdbbe9d6fbaa0879e2f40340 /src/com/android/launcher3/allapps
parent08584e18d6fa52ac382044b1b37aa506251899ee (diff)
downloadandroid_packages_apps_Trebuchet-876e462ffa47d297100a2c8c4427d749e1ed0ed8.tar.gz
android_packages_apps_Trebuchet-876e462ffa47d297100a2c8c4427d749e1ed0ed8.tar.bz2
android_packages_apps_Trebuchet-876e462ffa47d297100a2c8c4427d749e1ed0ed8.zip
Removing separate hotseat widget, instead using a QSB acroll all UI.
The QSB is responsible for updating its UI according to various states. Bug: 109828640 Change-Id: Ic8cbf3d404d5870de0f6b8fe25a332b8d21bae20
Diffstat (limited to 'src/com/android/launcher3/allapps')
-rw-r--r--src/com/android/launcher3/allapps/AllAppsTransitionController.java17
-rw-r--r--src/com/android/launcher3/allapps/SearchUiManager.java9
-rw-r--r--src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java9
3 files changed, 19 insertions, 16 deletions
diff --git a/src/com/android/launcher3/allapps/AllAppsTransitionController.java b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
index e7313e841..2d6be7b08 100644
--- a/src/com/android/launcher3/allapps/AllAppsTransitionController.java
+++ b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
@@ -91,11 +91,6 @@ public class AllAppsTransitionController implements StateHandler, OnDeviceProfil
return mShiftRange;
}
- private void onProgressAnimationStart() {
- // Initialize values that should not change until #onDragEnd
- mAppsView.setVisibility(View.VISIBLE);
- }
-
@Override
public void onDeviceProfileChanged(DeviceProfile dp) {
mIsVerticalLayout = dp.isVerticalBarLayout();
@@ -195,16 +190,15 @@ public class AllAppsTransitionController implements StateHandler, OnDeviceProfil
PropertySetter setter = config == null ? NO_ANIM_PROPERTY_SETTER
: config.getPropertySetter(builder);
int visibleElements = toState.getVisibleElements(mLauncher);
- boolean hasHeader = (visibleElements & ALL_APPS_HEADER) != 0;
boolean hasHeaderExtra = (visibleElements & ALL_APPS_HEADER_EXTRA) != 0;
boolean hasContent = (visibleElements & ALL_APPS_CONTENT) != 0;
Interpolator allAppsFade = builder.getInterpolator(ANIM_ALL_APPS_FADE, LINEAR);
- setter.setViewAlpha(mAppsView.getSearchView(), hasHeader ? 1 : 0, allAppsFade);
setter.setViewAlpha(mAppsView.getContentView(), hasContent ? 1 : 0, allAppsFade);
setter.setViewAlpha(mAppsView.getScrollBar(), hasContent ? 1 : 0, allAppsFade);
mAppsView.getFloatingHeaderView().setContentVisibility(hasHeaderExtra, hasContent, setter,
allAppsFade);
+ mAppsView.getSearchUiManager().setContentVisibility(visibleElements, setter, allAppsFade);
setter.setInt(mScrimView, ScrimView.DRAG_HANDLE_ALPHA,
(visibleElements & VERTICAL_SWIPE_INDICATOR) != 0 ? 255 : 0, LINEAR);
@@ -216,11 +210,6 @@ public class AllAppsTransitionController implements StateHandler, OnDeviceProfil
public void onAnimationSuccess(Animator animator) {
onProgressAnimationEnd();
}
-
- @Override
- public void onAnimationStart(Animator animation) {
- onProgressAnimationStart();
- }
};
}
@@ -247,13 +236,9 @@ public class AllAppsTransitionController implements StateHandler, OnDeviceProfil
*/
private void onProgressAnimationEnd() {
if (Float.compare(mProgress, 1f) == 0) {
- mAppsView.setVisibility(View.INVISIBLE);
mAppsView.reset(false /* animate */);
} else if (isAllAppsExpanded()) {
- mAppsView.setVisibility(View.VISIBLE);
mAppsView.onScrollUpEnd();
- } else {
- mAppsView.setVisibility(View.VISIBLE);
}
}
diff --git a/src/com/android/launcher3/allapps/SearchUiManager.java b/src/com/android/launcher3/allapps/SearchUiManager.java
index 68193f5c1..51b90f71e 100644
--- a/src/com/android/launcher3/allapps/SearchUiManager.java
+++ b/src/com/android/launcher3/allapps/SearchUiManager.java
@@ -16,6 +16,9 @@
package com.android.launcher3.allapps;
import android.view.KeyEvent;
+import android.view.animation.Interpolator;
+
+import com.android.launcher3.anim.PropertySetter;
/**
* Interface for controlling the Apps search UI.
@@ -37,4 +40,10 @@ public interface SearchUiManager {
* some UI beforehand.
*/
void preDispatchKeyEvent(KeyEvent keyEvent);
+
+ /**
+ * Called as part of state transition to update the content UI
+ */
+ void setContentVisibility(int visibleElements, PropertySetter setter,
+ Interpolator interpolator);
}
diff --git a/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java b/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java
index 15cc2caae..b1e23d4e2 100644
--- a/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java
+++ b/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java
@@ -19,6 +19,7 @@ import static android.view.View.MeasureSpec.EXACTLY;
import static android.view.View.MeasureSpec.getSize;
import static android.view.View.MeasureSpec.makeMeasureSpec;
+import static com.android.launcher3.LauncherState.ALL_APPS_HEADER;
import static com.android.launcher3.icons.IconNormalizer.ICON_VISIBLE_AREA_FACTOR;
import android.content.Context;
@@ -32,6 +33,7 @@ import android.util.AttributeSet;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup.MarginLayoutParams;
+import android.view.animation.Interpolator;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.ExtendedEditText;
@@ -42,6 +44,7 @@ import com.android.launcher3.allapps.AllAppsContainerView;
import com.android.launcher3.allapps.AllAppsStore;
import com.android.launcher3.allapps.AlphabeticalAppsList;
import com.android.launcher3.allapps.SearchUiManager;
+import com.android.launcher3.anim.PropertySetter;
import com.android.launcher3.graphics.TintedDrawableSpan;
import com.android.launcher3.util.ComponentKey;
@@ -214,4 +217,10 @@ public class AppsSearchContainerLayout extends ExtendedEditText
insets.bottom + mlp.topMargin + mFixedTranslationY);
}
}
+
+ @Override
+ public void setContentVisibility(int visibleElements, PropertySetter setter,
+ Interpolator interpolator) {
+ setter.setViewAlpha(this, (visibleElements & ALL_APPS_HEADER) != 0 ? 1 : 0, interpolator);
+ }
}