Initialize the RecyclerView as INVISIBLE.
Fixes: 33106612
Fixes: 33106867
Also, reinitialize the DragController in onResume() instead of
only on creation.
Change-Id: I6d2be61f07d1839472fddbbd5f88b00da90e3180
diff --git a/src/com/android/calculator2/HistoryFragment.java b/src/com/android/calculator2/HistoryFragment.java
index 5be3452..f0a5ea3 100644
--- a/src/com/android/calculator2/HistoryFragment.java
+++ b/src/com/android/calculator2/HistoryFragment.java
@@ -51,8 +51,6 @@
public void onClosed() {
// TODO: only cancel historical evaluations
mEvaluator.cancelAll(true);
-
- mDragController.resetAnimationInitialized();
}
@Override
@@ -168,10 +166,14 @@
}
mAdapter.notifyDataSetChanged();
+ }
- // Initialize the current expression element to dimensions that match the display to
- // avoid flickering and scrolling when elements expand on drag start.
- mDragController.animateViews(1.0f, mRecyclerView, mAdapter.getItemCount());
+ @Override
+ public void onStart() {
+ super.onStart();
+
+ // The orientation may have changed.
+ mDragController.initializeAnimation(mRecyclerView);
}
@Override