android-nestedscrollview

Pass touch event from NestedScrollView to parent view's

吃可爱长大的小学妹 提交于 2019-12-05 21:14:48
I have a ViewPager below a NestedScrollView width some top padding, and clipToPadding(false) and transparent background (like as image). My ViewPager can't get touch event and doesn't work. How can I solve this problem? (I can't change my structure and can't move ViewPager to above of NestedScrollView or set TopMargin to NestedScrollView) NestedScrollView nestedScrollView = new NestedScrollView(getContext()); nestedScrollView.setFillViewport(true); nestedScrollView.setLayoutParams(scrollParams); nestedScrollView.setClipToPadding(false); Solution: This Problem solved With overwriting

Recyclerview scrollToPosition doesn't work with NestedScrollView ? Is there anyway?

橙三吉。 提交于 2019-12-05 12:13:58
So I have a Recyclerview within a NestedScrollView . When I say recycleview.scrollToPosition(X) or recycleview.getLayoutManager().scrollToPosition(X) it doesn't work at all. If I move the recycleview out from the nestedScrollView it works fine, but I can't do it, because of the layout structure! Any idea? scrollingView.requestChildFocus(recyclerView,recyclerView); tried this, but not focusing on a certain position make your recyclerview like this <LinearLayout android:id="@+id/ll2" android:focusableInTouchMode="true" android:layout_width="match_parent" android:layout_height="wrap_content">

Bad performance when use RecyclerView inside NestedScrollView

半世苍凉 提交于 2019-12-05 04:42:48
I'm developing a search contact feature, in that screen, there is a RecyclerView inside NestedScrolView ( fillViewport = true ). Screen design: ( This design is accepted by customer, I can't change it ) After loading all contacts of current device into an ArrayList, the search results are filtered from this array. There is several cases that make the app very laggy : 1. When user type an input that have no result , then user clear search , I have to show all results again. The NestedScrollView has to render UI for all items of RecyclerView (for example: 300 items). 2. When the quantity of

How to get percentage of scroll in NestedScrollView any time (smoothly)?

流过昼夜 提交于 2019-12-04 21:21:35
问题 I want to change the alpha of toolbar base on scroll, like below: At first, the toolbar is transparent and by scrolling to the bottom it will more and more visible and at the end it will be fully opaque (visible). The structure of my layout is: <android.support.design.widget.CoordinatorLayout 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"> <android.support

Recycler View loading very slow for large data when inside NestedScrollView

╄→гoц情女王★ 提交于 2019-12-04 18:38:18
问题 I have added RecyclerView inside my NestedScrollView . Basically I want RecyclerView to scroll with other Views. The problem that I am facing is that for a small set of data, it is working fine, but for a large set of data(200 entries) whenever I launch the activity, it freezes for about about 3-5 seconds and then loads. I removed the NestedScrollView and it is working flawlessly, but it doesn't provide me the behaviour I want. (For extra info, I am loading the data from SQLite database.

How to use RecyclerView inside NestedScrollView

寵の児 提交于 2019-12-04 03:33:01
问题 I have this layout: <android.support.v4.widget.NestedScrollView android:id="@+id/scrollview" android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:id="@+id/content" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <--There is some layouts here--> <RecyclerView android:id="@+id/recycler_view" android:layout_width="match_parent" android:layout_height="match_parent"/> </LinearLayout> </android

RecyclerView inside NestedScrollView onBindViewHolder calling for all getItemCount size

我的梦境 提交于 2019-12-04 03:03:58
When I put RecyclerView inside NestedScrollView then onBindViewHolder is calling for all row like say I have list which has size of 30 then onBindViewHolder is called for all 30 rows at one time even without scrolling RecyclerView list; LinearLayoutManager layoutManager = new LinearLayoutManager(getContext()); list.setLayoutManager(layoutManager); layoutManager.setAutoMeasureEnabled(true); list.setNestedScrollingEnabled(false); list.addItemDecoration(new VerticalSpaceItemDecoration(5)); list.setAdapter(adapter); my xml is <android.support.v4.widget.NestedScrollView android:layout_width="match

Programmatically scroll to the top of a NestedScrollView

时间秒杀一切 提交于 2019-12-03 18:31:51
问题 Is there a way to programmatically scroll to the top of a NestedScrollView by also triggering the scroll events for the parent? smoothScrollTo(x, y) doesn't delegate the scroll events to the NestedScrollingParent . 回答1: NestedScrollView.scrollTo(0, 0); 回答2: I managed to do it (animated scrolling): CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) appBarLayout.getLayoutParams(); AppBarLayout.Behavior behavior = (AppBarLayout.Behavior) params.getBehavior(); if (behavior !

RecyclerView scroll dosen't work with NestedScrollView

空扰寡人 提交于 2019-12-03 16:13:35
I have a layout where I have a NestedScrollView containing an Image, multiple buttons and a RecycleView. When I say recycleView.smoothScrollToPosition or recycleView.scrollToPosition() it doesn't do anything at the moment. Refuse to scroll even a pixel. If I remove the NestedScrollView it works fine, but in case I lose the scrolling effect on the surrounding areas. Does any of you met with this problem before? <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com

Recycler View loading very slow for large data when inside NestedScrollView

允我心安 提交于 2019-12-03 12:49:54
I have added RecyclerView inside my NestedScrollView . Basically I want RecyclerView to scroll with other Views. The problem that I am facing is that for a small set of data, it is working fine, but for a large set of data(200 entries) whenever I launch the activity, it freezes for about about 3-5 seconds and then loads. I removed the NestedScrollView and it is working flawlessly, but it doesn't provide me the behaviour I want. (For extra info, I am loading the data from SQLite database. There is no problem in scrolling, as it is smooth. The only problem is the activity is freezing for a while