Tie prediction text to all apps interpolator

Now floating headers get 2 interpolators: one for the header content
itselt, and one for the all apps content that follows. That way, they
can choose to intperolate part of their content as if it were part of
all apps instead of the header. Currently, we do this to animate
predicted icons quickly, followed by the all apps icons, predictions
text, all apps scrollbar, and all apps divider as you continue swiping.

Bug: 132455160
Change-Id: Ib3e373c291e174e1306a53854d0ad4dc29eb4b76
This commit is contained in:
Tony Wickham
2019-06-18 17:04:49 -07:00
parent c088051c29
commit 35a4e0eec9
9 changed files with 68 additions and 46 deletions

View File

@@ -27,6 +27,10 @@ import android.view.ViewGroup;
import android.view.animation.Interpolator;
import android.widget.LinearLayout;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Insettable;
import com.android.launcher3.Launcher;
@@ -40,10 +44,6 @@ import com.android.systemui.plugins.PluginListener;
import java.util.ArrayList;
import java.util.Map;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;
public class FloatingHeaderView extends LinearLayout implements
ValueAnimator.AnimatorUpdateListener, PluginListener<AllAppsRow>, Insettable,
OnHeightUpdatedListener {
@@ -363,14 +363,14 @@ public class FloatingHeaderView extends LinearLayout implements
p.y = getTop() - mCurrentRV.getTop() - mParent.getTop();
}
public void setContentVisibility(boolean hasHeader, boolean hasContent, PropertySetter setter,
Interpolator fadeInterpolator) {
public void setContentVisibility(boolean hasHeader, boolean hasAllAppsContent,
PropertySetter setter, Interpolator headerFade, Interpolator allAppsFade) {
for (FloatingHeaderRow row : mAllRows) {
row.setContentVisibility(hasHeader, hasContent, setter, fadeInterpolator);
row.setContentVisibility(hasHeader, hasAllAppsContent, setter, headerFade, allAppsFade);
}
allowTouchForwarding(hasContent);
setter.setFloat(mTabLayout, ALPHA, hasContent ? 1 : 0, fadeInterpolator);
allowTouchForwarding(hasAllAppsContent);
setter.setFloat(mTabLayout, ALPHA, hasAllAppsContent ? 1 : 0, headerFade);
}
protected void allowTouchForwarding(boolean allow) {