android-recyclerview

get scroll Y of RecyclerView or Webview

纵然是瞬间 提交于 2019-12-21 04:08:30
问题 I have created a activity Webview content placed in Recyclerview . I want to get the scroll Y position when I scroll webview. I tried Webview.getScrollY() , Webview.getY() , RecyclerView.getScrollY() , RecyclerView.getY() ,... but it do not work fine. I can't get current scroll Y. Is there any suggest for get scroll Y of Webview or RecyclerView ? 回答1: Use a RecyclerView.OnScrollListener for the RecyclerView and a View.OnScrollChangeListener for the webview. You'll have to keep track of the

Set RecyclerView edge glow pre-lollipop when using appcompat

做~自己de王妃 提交于 2019-12-21 02:53:09
问题 I'm looking for a way to style the color of the over scroll indicator in a RecyclerView pre-lollip when using the appcompat material theme. Internally it uses an EdgeEffect set to a internal styleable attribute that can't be set unless your already on lollipop (ironic). Using reflection doesn't work, setting the color of the EdgeEffect is only possible on lollipop too. On my API21 app it draws from the primary material color, on Kitkat it is white, before that it is holo blue and I'm looking

Use Single Fragment in Multiple tabs of ViewPager

半城伤御伤魂 提交于 2019-12-21 02:52:09
问题 I am using ViewPager to slide left and right, I have also added the tabs, The number of tabs is depends on the server data, So, I cannot make the number of tabs as Fixed. To do this I used only Single Fragment and a RecyclerView to display JSON Data in the recyclerView. When First app launches, the data which should be shown in 2nd tab is getting displayed in 1st Tab itself. After I swipe to 3rd Tab and come Back again to 1st Tab, then the data is displaying correctly. It is as same as

RecyclerView with fixed column and header, plus scrollable footer

旧城冷巷雨未停 提交于 2019-12-21 01:59:28
问题 I am trying to find a way to implement a standing table for a sports app (like NBA Game Time standings), with a fixed header, fixed first column and a footer. I searched a bit on how to get it, but the best shot was this project (https://github.com/InQBarna/TableFixHeaders) but it uses its own view instead of Recycler of GridView. Do anyone knows something like this or knows how I can start with it (Adapter or LayoutManager)? Edit (adding images) 回答1: After testing and searching a lot, I

Dealing With RecyclerView, NestedScrollView, and CardView

淺唱寂寞╮ 提交于 2019-12-21 01:57:13
问题 I'm going to achieve this UI in my App: Well, Some ways that I tried before: 1. Using CollapsingToolbarLayout I put my CardView insid of CollapsingToolbarLayout and put them all in AppBarLAyout. <android.support.design.widget.CoordinatorLayout android:layout_width="match_parent" android:layout_height="match_parent" > <android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

Android RecyclerView smooth scroll to view that's animating their height

不想你离开。 提交于 2019-12-21 01:12:52
问题 I have a RecyclerView with Expandable Child Views, when the child ViewGroup is clicked it inflates an amount of views animating the ViewGroup height from 0 to the measured viewgroup height, like the following gif: The problem is: I'm calling smoothScrollToPosition on recyclerView, it smooth scroll to the view position, but it considers the current view height, which is still not expanded, in the above gif i'm touching on the under view of the recyclerview, which dont scroll to position

Android RecyclerView smooth scroll to view that's animating their height

青春壹個敷衍的年華 提交于 2019-12-21 01:12:32
问题 I have a RecyclerView with Expandable Child Views, when the child ViewGroup is clicked it inflates an amount of views animating the ViewGroup height from 0 to the measured viewgroup height, like the following gif: The problem is: I'm calling smoothScrollToPosition on recyclerView, it smooth scroll to the view position, but it considers the current view height, which is still not expanded, in the above gif i'm touching on the under view of the recyclerview, which dont scroll to position

RecyclerView: java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid item position

╄→гoц情女王★ 提交于 2019-12-20 23:36:32
问题 I've started getting this crash reported on Crashlytics. I have no idea how to reproduce it but it all appears to be code internal to the RecyclerView . I think this comes from a RecyclerView I have which never really changes. The user can refresh it but then all items are replaced and notifyDataSetChanged is called. java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid item position 5(offset:5).state:7 at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition

RecyclerView: java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid item position

◇◆丶佛笑我妖孽 提交于 2019-12-20 23:35:07
问题 I've started getting this crash reported on Crashlytics. I have no idea how to reproduce it but it all appears to be code internal to the RecyclerView . I think this comes from a RecyclerView I have which never really changes. The user can refresh it but then all items are replaced and notifyDataSetChanged is called. java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid item position 5(offset:5).state:7 at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition

Is it possible to have the last item in a RecyclerView to be docked to the bottom if there is no need to scroll?

谁说我不能喝 提交于 2019-12-20 21:39:23
问题 I'm building a shopping cart RecyclerView that displays all the items in the cart in a RecyclerView, as well as it has an additional view at the bottom that summarizes the cart (total owing, coupon discount if applicable, etc). If there's > 3 items in the cart, it looks fine as the user will have to scroll to the bottom to view the "summary view". However, if there's 1 or 2 items, the first items appear, than the summary view, then whitespace. I'd rather the first items, then whitespace, then