Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scrolls when changing tabs/fragment #272

Open
YJArc opened this issue May 27, 2017 · 0 comments
Open

Scrolls when changing tabs/fragment #272

YJArc opened this issue May 27, 2017 · 0 comments

Comments

@YJArc
Copy link

YJArc commented May 27, 2017

I'm using a FragmentTabHost and the ObservableScrollView to show a header with parallax image.
Anyways I notice that whenever I change tabs the ScrollView scrolls down the height of the image. It shouldn't even call scrollTo on tab changes.
I need it to not scroll when I change tabs so I can save the proper scroll position for the header so when the user comes back it looks exactly as they left it.

Anyways here is the Log
at com.github.ksoichiro.android.observablescrollview.ObservableScrollView.onScrollChanged(ObservableScrollView.java:81) at android.view.View.scrollTo(View.java:13358) at android.widget.ScrollView.scrollTo(ScrollView.java:1659) at android.view.View.scrollBy(View.java:13373) at android.widget.ScrollView.scrollToChild(ScrollView.java:1365) at android.widget.ScrollView.requestChildFocus(ScrollView.java:1459) at android.view.ViewGroup.requestChildFocus(ViewGroup.java:741) at android.view.View.handleFocusGainInternal(View.java:5958) at android.view.ViewGroup.handleFocusGainInternal(ViewGroup.java:717) at android.view.View.requestFocusNoSearch(View.java:9130) at android.view.View.requestFocus(View.java:9109) at android.view.ViewGroup.requestFocus(ViewGroup.java:2835) at android.widget.ScrollView.onRequestFocusInDescendants(ScrollView.java:1500) at android.view.ViewGroup.requestFocus(ViewGroup.java:2834) at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:2875) at android.view.ViewGroup.requestFocus(ViewGroup.java:2831) at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:2875) at android.view.ViewGroup.requestFocus(ViewGroup.java:2831) at android.view.View.requestFocus(View.java:9076) at android.widget.TabHost$2.onTabSelectionChanged(TabHost.java:160) at android.widget.TabWidget$TabClickListener.onClick(TabWidget.java:532) at android.view.View.performClick(View.java:5637) at android.view.View$PerformClick.run(View.java:22429) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6119) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

EDIT: resorted to using a Viewpager + TabLayout to fix the scoll when switching tabs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant