android-recyclerview

RecyclerView inside ScrollView is not working

走远了吗. 提交于 2019-12-16 19:51:29
问题 I'm trying to implement a layout which contains RecyclerView and ScrollView at the same layout. Layout template: <RelativeLayout> <ScrollView android:id="@+id/myScrollView"> <unrelated data>...</unrealated data> <android.support.v7.widget.RecyclerView android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/my_recycler_view" /> </ScrollView> </RelativeLayout> Problems: i can scroll until the last element of ScrollView Things i tried: card view inside the

How to update RecyclerView Adapter Data?

眉间皱痕 提交于 2019-12-16 19:50:58
问题 Trying to figure out what is the issue with updating RecyclerView 's Adapter. After I get a new List of products, I tried to: Update the ArrayList from the fragment where recyclerView is created, set new data to adapter, then call adapter.notifyDataSetChanged() ; it did not work. Create a new adapter, as others did, and it worked for them, but no change for me: recyclerView.setAdapter(new RecyclerViewAdapter(newArrayList)) Create a method in Adapter which updates the data as follows: public

How to build a Horizontal ListView with RecyclerView?

这一生的挚爱 提交于 2019-12-16 19:50:30
问题 I need to implement a horizontal listview in my Android application. I did a bit of research and came across How can I make a horizontal ListView in Android? and Horizontal ListView in Android? however, these questions were asked before Recyclerview was released. Is there a better way to implement this now with Recyclerview? 回答1: Is there a better way to implement this now with Recyclerview now? Yes. When you use a RecyclerView , you need to specify a LayoutManager that is responsible for

Create Options Menu for RecyclerView Item

浪子不回头ぞ 提交于 2019-12-14 04:26:07
问题 I have been attempting integrate an options menu in to my listview by following the following tutorial: [https://www.simplifiedcoding.net/create-options-menu-recyclerview-item-tutorial/] I have been able to get the icon for the menu to appear next to the items in the listview, but I am unable to click on it to get access to a popupmenu. I am attempting to implement this in side my public void onBindViewHolder(MyViewHolder holder, int position) method. I cannot figure out why I am unable to

How do I refresh a recyclerview in android?

雨燕双飞 提交于 2019-12-14 04:23:47
问题 I am populating the recycler view with new data on Activity result.The problem is the new data is getting append at the end of the recycler view how do I clear the previous data in the recycler view and inflate the recycler view with the new data. @Override protected void onActivityResult(int requestCode, int resultCode, final Intent data) { super.onActivityResult(requestCode, resultCode, data); mAdapter.notifyDataSetChanged(); search_info.clear(); book_type.clear(); if (requestCode == 1) {

Scrolling RecyclerView freezes on long TextViews

*爱你&永不变心* 提交于 2019-12-14 04:12:18
问题 I am trying to implement a comment section-style layout using a RecyclerView . I have a list of CharSequence objects (each the result of Html.fromHtml(String, null, null) ) which I use to populate this RecyclerView . Here is the RecyclerView layout: <android.support.v7.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/list" android:layout_width="match_parent" android:layout_height="match_parent"/> Here is the TextView layout: <TextView android:id=

StaggeredGridLayoutManager. How to have one item in first row and 2 item other rows

拥有回忆 提交于 2019-12-14 04:00:22
问题 I am using recyclerview with staggeredGridLayoutManager. What i am trying to do is to show one header item in first row. then i want to show 2 items in each below row. But i am unable to do so. Here is code that i used. recyclerView = (RecyclerView)findViewById(R.id.recycler); staggeredGridLayoutManager = new StaggeredGridLayoutManager(1,1); recyclerView.setLayoutManager(staggeredGridLayoutManager); And these are the results Help me with this. thanks 回答1: You could use GridLayoutManager.

Getting text from inside editText that is contained in a Recyclerview

自作多情 提交于 2019-12-14 03:57:44
问题 I have a Recyclerview that contains an edittext, when a button is pressed outside the RecyclerView, I would like to retrieve the text from each view inside the RecyclerView. However I can't seem to find the best way to do that. I have tried to use a callback, and also have tried a external class to store the data but both ways seem like they should work but have not had much luck with either. What is the best practice for geting the text out of each edittext indivdual so that it can be a

RecyclerView Dynamic Header

雨燕双飞 提交于 2019-12-14 03:57:33
问题 I have been working with RecyclerView to add dynamic headers. I have provided a sample Image like below what I wants. In above image the children are finite which is not in my case. I'm having uncertain children after the header. Basically instead of header0 it will be Month name like MAR and below that things which have occurred in MAR month will come. The data is coming from API i.e Web Service in which date is also coming but I'm struggling to create a logic for what I have explained above

How To Add RecyclerView Slide In Animation for New Item

两盒软妹~` 提交于 2019-12-14 03:56:57
问题 I have a RecyclerView and add items to mCommentArrayList at index 0. I am trying to create a slide-in animation at the top of the view as new items (CardViews) are added to the RecyclerView. I know there are libraries that can be used, and I have even explored https://github.com/wasabeef/recyclerview-animators. However, the documentation is limited and I am unsure what approach to take. Note that I add all new items to my mCommentArrayList at index 0 so that they appear at the top of the view