android-recyclerview

How to make “See All Item” button to pass data from RecyclerView to Another RecyclerView fragment - AndroidX

安稳与你 提交于 2019-12-24 00:02:50
问题 Q uestion I want to make the "See All Item" button to pass data from RecyclerView to Another RecyclerView fragment it looks like play store that has the "More" button to see all item in another fragment AdapterSectionHotTrendingNews.java public class AdapterSectionHotTrendingNews extends RecyclerView.Adapter{ private Context mContext; private ArrayList<ModelSectionHotTrendingNews> modelSectionHotTrendingNews; public AdapterSectionHotTrendingNews(Context mContext, ArrayList

CardView won't ripple on click

允我心安 提交于 2019-12-23 23:33:45
问题 In my android app I have a recyclerview containing card views. However for some reason when I long press the cardview the ripple effect appears but if I just click it, then the ripple effect doesn't appear. Any suggestions? CardView Item Layout <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/card_view" android:layout_width="fill

When submitting a new list to RecyclerView ListAdapter the diff check always returns true for areContentsTheSame()

ぃ、小莉子 提交于 2019-12-23 23:24:22
问题 I am using an MVVM architechture to build a simple ordering app. I am using a RecyclerView in my ProductsFragment to list all the products that can be ordered. I am also using LiveData in my ViewModel and observable in my Fragment to check for any changes to the List of products. In my list item I have 3 buttons: 1 button to add a product to the basket, another to increment the quantity that customer wants to add to the basket and a third to decrement the quantity the customer wants to add to

My interface class don't work when I call it from a fragment

丶灬走出姿态 提交于 2019-12-23 22:11:34
问题 I'm trying to implement this code in my project but is not working RecyclerView: how to catch the onClick on an ImageView?: I've implemented a interface to handle onclick imageview and onclick row in a recyclerview. The problem is that when I try to do a click on the imageview or in the row don't happen nothing. If I try the same in my ViewHolder class, works, because I can see the Toast. The problem is that I need that this work from my fragment. I think that maybe the problem is when I pass

Horizontal Scrolling Cards just like Recent Apps of Lollipop in Android?

旧城冷巷雨未停 提交于 2019-12-23 21:05:19
问题 I found a library, this library supports vertical scrolling cards, I want to change this library according to my needs (Horizontal scrolling). Can anyone suggest how to implement Cards just like the mentioned library cards horizontally. 回答1: Guys I just found a library , which helped me to solve this issue. Carousel Library Best Library I found which I customized for my project: https://github.com/applm/CarouselWidget Other helpful libraries: https://github.com/davidschreiber/FancyCoverFlow

Android RecyclerView Adapter DataBinding - cannot find symbol {layout}BindingImpl

北城以北 提交于 2019-12-23 20:55:09
问题 I have a Fragment that displays a list of cities with weather informations. I am using a RecyclerView and I am trying to implement the Data Binding Library in my RecyclerView Adapter but for some reason I get this compile error : > error: cannot find symbol import com.example.zach.weatherapp.databinding.CityListItemBindingImpl; > ^ > symbol: class CityListItemBindingImpl > location: package com.example.zach.weatherapp.databinding It's an auto generated class so i really don't know where the

Change image resource when clicking on ImageView inside the RecyclerView

不羁岁月 提交于 2019-12-23 20:48:08
问题 I'm trying to change my device's image resource inside the recyclerview at the specific position whenever i click at it (click at the image, not the item). I tried to put setOnClickListener() inside the onBindViewHolder() method but only the last item affected. here is my recycler view here is my Adapter: public class Device_RV_Adapter extends RecyclerView.Adapter<Device_View_Holder> { List<Device_Data> list= Collections.emptyList(); Context context; public Device_RV_Adapter(List<Device_Data>

RecyclerView onClick not working properly?

二次信任 提交于 2019-12-23 19:57:28
问题 I am using RecyclerView in my fragment to show images with text in Grid format,the Recycler view grid_item.xml look like following: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:card_view="http://schemas.android.com/apk/res-auto" android:layout_width="fill_parent" android:layout_height="wrap_content"> <android.support.v7.widget.CardView android:id="@id/card_view" android:layout_width="fill_parent" android:layout_height=

Performance of ConstraintLayout inside RecyclerView ViewHolder

守給你的承諾、 提交于 2019-12-23 19:49:53
问题 I've spent the last 2 days attempting to triage why my RecyclerView is so is so unbearably slow while scrolling and I've narrowed it down to the ConstraintLayout I'm using for the rows. Using the GPU profiler on android shows green/blueish green bars all the way up to the top of the screen, indicating substantial jank. It's super obvious something is wrong. Here's what my viewholder looks like: class MyViewHolder( override val containerView: View) : RecyclerView.ViewHolder(containerView),

How to enable a PagerSnapHelper to snap in both directions in a RecyclerView?

邮差的信 提交于 2019-12-23 19:33:36
问题 I've attached a PagerSnapHelper to a RecyclerView with a Horizontal LinearLayoutManager using below code. SnapHelper snapHelper = new PagerSnapHelper(); snapHelper.attachToRecyclerView(myRecyclerView); However, when I perform scroll, snapping happens only in one direction. i.e. it snaps to next item on a right swipe but doesn't snap to previous item on a left swipe. Is this the default behavior? Could I override this to enable snapping to previous item as well on a left swipe? Any pointers