Fixed header elevation shadow on rotate
Change-Id: I1a4b55cf9af67d93e56d84378036c0061b6e8104
diff --git a/src/com/android/launcher3/BaseRecyclerView.java b/src/com/android/launcher3/BaseRecyclerView.java
index 401b699..45bc940 100644
--- a/src/com/android/launcher3/BaseRecyclerView.java
+++ b/src/com/android/launcher3/BaseRecyclerView.java
@@ -273,7 +273,7 @@
*
* @return the scroll top of this recycler view.
*/
- protected abstract int getCurrentScrollY();
+ public abstract int getCurrentScrollY();
/**
* Maps the touch (from 0..1) to the adapter position that should be visible.
diff --git a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
index c2be01f..93da297 100644
--- a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
@@ -375,7 +375,7 @@
}
@Override
- protected int getCurrentScrollY() {
+ public int getCurrentScrollY() {
// Return early if there are no items or we haven't been measured
List<AlphabeticalAppsList.AdapterItem> items = mApps.getAdapterItems();
if (items.isEmpty() || mNumAppsPerRow == 0 || getChildCount() == 0) {
diff --git a/src/com/android/launcher3/allapps/HeaderElevationController.java b/src/com/android/launcher3/allapps/HeaderElevationController.java
index e8f74eb..ce9837c 100644
--- a/src/com/android/launcher3/allapps/HeaderElevationController.java
+++ b/src/com/android/launcher3/allapps/HeaderElevationController.java
@@ -12,6 +12,7 @@
import android.view.ViewOutlineProvider;
import android.widget.FrameLayout;
+import com.android.launcher3.BaseRecyclerView;
import com.android.launcher3.R;
/**
@@ -28,7 +29,7 @@
@Override
public final void onScrolled(RecyclerView recyclerView, int dx, int dy) {
- mCurrentY += dy;
+ mCurrentY = ((BaseRecyclerView) recyclerView).getCurrentScrollY();
onScroll(mCurrentY);
}
diff --git a/src/com/android/launcher3/widget/WidgetsRecyclerView.java b/src/com/android/launcher3/widget/WidgetsRecyclerView.java
index 0975206..2560661 100644
--- a/src/com/android/launcher3/widget/WidgetsRecyclerView.java
+++ b/src/com/android/launcher3/widget/WidgetsRecyclerView.java
@@ -129,7 +129,7 @@
}
@Override
- protected int getCurrentScrollY() {
+ public int getCurrentScrollY() {
// Skip early if widgets are not bound.
if (isModelNotReady() || getChildCount() == 0) {
return -1;