RecyclerView steals focus when inside a NestedScrollView
Make your top view focusable. "RecyclerView has "focusableOnTouchMode" set to true to handle its childrens' focus changes during layout." Relevant discussion of the issue.
Example:
<android.support.v4.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusableInTouchMode="true"
android:orientation="vertical">
<View
android:id="@+id/someView"
android:layout_width="wrap_content"
android:layout_height="350dp"/>
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
How to remove focus from RecyclerView inside ScrollView?
This problem because of recyclerView has default focus.
Solution
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants"
android:orientation="vertical">
Add android:descendantFocusability="blocksDescendants"
to your immediate layout of scrollView
Android prevent nested recyclerview from automatically repositioning
you can add this attribute to your linear layout. The Linear Layout direct child of your scrollView.
android:descendantFocusability="blocksDescendants"
Related Topics
Can an Aar Include Transitive Dependencies
Understanding Android's <Layer-List>
Can't Upgrade Android Sdk Tools
How to Use Google Login API with Cordova/Phonegap
Android Progressbar UI Custom Layout
Android: When Is Oncreateoptionsmenu Called During Activity Lifecycle
Best Way to Update Data with a Recyclerview Adapter
How to Populate Android Room Database Table on First Run
Emulator Appearing Offline on M1 MAC After the Last Update of Arm64-V8A
On Android 8.1 API 27 Notification Does Not Display
How to Make an Intent with Multiple Actions
Developing a Custom Lock Screen
Highlight Custom Listview Item When Long Click
After Upgrading to Google Play Services 9.0.0, App Hangs in Dynamitemodulesc
Android:Split the Screen in 2 Equals Parts with 2 Listviews
Interstitial Admob Ads: "Illegalstateexception: Only Fullscreen Activities Can Request Orientation"