android-recyclerview

Gap between CardViews increases on scrolling

心不动则不痛 提交于 2019-12-11 05:55:58
问题 I'm using CarViews with RecyclerView and it looks fine when loaded but once when the list is scrolled the gap between the CardViews increases and there shows only one card in the view at a time. Here is my CardView.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto"> <android.support.v7.widget.CardView android:id="@+id/conversationCard" android

How do I attach RecyclerView adapter from sqlite database

橙三吉。 提交于 2019-12-11 05:48:37
问题 I've tried to find a tutorial how to make recycleview with sqlite but I am a little less understood his steps. is there who can help me to solve the following problem. create a data adapter recycleview of sqlite. RecyclerViewHolder.java package com.my.app; import android.support.v7.widget.RecyclerView; import android.view.View; import android.widget.ImageView; import android.widget.TextView; public class RecyclerViewHolder extends RecyclerView.ViewHolder { TextView tv1; ImageView imageView;

Glide error when loading a recyclerView “You must pass in a non null View”

泄露秘密 提交于 2019-12-11 05:48:25
问题 Hi I am trying to populate a Grid RecyclerView with a series of Images. To do that I fetch image urls from the web and load them into a List<>. The problem is that apparently the ImageView reference that the adapter gets is null. This is the code: private class ShowHolder extends RecyclerView.ViewHolder { public ImageView mImageView; public ProgressBar progressBar; public ShowHolder(LayoutInflater inflater, ViewGroup container) { super(inflater.inflate(R.layout.list_item_row, container, false

RecyclerView not generating list when it has a view above it

梦想与她 提交于 2019-12-11 05:46:22
问题 So I cannot make the RecyclerView generate the given list once I have another view above it. The view above it and the recycler view are both within a LinearLayout and which is the single child of a NestedScrollView (used for collapsing the toolbar). Once RecyclerView is the only view in the fragment everything works as expected. StocksCompleteListFragment.java public class StocksCompleteListFragment extends Fragment { @Nullable @Override public View onCreateView(LayoutInflater inflater,

Recycler View not Showing in an Activity

て烟熏妆下的殇ゞ 提交于 2019-12-11 05:40:08
问题 I have been making an app that uses a recycler view in an Activity how the contents of the recycler view have not been showing up. Here my code pending_complaint.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_margin="5dp" > <android.support.v7.widget.RecyclerView android:layout_width="match_parent" android

Call method in Fragment from MainActivity

好久不见. 提交于 2019-12-11 05:35:39
问题 My application consists of a MainActivity that contains a TabLayout . The second tab has a RecyclerView which allows for items to be selected by clicking on them. The initial state is shown in the left figure. When one or more items are selected however, a overlaying Toolbar is shown with the options to (from left to right) copy, edit, delete or deselect the items. This situation is shown in the middle figure. When for example the deselect option is chosen, the Toolbar should hide and the

view.GONE in Recyclerview still keeps space

北城余情 提交于 2019-12-11 05:21:20
问题 I searched on the web and fount that there's a difference between view.invisible and view.gone, the vie.gone must disappear without keeping the space but it doesn't happen to me, how can I fix it? please help, check out the links of the two pictures. Picture of the result on the Android Emulator: https://i.stack.imgur.com/AC1Xr.png Database: https://i.stack.imgur.com/Pwhno.png @Override protected void onStart() { super.onStart(); final FirebaseRecyclerAdapter<MyReading, MyReadingViewHolder>

Recyclerview horizontal deck of cards effect

浪尽此生 提交于 2019-12-11 05:09:24
问题 I am trying to make simple card game where I need to show deck of cards laying on the desk horizontally and user can select any number of cards by clicking them. Ideally when use click on any card, card should elevate a bit from other cards. Plus cards are not completely visible, they are partially visible like this. I have created custom Recyclerview and used item decorator to change offset of cards. However whenever I change offset, first or last card of deck is completely overlapped by

Refresh recyclerView adapter with new items on top

最后都变了- 提交于 2019-12-11 05:01:19
问题 I'm making a network call and I fetch from server 50 items which I display on the RecyclerView . If user keeps scrolling I fetch 50 more (using a page_num = 2, 3, etc...) and it keeps going like that with 50 items every time. So let's say that currently there are being displayed 150 items to the user . What I'm doing is : // This call is inside my `Fragment` class for (NotificationsServiceResponseNestedItem item: notificationsList){ if (!dataset.contains(item)) { adapter.addItem(item); } } //

UI lags and is choppy when using Glide to load images in a RecyclerView

与世无争的帅哥 提交于 2019-12-11 04:58:34
问题 I have a RecyclerView that loads images from URLs using Glide. Now the URLs are retrieved from Firebase using pagination as you can see below. The issue is that when the MainActivity (which contains the below code and the recyclerview) is first initialized there is a substantial lag in the UI (very laggy and choppy scrolling, options menu takes 3 seconds to open etc.) and the images take a while to load. After i scroll down though and reach the end of the RecyclerView for the first page of