am 8f25f323: am 1e16d8b0: am fff7ad26: Fix bugs MultiShrinkScroller#snapToBottom()
* commit '8f25f3230216a7fe167837a77be920e82e5a54ac':
Fix bugs MultiShrinkScroller#snapToBottom()
diff --git a/src/com/android/contacts/widget/MultiShrinkScroller.java b/src/com/android/contacts/widget/MultiShrinkScroller.java
index 5f8bc14..ff84b2f 100644
--- a/src/com/android/contacts/widget/MultiShrinkScroller.java
+++ b/src/com/android/contacts/widget/MultiShrinkScroller.java
@@ -535,11 +535,23 @@
if (mHasEverTouchedTheTop) {
// If QuickContacts has touched the top of the screen previously, then we
// will less aggressively snap to the bottom of the screen.
- final float predictedScrollPastTop = -getScroll() + mIntermediateHeaderHeight
+ final float predictedScrollPastTop = -getScroll() + mTransparentStartHeight
- flingDelta;
- final float heightMinusHeader = getHeight() - mIntermediateHeaderHeight;
- if (predictedScrollPastTop > heightMinusHeader) {
- scrollOffBottom();
+ final boolean isLandscape = getResources().getConfiguration().orientation
+ == Configuration.ORIENTATION_LANDSCAPE;
+ if (isLandscape) {
+ // In landscape orientation, we dismiss the QC once it goes below the starting
+ // starting offset that is used when QC starts in collapsed mode.
+ if (predictedScrollPastTop > mTransparentStartHeight) {
+ scrollOffBottom();
+ }
+ } else {
+ // In portrait orientation, we dismiss the QC once it goes below
+ // mIntermediateHeaderHeight within the bottom of the screen.
+ final float heightMinusHeader = getHeight() - mIntermediateHeaderHeight;
+ if (predictedScrollPastTop > heightMinusHeader) {
+ scrollOffBottom();
+ }
}
return;
}