android-recyclerview

RecyclerView inside NestedScrollView does not give correct visible item position

孤街浪徒 提交于 2019-12-19 10:17:37
问题 I have a RecyclerView inside a NestedScrollView and I'm trying to get the position of the last visible list item during scroll events using. The following code allows me to reliably detect scroll events: val recyclerView = nestedScrollView.getChildAt(0) as RecyclerView nestedScrollView.setOnScrollChangeListener { v: NestedScrollView?, scrollX: Int, scrollY: Int, oldScrollX: Int, oldScrollY: Int -> val layoutManager = recyclerView?.layoutManager as? LinearLayoutManager val lastVisiblePosition

How to delete rows from recyclerView and sqlite database both?

蹲街弑〆低调 提交于 2019-12-19 10:15:50
问题 I'm creating an app with recycler view and SQLite database. When user enters some data, it is displayed in recycler view and also added to my database. Now I want to implement delete functionality in recycler view. What I want: I want to delete the required row from database and also from recycler view at the same time, without getting any unexpected results. And all the rows should be deleted. What I've Tried: I've implemented onLongClickListener on cardView of recycler view (I'm using

How to get the Edit text position from Recycler View adapter using Text Watcher in android

谁说胖子不能爱 提交于 2019-12-19 09:44:24
问题 I want to know how to get position of Edit Text from Recycler View adapter.I used Card View with in that horizontal Linear Layout has three view TextView,EditText view and TextView. I want to get particular EditText Position from Textwatcher in Recycler View Adapter. Adapter: public class CartlistAdapter extends RecyclerView.Adapter < CartlistAdapter.ViewHolder > { private ArrayList < CartItemoriginal > cartlistadp; private ArrayList < Cartitemoringinaltwo > cartlistadp2; DisplayImageOptions

Set Height of Inner RecyclerView wrap_content

拟墨画扇 提交于 2019-12-19 09:19:27
问题 I have a recyclerview inside another recyclerview. I want to make height of inner recyclerview "warp_content". I came to know it is possible with new version of recyclerview which is mentioned below. 'com.android.support:recyclerview-v7:23.2.0' But the problem is, by setting height = wrap_content I can see only first item. Any Help will be great. 回答1: Because I am using a RecyclerView this does not work see: https://code.google.com/p/android/issues/detail?id=74772 and Nested Recycler view

Items overlapping in Recycler View

对着背影说爱祢 提交于 2019-12-19 09:11:16
问题 The Items in my recycler view are overlapping when user scrolls. Notice the overlapping text at the bottom: Here is the code generating this view: ArrayList<Bitmap> drawables = mBitmaps; RecyclerView recyclerView = new RecyclerView(ctx); LinearLayoutManager llm = new LinearLayoutManager(ctx); recyclerView.setLayoutManager(llm); RecyclerView.Adapter adapter = new MyRecyclerAdapter(contentList, uriList, drawables); recyclerView.setAdapter(adapter); ((ViewGroup) rootView).addView(recyclerView);

Items overlapping in Recycler View

拟墨画扇 提交于 2019-12-19 09:10:51
问题 The Items in my recycler view are overlapping when user scrolls. Notice the overlapping text at the bottom: Here is the code generating this view: ArrayList<Bitmap> drawables = mBitmaps; RecyclerView recyclerView = new RecyclerView(ctx); LinearLayoutManager llm = new LinearLayoutManager(ctx); recyclerView.setLayoutManager(llm); RecyclerView.Adapter adapter = new MyRecyclerAdapter(contentList, uriList, drawables); recyclerView.setAdapter(adapter); ((ViewGroup) rootView).addView(recyclerView);

How to add fixed Button in RecyclerView Adapter?

一个人想着一个人 提交于 2019-12-19 08:53:38
问题 nav_draw_row.xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:clickable="true"> <TextView android:id="@+id/title" android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingLeft="30dp" android:paddingTop="10dp" android:paddingBottom="10dp" android:textSize="15dp" android:textStyle="bold" android:focusable="true"

How to add fixed Button in RecyclerView Adapter?

孤街醉人 提交于 2019-12-19 08:53:08
问题 nav_draw_row.xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:clickable="true"> <TextView android:id="@+id/title" android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingLeft="30dp" android:paddingTop="10dp" android:paddingBottom="10dp" android:textSize="15dp" android:textStyle="bold" android:focusable="true"

RecyclerView item not showing ripples/touch feedback when the item has a checkbox

北慕城南 提交于 2019-12-19 07:22:29
问题 I want the items in a RecyclerView to have touch feedback or ripples when pressed, but they seem to not be working, and I think it's because of the checkbox. The ripple is only shown when long pressing, but a simple press won't show it. May someone help me to fix it? Thanks in advance. PD: I was using a ListView, and the item layout parent was a LinearLayout. The ripples were working fine. After moving to RecyclerView, the items ripples don't work. I tried with the LinearLayout again, but

Didn't find class "android.support.v7.widget.RecyclerView

泄露秘密 提交于 2019-12-19 05:23:38
问题 I'm getting this exception when running: android.view.InflateException: Binary XML file line #8: Error inflating class android.support.v7.widget.RecyclerView Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.widget.RecyclerView" on path: /data/app/my.package.location-1.apk There are some questions concerning this error, from which I've learned to: - specify exactly the support.v7 RecyclerView, in the xml and Java code. - in Eclipse, I added this jar file as a