android-recyclerview

Recycler View not giving the correct position after scrolling

夙愿已清 提交于 2019-12-10 23:10:35
问题 I have used GridView with number of columns 1 and used adapter in which I am using a recyclerView for horizontal scroll. To be clear I have a gridview as the main view in which recyclerview is used in adapter. All the elements are shown in the view as accordingly but after i scroll the position that I am getting is not the correct position.The Adapter for recycler view is : public class HorizontalRecyclerViewAdapter extends RecyclerView.Adapter<HorizontalRecyclerViewAdapter.ViewHolder>{

IndexOutofBounexception in search adapter onbind method?

吃可爱长大的小学妹 提交于 2019-12-10 23:09:39
问题 I keep getting IndexOutofBoundsException from my onBind method in search adapter as soon as I start to search /filter my recyclerview list results. Here's the exception : java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid item position 0(offset:0).state:25 android.support.v7.widget.RecyclerView{3247b3d VFED..... ......ID 0,0-1440,5550 #7f090216 app:id/search_guests_recycler_view}, adapter:com.myapp.ui.registervisitor.searchGuests.SearchGuestListAdapter@2433f32, layout

espresso select first match of row in RecyclerView which descendant matching to specific text

℡╲_俬逩灬. 提交于 2019-12-10 23:05:07
问题 I would like to click on the first matching row in recyclerView which item has descendant matching to specific text. For now, I have onView(withId(R.id.news)).perform( actionOnItem(hasDescendant(withText("text")),click()) ) which throws ambiguousViewMatcherException. I tried to add first matcher from here onView(withId(R.id.news)).perform( actionOnItem(hasDescendant(first(withText("text"))),click()) ) but it time out. public static Matcher<View> first(Matcher<View> expected ){ return new

Vertical scroll the RecyclerView in Android by pixels

风流意气都作罢 提交于 2019-12-10 22:49:23
问题 In my chat app I use RecyclerView and LayoutManager for showing chat messages list. I have a case when user browse old messages and new message arrives. At that point I want to scroll chat by small distance to acknowledge user of received new message. I need to scroll my RecyclerView by distance in pixels. I found that LayoutManager has method scrollVerticallyBy() , public int scrollVerticallyBy (int dy, RecyclerView.Recycler recycler, RecyclerView.State state) But I got confused by

RecylerView Adapter in android Firebase is not quite syncing

守給你的承諾、 提交于 2019-12-10 22:38:55
问题 I am creating a program, where user can update post, and other user and same user can react there. For that, I have implemented the love button. So this works this way, I have saved a unique id in the DatabaseReference and other reference for uniquekey for easiness. So, whenever, the user clicks on love button, it must update the total reaction of the node by increasing it to one. The problem I am getting is, whenever I press the love button key, it doesn't call the uniqueID I need. The

ActionBar covering my activity

女生的网名这么多〃 提交于 2019-12-10 22:31:00
问题 I have an activity whose xml is: <?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_height="match_parent" android:fitsSystemWindows="true" tools:context="ivykoko.com.likechecker.MainActivity"> <android.support.v7.widget.RecyclerView xmlns:android=

OnSwipe method not working in RecyclerView

狂风中的少年 提交于 2019-12-10 22:09:57
问题 I'm working on an app for playing audio files. Created a tab layout with 2 tabs. Used fragment in both of them with RecyclerView being used in both of them. The fragment named LibraryFragment has this RecycleView whose items when Swipped must pass on to the HomeFragment , that's what I wanna do. But even though swiping animation is happening, OnSwipe method doesn't works at all. This is the method I've used to provide the swiping function to my recyclerview's items under the LibraryFragment .

RecyclerView shows just one item from Firebase

二次信任 提交于 2019-12-10 21:19:15
问题 I know there are few questions about this problem. But none of them didn't solve my problem especially my code is in Kotlin and new working with Fragments . Don't rush to say my question is duplicated. My problem is exactly what title said, my RecyclerView is populated just with one item(child) from Firebase in my Fragment . Adapter: class NewsList(private val userList: List<News>) : RecyclerView.Adapter<NewsList.ViewHolder>() { private val Context = this override fun onBindViewHolder(p0:

In Android, what Layout is faster 1. FrameLayouts inside LinearLayout or 2. One big RelativeLayout?

走远了吗. 提交于 2019-12-10 21:15:18
问题 I am considering two different layout arrangements for a view (which will be a row in a RecyclerView). They are different, but they will both work, either as One container vertical LinearLayout containing rows of FrameLayouts e.g. LinearLayout -> FrameLayouts -> Content One big RelativeLayout that contains all other views (no FrameLayouts but all TextViews, Buttons and such) e.g. RelativeLayout -> Content Now I was wondering: which one would be more preferable in terms of Layout performance?

Horizontal and Vertical RecyclerView under the same scroll

蓝咒 提交于 2019-12-10 20:04:36
问题 I have to do something like Instagram does. I have a horizontal RecyclerView for stories, and, below, a vertical RecyclerView for feed. I want to accomplish the same scroll behavior(the stories should go with feed at scroll, not stay on top as fixed). The only solution I found is NestedScrollView but it makes extremely bad performance for RecyclerViews, my screen freezes almost forever. I tried a lot of tricks found here like nestedScrollEnabled, autoLayoutMeasure etc. but nothing worked.