android-recyclerview

Cardslib's CardView OnCardClickListener's onClick method not being called

给你一囗甜甜゛ 提交于 2019-12-11 02:08:21
问题 I am using this library in my app: Card Library : Guide and created a card as shown in the example. Now I need to handle a click event, but I receive an error when instantiating the following: new Card.OnCardClickListener , which says OnCardClickListener is abstract: cannot be instantiated . In my Activity I have this code: Card card = new Card(getBaseContext());//getContext() CardHeader header = new CardHeader(getBaseContext()); card.addCardHeader(header); final CardViewNative cardView =

RecyclerView blocking ui thread during updates

旧时模样 提交于 2019-12-11 01:49:09
问题 There are more than 200 items in my list. RecyclerView is updated regularly (Every 10 seconds) . RecyclerView blocking ui thread for few seconds during updates. I'm using notifyDataSetChanged method for refresh recyclerview. Is there another way to prevent freezing ? By the way I don't want use pagination. This method run every 10 seconds : public void refreshAssetList(List<Asset> newAssetList){ recyclerViewAdapter.setAssetList(newAssetList); recyclerViewAdapter.notifyDataSetChanged(); }

RecyclerView not calling getItemCount

末鹿安然 提交于 2019-12-11 00:58:03
问题 I've investigated several SO answers on this question (here, here, and here) and none of the proposed solutions have worked. My problem is that my RecyclerView list items aren't being displayed. I've set breakpoints in MessengerRecyclerAdapter, onCreateViewHolder, onBindViewHolder, and getItemCount and only the first one is ever called. While in a breakpoint I've entered the expression evaluator and executed MessengerRecyclerAdapter.getItemCount(); And received the expected answer of 20. The

Calling Adapter from Fragments in ViewPager

不打扰是莪最后的温柔 提交于 2019-12-11 00:33:26
问题 I have Fragment which have a searchview and viewpager . My viewpager has 3 fragments and each fragment calling adapter . Now to implement searchview , i need to call adapter of visible fragment in view pager . SlidingTab(Fragment with searchview and ViewPager): <LinearLayout 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:id="@+id/frame_main" android:layout_width="match_parent

Cannot Perform Multiple Queries On Firebase Database to Display in RecyclerView

随声附和 提交于 2019-12-11 00:19:28
问题 I am trying to query the most recent children in my Firebase database and then sort that limit of recent children by a child value. I understand that the Cloud Firestore has recently been released, and that querying features continue to evolve on the Firebase Realtime Database as well. I am using the FirebaseUI FirebaseRecyclerAdapter, and within that adapter you must enter a query. I am tweaking to add 2 queries to my RecyclerView. I am doing so as follows: mFireAdapter = new

Recyclerview Position changing to first position when I Update

孤人 提交于 2019-12-11 00:18:10
问题 I am using onLoadMoreListener when i scroll RecyclerView . It will update the RecyclerView data when you scroll to bottom. After updating the Recyclerview data. The Recyclerview goes back up to the top. Ideally, I would like to retain the position in the RecyclerView . Any thoughts on how I should go about doing this? mAdapter.setOnLoadMoreListener(new OnLoadMoreListener() { @Override public void onLoadMore() { new GroupData().execute(); } }); InnerClass public static class GroupData extends

How to make swipe on horizontal recyclerview bring only the next item into view - Android

喜你入骨 提交于 2019-12-11 00:16:08
问题 I have a horizontal RecyclerView that shows 4 cards numbered 1-4. These cards take up the entire width of the screen so only 1 card can be fully visible at a time. The user is presented with the first card, when they swipe the card to the left like this, the RecyclerView will scroll all the way to number 4. I don't want that. I want the swipe to bring the next card (number 2) into the view Similar to how Androids ViewPager works. 回答1: SnapHelper snapHelper = new PagerSnapHelper(); snapHelper

Recycler View Not Showing Anything

微笑、不失礼 提交于 2019-12-10 23:52:47
问题 I have been making an app that uses a RecyclerView but its not showing any thing..why contents of the recycler view have not been showing up.my codes are bellow item_contact.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" android:paddingBottom="10dp" android:paddingTop="10dp"> <TextView android:id="@+id/contact_name" android:layout_width="0dp" android:layout

menuInfo is null when creating context menu on recycler view

半城伤御伤魂 提交于 2019-12-10 23:35:32
问题 I am trying to display a context menu on clicking item in a recycler view, and the choose to call the person whose name has been clicked. But I am unable to retrieve the phone number because the getMenuInfo() is not working bcoz I am getting a null in contextMenuInfo in onCreateContextMenu(). I have referenced many answers and written my code accordingly but still not able to correct it Here is my code: menu_actions.xml <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http:/

How to load batches of data in a recycler view using firestore?

Deadly 提交于 2019-12-10 23:27:01
问题 I wanted to know how to load more data in recylcer view using firestore. Query query = FirebaseFirestore.getInstance() .collection("ie").limit(5); adapter=new InterviewAdapter(this,query); recyclerView.setAdapter(adapter); recyclerView.setLayoutManager(new LinearLayoutManager(this)); Adapter class looks like this: public class InterviewAdapter extends FireStoreAdapter<InterviewAdapter.ViewHolder> { public interface OnInterviewSelectedListener { void onInterviewSelected(DocumentSnapshot