android-scroll

Where does Android View.scrollTo(x, y) scroll to?

邮差的信 提交于 2019-11-26 09:25:56
问题 scrollTo(int x, int y) says: x the x position to scroll to y the y position to scroll to onScrollChanged(int l, int t, int oldl, int oldt) says: l Current horizontal scroll origin. t Current vertical scroll origin. What I would like to know and can\'t find anywhere, is where is x,y? Top left? Center? I tried a few tests and can\'t figure it out. 回答1: After extensive research and testing I've finally understood how scrollTo() works. (0,0) are the coordinates to the top left corner of the View

Recyclerview inside ScrollView not scrolling smoothly

你。 提交于 2019-11-26 06:14:04
问题 For my app I am using a RecyclerView inside a ScrollView where the RecyclerView has a height based on its content using this library. Scrolling is working but it\'s not working smoothly when I scroll over the RecyclerView . When I scroll over the ScrollView itself it is scrolling smoothly. The code I am using to define the RecyclerView : LinearLayoutManager friendsLayoutManager = new LinearLayoutManager(getActivity().getApplicationContext(), android.support.v7.widget.LinearLayoutManager

Disable scrolling in webview?

别等时光非礼了梦想. 提交于 2019-11-26 00:30:22
Until now I have been an iPhone developer only and now I have decided to give Android a whirl. Something I haven't been able to figure out on Android is how to programmatically prevent scrolling in a WebView ? Something similar to iPhones prevention of the onTouchMove event would be great! peceps Here is my code for disabling all scrolling in webview: // disable scroll on touch webview.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { return (event.getAction() == MotionEvent.ACTION_MOVE); } }); To only hide the scrollbars, but not