Adding support for top padding in BaseRecyclerView. The scrollbar is

drawn below the top padding.
Also adding callback for getting the all-apps vertical pull range
so that it can be controlled by SearchUiManager

Bug: 37616877
Change-Id: Ib4642073f3e92f6676caede3bddd652fda89c86f
This commit is contained in:
Sunny Goyal
2017-05-12 08:17:35 -07:00
parent b0b30d23c0
commit dc19a07aba
9 changed files with 48 additions and 35 deletions

View File

@@ -26,6 +26,7 @@ import android.text.TextUtils;
import android.text.method.TextKeyListener;
import android.util.AttributeSet;
import android.view.KeyEvent;
import android.view.View;
import android.widget.FrameLayout;
import com.android.launcher3.ExtendedEditText;
@@ -192,4 +193,19 @@ public class AppsSearchContainerLayout extends FrameLayout
mElevationController.reset();
mAppsRecyclerView.onSearchResultsChanged();
}
@Override
public void addOnScrollRangeChangeListener(final OnScrollRangeChangeListener listener) {
mLauncher.getHotseat().addOnLayoutChangeListener(new OnLayoutChangeListener() {
@Override
public void onLayoutChange(View v, int left, int top, int right, int bottom,
int oldLeft, int oldTop, int oldRight, int oldBottom) {
if (!mLauncher.getDeviceProfile().isVerticalBarLayout()) {
listener.onScrollRangeChanged(top);
} else {
listener.onScrollRangeChanged(bottom);
}
}
});
}
}