android-recyclerview

Data inside RecyclerView is getting populated twice using Socket.IO

独自空忆成欢 提交于 2019-12-11 16:24:20
问题 I am working on chat application which uses Socket.IO for sending and receiving messages.Problem which i am facing is when a user send a message to other user,its message gets populated twice inside recyclerview. My Fragment code :- public class ChatFragment extends Fragment { private static final String TAG = "MainFragment"; private static final int REQUEST_LOGIN = 0; private static final int TYPING_TIMER_LENGTH = 600; private RecyclerView mMessagesView; private EditText mInputMessageView;

How to align TextView + RecyclerView at screen bottom within ScrollView?

血红的双手。 提交于 2019-12-11 16:20:23
问题 I have the next structure of XML file in my Fragment. I have an issue with RelativeLayout 3 (id=referralsContainer). It consist of textView (id=inviteText) + RecyclerView (id=rv_referrals). I need to show textView at the bottom of screen with any resolution. And after that textView must be RecyclerView with elements (when user will scroll down). I tried to do something like this in method, when all elements of recyclerview loaded, but recyclerview is replaced in different positions by Y axe

How to show text that moves along scrollbar using RecyclerView?

泄露秘密 提交于 2019-12-11 16:13:22
问题 I'm using Recylerview and want to show list like this https://i.stack.imgur.com/kMh1q.png I've tried to enable fastScroll in xml as below however it only can change thumb and track of Recyclerview and can't show the text as I expected. <android.support.v7.widget.RecyclerView android:id="@+id/recycler_view" android:layout_width="match_parent" android:layout_height="match_parent" android:scrollbars="vertical" app:fastScrollEnabled="true" app:fastScrollHorizontalThumbDrawable="@drawable/thumb

RecyclerView is not showing

时光毁灭记忆、已成空白 提交于 2019-12-11 16:08:39
问题 I have Spinner , EditText and a RecyclerView in my Activity. Everything is going good but sometimes my recyclerView is not Visible till I click on EditText in my Activity. I debug my code everything is passed in adapter private void createRecycler(ArrayList<ProductNLCModel> productNLCModels) { rcycler_productlist.setVisibility(View.VISIBLE); rcycler_productlist.setHasFixedSize(true); SnapHelper snapHelper = new PagerSnapHelper(); rcycler_productlist.setOnFlingListener(null); snapHelper

Playing and Releasing audio in RecyclerView

三世轮回 提交于 2019-12-11 16:04:58
问题 I'm learning android and currently RecyclerView, so in this example I'm playing a specific raw sound file when clicking a play button and then releasing it when it's done. I could seriously use some pointers on what is the best practice however as I have a few issues and questions: I have a problem with transiting states so if I press play very quickly I'll get an IllegalStateException , probably from trying to release an already released player. I should apparently also nullify after release

clear + addAll vs re-initialise list RecyclerViewAdapter android

ぃ、小莉子 提交于 2019-12-11 16:04:58
问题 What's the different between 1 and 2: 1. public void updatePostList(ArrayList<Post> updatedPosts) { this.postList.clear(); this.postList.addAll(updatedPosts); notifyDataSetChanged(); } 2. public void updatePostList(ArrayList<Post> updatedPosts) { this.postList = updatedPosts; notifyDataSetChanged(); } For me, #1 doesn't work as calling this.postList.clear() clears updatedPosts too instead of just clearing postList and I can't understand why. 来源: https://stackoverflow.com/questions/56454443

Recyclerview call contacts Android studio

不羁岁月 提交于 2019-12-11 15:52:52
问题 I have an android app where I have used RecyclerView that shows a list of contacts. Now what I want is that when selecting the contacts, call the indicated number. For now all it do is show the contacts, but when i click on it it calls, it does not do any action. I do not know how to get it to mark I tried with onClick() and with button item.But Unsuccessful My code: public class RecyclerViewAdapter extends RecyclerView.Adapter<RecyclerViewAdapter.MyViewHolder> { private static final String

Recycler View not displaying in fragment

假如想象 提交于 2019-12-11 15:44:41
问题 I'm trying to make an application where when i press a button it would open the fragment which contains a Recycler view where the data is retried from Firebase Firestore and added to an adapter. I've managed to connect the pieces together but the recycler view does not seem to be showing but the other components inside the fragments are. Anyone able to find out what am I missing in the code or what I'm doing wrong? MainActivity.java protected void onCreate(Bundle savedInstanceState) { super

Validate RecyclerView content

本秂侑毒 提交于 2019-12-11 15:44:18
问题 I think there is no need to repeat the exact description of how my RecyclerView is set. This is described here: Android - RecyclerView with various dynamic content, different for each item In short, my Recycler View may contain various controls, like edit text, spinner, etc. Then, recyclerview is placed in Activity layout, always expanded with nested scroll view as its parent. When user hit "Confirm" button in my activity, recycler view's content should be validated - for example, if any

Kotlin, recyclerview adapter how to sort results from query by DESC

时光总嘲笑我的痴心妄想 提交于 2019-12-11 15:37:55
问题 its my code. What i doing wrong? I would like to display descending results in recyclerview. TableInfo.TABLE_COLUMN_MESSAGE = "points" override fun onBindViewHolder(p0: MojViewHolder, p1: Int) { val wynikwynik = p0.view.textViewWynik val wynikuser = p0.view.textView_user val cursor = db.query(TableInfo.TABLE_NAME, null, BaseColumns._ID + "=?", arrayOf(p0.adapterPosition.plus(1).toString()), null, null, TableInfo.TABLE_COLUMN_MESSAGE +" DESC") if (cursor.moveToFirst()){ wynikwynik.text=cursor