android-recyclerview

Recyclerview with multiple dynamic views being inflated inside row

十年热恋 提交于 2019-12-06 14:09:36
问题 I'm getting my data via an API that supplies me with an array of rows for my RecyclerView. Inside each of these rows there is an array of elements which I want to add dynamically to each of my RecyclerView rows. Each element corresponds to a view. So for example I might get a title, then an image, then text. Or I might get just an image. Or a title and text. These are just some of the elements, there are more and maybe hundreds of different possible combinations. For this reason it's not

RecyclerView, GridLayoutManager and dynamic Spans count

…衆ロ難τιáo~ 提交于 2019-12-06 14:05:24
I encountered a strange bug with the recyclerview . I set and resize spans dynamically to fit with the informations downloaded from an AsyncTask. Sometimes it doesn't display properly. It seems like it displays over the screen.! Then after one or more reload it displays correctly. It seems to go out the screen but I can't figure out why. Here is my adapter: public class ScheduleAdapter extends RecyclerView.Adapter<ScheduleAdapter.ViewHolder> { private List<Schedule> mDataset; /** * First parameter is the position in the dataset * The value returned is the number of schedules to display */

How to implement 2 or more recyIclerview in an activity

大兔子大兔子 提交于 2019-12-06 13:50:16
问题 How to implement 2 or more recyIclerview in an activity ? I am trying to implement 2 or more recyclerview in my activity in this code line I am declaring the first adapter private RecyclerView.Adapter mAdapter; how to declare my second adapter? by the way while running my app with the below code , the recyclerview is not scrolling and displaying correcly mainactivity private RecyclerView mRecyclerView; private RecyclerView mRecyclerView1; private RecyclerView.Adapter mAdapter; private

MVVMCross Nested Recyclerview Out of Memory Issue

半城伤御伤魂 提交于 2019-12-06 13:22:36
I have tried to create nested recyclerview in combination with the mvvmcross-framework which actually worked quite easily, but now I'm getting out of memory exceptions. Scenario I have a list of around 3000 entries with complex and long names, which are divided by 8 categories. The user can select the entries via a checkbox to assign them to a task later on. Even if it might sound like there are too many entries, it is actually quite easily to navigate through them, if the user has some background knowledge, so I would rather not change it at this point. Code First the simplified data models

Endless RecyclerView with Progressbar at bottom

邮差的信 提交于 2019-12-06 13:22:29
I want to have a recyclerview to load more data on scrolling. It was working perfectly with loading more data. Then i extended code to show progressbar at the end to show loading. But it not working properly. It shows two many progressbar at a time and also my loading data is not proper. Here, i have implemented my code. Please help me. MainActivity.java public class MainActivity extends AppCompatActivity { RecyclerView recyclerView; MyAdapter adapter; final ArrayList<String > data = new ArrayList<>(); int end=20; int start=0; @Override protected void onCreate(Bundle savedInstanceState) {

Android RecyclerView addItemDecoration Won't Add Decoration to Bottom of RecyclerView

ぃ、小莉子 提交于 2019-12-06 13:13:33
I cannot find an answer to this question anywhere online, so the answer must be so simple that no one cared to ask it, and I simply don't know it. Essentially, I want to add a horizontal line between every item in my recyclerView AND to the bottom of the RecyclerView. I have found a way to place a divider between every item in the RecyclerView, but not one at the end . According to the documentation (found here: https://developer.android.com/reference/android/support/v7/widget/RecyclerView.html#addItemDecoration(android.support.v7.widget.RecyclerView.ItemDecoration , int) ) putting a negative

how do i use both scroll view and RecyclerView in one xml layout android?

戏子无情 提交于 2019-12-06 12:54:46
In my application i am using recycler view and scrollview in one layout. it is not working when i am using both these views. If i remove scroll view only the recycler view is working. Plese any one help me hoe to fix this issue. my code: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/r1" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/background" > <ScrollView android:id="@+id/sc" android:layout_width="match_parent" android:layout_height="match

Android Recyclerview Multiple onclick items

跟風遠走 提交于 2019-12-06 12:46:29
问题 I am trying to have a recyclerview where each item is a simple TextView + Checkbox <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="match_parent"> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/title" android:layout_width="0dp" android:layout_weight="5" android:layout_height="wrap_content" /> <CheckBox android:id="@+id/chk" android:layout

Logical pattern for listeners/observers to implement RecyclerView list and details activities

て烟熏妆下的殇ゞ 提交于 2019-12-06 12:13:06
There seems to be various ways to implement RecyclerView lists, some more logical than others. Going beyond a simple list to one where the data changes increases the complexity. Additional complexity comes from implementing the ability to view the details of the list items. Although I have had some success at implementing lists in this manner, I feel that what I've come-up with is not efficient and not what was intended when the framework was designed. Looking at the various methods I've used, I keep saying "this can't be the way they want me to do it". The basic application I wish to examine

Android: support features don't appear in android L

醉酒当歌 提交于 2019-12-06 12:09:44
I use Android Studio 2.0 . I have used RecyclerView and CardView which render properly on kitkat but when the app is run on SAMSUNG A5 with android 5.1.1 (lollipop) the RecyclerView doesn't scroll and my CardView doesn't have elevation and corner. I tried solutions suggested in SO such as adding card_view:cardUseCompatPadding="true" and adding margin. Even changed xmlns:card_view="http://schemas.android.com/apk/res-auto" to xmlns:card_view="http://schemas.android.com/tools" But these didn't work This is my RecyclerView: <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget