Disable ScrollView Programmatically?

Several points to begin with: You cannot disable the scrolling of a ScrollView. You would need to extend to ScrollView and override the onTouchEvent method to return false when some condition is matched. The Gallery component scrolls horizontally regardless of whether it is in a ScrollView or not – a ScrollView provides only vertical scrolling … Read more

Can I scroll a ScrollView programmatically in Android?

The answer from Pragna does not work always, try this: mScrollView.post(new Runnable() { public void run() { mScrollView.scrollTo(0, mScrollView.getBottom()); } }); or mScrollView.post(new Runnable() { public void run() { mScrollView.fullScroll(mScrollView.FOCUS_DOWN); } }); if You want to scroll to start mScrollView.post(new Runnable() { public void run() { mScrollView.fullScroll(mScrollView.FOCUS_UP); } });

Recyclerview inside ScrollView not scrolling smoothly

Try doing: RecyclerView v = (RecyclerView) findViewById(…); v.setNestedScrollingEnabled(false); As an alternative, you can modify your layout using the support design library. I guess your current layout is something like: <ScrollView > <LinearLayout > <View > <!– upper content –> <RecyclerView > <!– with custom layoutmanager –> </LinearLayout > </ScrollView > You can modify that to: … Read more

Android – how to make a scrollable constraintlayout?

It seems that it is working, I don’t know what dependency you were working with but in this one compile ‘com.android.support.constraint:constraint-layout:1.0.2’ Is working, this is what I did <?xml version=”1.0″ encoding=”utf-8″?> <ScrollView xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto” xmlns:tools=”http://schemas.android.com/tools” android:layout_width=”match_parent” android:layout_height=”match_parent” tools:context=”.MainActivity”> <android.support.constraint.ConstraintLayout android:layout_width=”match_parent” android:layout_height=”wrap_content”> <android.support.design.widget.TextInputLayout android:id=”@+id/til_input” android:layout_width=”0dp” android:layout_height=”wrap_content” android:hint=”Escriba el contenido del archivo” app:layout_constraintLeft_toLeftOf=”parent” app:layout_constraintRight_toLeftOf=”@+id/btn_save” app:layout_constraintTop_toTopOf=”@id/btn_save” app:layout_constraintVertical_chainStyle=”spread”> <EditText … Read more

HorizontalScrollView within ScrollView Touch Handling

Update: I figured this out. On my ScrollView, I needed to override the onInterceptTouchEvent method to only intercept the touch event if the Y motion is > the X motion. It seems like the default behavior of a ScrollView is to intercept the touch event whenever there is ANY Y motion. So with the fix, … Read more

Android list view inside a scroll view

For any Child view to scroll inside a ScrollView. Anything like ListView, RecyclerView, etc. You just have to replace ScrollView with androidx.core.widget.NestedScrollView in your current xml and then magic happens. Below is a sample xml code : <?xml version=”1.0″ encoding=”utf-8″?> <androidx.core.widget.NestedScrollView xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto” android:layout_width=”match_parent” android:layout_height=”match_parent”> <androidx.appcompat.widget.LinearLayoutCompat android:layout_width=”match_parent” android:layout_height=”wrap_content” android:orientation=”vertical” android:padding=”16dp” android:paddingBottom=”20dp”> <TextView android:layout_width=”match_parent” android:layout_height=”wrap_content” android:text=”Recycler … Read more