Fix default getDateTranslationY.
Fixes: 33386389
Account for height of scaled formula.
Change-Id: I351e23c877a3b3a1390261d0512c36ee23c20810
diff --git a/src/com/android/calculator2/DragController.java b/src/com/android/calculator2/DragController.java
index 413df4c..7642a64 100644
--- a/src/com/android/calculator2/DragController.java
+++ b/src/com/android/calculator2/DragController.java
@@ -299,10 +299,10 @@
public float getDateTranslationY(float yFraction) {
// We also want the date to start out above the visible screen with
// this distance decreasing as it's pulled down.
+ // Account for the scaled formula height.
return -mToolbar.getHeight() * (1 - yFraction)
- + getResultTranslationY(yFraction)
- - mDisplayFormula.getPaddingTop() +
- (mDisplayFormula.getPaddingTop() * yFraction);
+ + getFormulaTranslationY(yFraction)
+ - mDisplayFormula.getHeight() /getFormulaScale(yFraction) * (1 - yFraction);
}
public float getHistoryElementTranslationY(float yFraction) {