diff options
author | Brian Attwell <brianattwell@google.com> | 2014-07-28 15:04:34 -0700 |
---|---|---|
committer | Brian Attwell <brianattwell@google.com> | 2014-07-28 15:05:40 -0700 |
commit | b80b4fe87efae6f09d544a8af294b7db9b50558f (patch) | |
tree | 9fa3f463959d404e3f409343742e17c5a2424f09 /src | |
parent | 778988df6b266c0e0e600254edf7e6f22bf3f596 (diff) | |
download | packages_apps_Contacts-b80b4fe87efae6f09d544a8af294b7db9b50558f.tar.gz packages_apps_Contacts-b80b4fe87efae6f09d544a8af294b7db9b50558f.tar.bz2 packages_apps_Contacts-b80b4fe87efae6f09d544a8af294b7db9b50558f.zip |
Don't save scroll position inside nested scroller
Delegate all saving/restoring to the parent scrollview.
Bug: 16555313
Change-Id: If2165b1b05eddf4ef923d27f3e9ba050a4e43288
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/contacts/widget/TouchlessScrollView.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/com/android/contacts/widget/TouchlessScrollView.java b/src/com/android/contacts/widget/TouchlessScrollView.java index 693dcbcf4..a0c0eb2b9 100644 --- a/src/com/android/contacts/widget/TouchlessScrollView.java +++ b/src/com/android/contacts/widget/TouchlessScrollView.java @@ -1,6 +1,7 @@ package com.android.contacts.widget; import android.content.Context; +import android.os.Parcelable; import android.util.AttributeSet; import android.view.MotionEvent; import android.widget.ScrollView; @@ -9,7 +10,7 @@ import android.widget.ScrollView; * A {@link ScrollView} that doesn't respond or intercept touch events. * * This is used in combination with {@link com.android.contacts.widget.MultiShrinkScroller} so - * that MultiShrinkScroller can handle all scrolling. + * that MultiShrinkScroller can handle all scrolling & saving. */ public class TouchlessScrollView extends ScrollView { @@ -25,6 +26,17 @@ public class TouchlessScrollView extends ScrollView { super(context, attrs, defStyleAttr); } + @Override + protected Parcelable onSaveInstanceState() { + // Do not save the current scroll position. Always store scrollY=0 and delegate + // responsibility of saving state to the MultiShrinkScroller. + final int scrollY = getScrollY(); + setScrollY(0); + final Parcelable returnValue = super.onSaveInstanceState(); + setScrollY(scrollY); + return returnValue; + } + /** * {@inheritDoc} */ |