nestedscrollview

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">

RecyclerView calling onCreateViewHolder and onBindViewHolder for all items at once

你说的曾经没有我的故事 提交于 2019-12-05 04:08:28
I have a recyclerView capable of showing the maximum of 3 items on screen, but it calls onCreateViewHolder and onBindViewHolder for all 45 items in the list, all at once (as in the LOG below). Shouldn't it be calling those methods only as I scroll those items to the screen? *I am using a list with 0's and 1's as a test to define which layout it should use. My Adapter Code public class MyRecyclerAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { int[] post_list; private static final int TYPE_0 =0; private static final int TYPE_1=1; private LayoutInflater inflater; private Context

Hide FAB in NestedScrollView when scrolling

試著忘記壹切 提交于 2019-12-04 19:31:12
问题 I am having a nestedscrollview with content like some linearlayouts and textviews. I am using a floatingactionbutton library for some reasons, as well. So I can't use any behavior for it. I don't know how I should handle the scrollchangelistener from scrollview to hide and show the fab dynamically like a behavior. Any suggestions how to hide and show the fab while scrolling? 回答1: Simple add this code below to your NestedScrollView ScrollChangeListener: NestedScrollView nsv = v.findViewById(R

Hide a Floating Action Button of another Layout

…衆ロ難τιáo~ 提交于 2019-12-04 04:02:29
I have a FloatingActionButton inside of may activity_main.xml layout which is named fabBtn . My application is built with a ViewPager and three Fragment s.I want to hide the FloatingActionButton when my first Fragment detects a scroll, but I keep getting a NullPointerException if the user starts scrolling. I believe it could be that my fragment can't get the FloatingActionButton from the activity_main.xml layout? Here is my activity_main.xml <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"

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

android - CoordinatorLayout/NestedScrollView/Hide-Show Toolbar/Issue with WebView

谁说胖子不能爱 提交于 2019-12-03 12:07:49
I have a problem with that : <?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/apk/res-auto" android:id="@+id/coordinatorLayout" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.design.widget.AppBarLayout android:id="@+id/appBarLayout" android:layout_width="match_parent" android:layout_height="wrap_content"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout

NestedScrollView scrolls to top on Recyclerview resized

被刻印的时光 ゝ 提交于 2019-12-03 03:38:19
问题 I have a NestedScrollView containing a LinearLayout and a RecyclerView (both inside a RelativeLayout). <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.v4.widget.NestedScrollView android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/scroll"> <RelativeLayout

WebView in CoordinatorLayout with CollapsingToolbarLayout

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'd like to add a WebView in a CoordinatorLayout, having CollapsingToolbarLayout in AppBarLayout. The problem is that WebView shrinks in height and doesn't fill the space below the toolbar, making it not usable. I tried also to use WebView as child of NestedScrollView: initially it doesn't work (it shrinks my WebView in height), but scrolling my shrinked WebView makes it fill viewport. Here is the layout I used: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout android:id="@+id/main_content" xmlns

NestedScrollView scrolls to top on Recyclerview resized

房东的猫 提交于 2019-12-02 17:58:47
I have a NestedScrollView containing a LinearLayout and a RecyclerView (both inside a RelativeLayout). <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.v4.widget.NestedScrollView android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/scroll"> <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/lay_account">

CoordinatorLayout + AppBarLayout + ToolBar

我与影子孤独终老i 提交于 2019-12-02 06:12:43
主要参考了 http://blog.csdn.net/leejizhou/article/details/50533020, 然后做了 一个自己的例子 首先是引入sdk compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.android.support:design:23.1.1' compile 'com.android.support:appcompat-v7:23.1.1' 其实 这一部份主要是布局上操作, 代码没有什么内容 需求一 页面有scroll内容时, toolbar 在上滑时隐藏,下滑时显示,详情见注释部分 <?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/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout