recycler-adapter

How to show part of next/previous card RecyclerView

折月煮酒 提交于 2020-01-12 04:43:10
问题 What is the best strategy to achieve this feature: I Have a horizontal RecyclerView with cards. Each card will fulfil the entire screen, but I want it to show part of the next card and previous one if it has more than one item. I know I can achieve this by setting my card android:layout_width at the adapter to have a specific DP like 250dp instead of match_parent . But it doesn't look like a proper solution. This is my code: Activity with RecyclerView: class ListPokemon : AppCompatActivity()

Kotlin issue “One type argument expected for class ExpandableRecyclerAdapter”

﹥>﹥吖頭↗ 提交于 2020-01-11 04:10:14
问题 Got problems with RecyclerAdapter ViewHolder abstract class ExpandableRecyclerAdapter<T : ExpandableRecyclerAdapter.ListItem>(private val context: Context) : RecyclerView.Adapter<ExpandableRecyclerAdapter.ViewHolder>() { protected var allItems = ArrayList<T>() ... open inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) open class ListItem(val itemType: Int = 0) } ExpandableRecyclerAdapter in <...> is underlined with error: One type argument expected for class

Click through a RecyclerView list item

霸气de小男生 提交于 2020-01-11 02:09:30
问题 I have a RecyclerView with a LinearLayoutManager and an Adapter : @Override public int getItemViewType(int position) { return position == 0? R.layout.header : R.layout.item; } Here's header.xml : <View xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/header" android:layout_width="match_parent" android:layout_height="@dimen/header_height" /> What I want to achieve is to have a hole in the RecyclerView where I can click through to anything behind the RecyclerView . I

when does getItemCount() method get called in RecycleView adapter?

一世执手 提交于 2020-01-10 18:45:12
问题 I have a adapter which populates data to RecyclerView . I am not calling notifyDataSetChanged() and I am setting the adapter to the RecyclerView in onCreateView() (so in getItemCount() should be called once) in Fragment but I find getItemCount() called multiple times. 来源: https://stackoverflow.com/questions/31748131/when-does-getitemcount-method-get-called-in-recycleview-adapter

when does getItemCount() method get called in RecycleView adapter?

▼魔方 西西 提交于 2020-01-10 18:44:11
问题 I have a adapter which populates data to RecyclerView . I am not calling notifyDataSetChanged() and I am setting the adapter to the RecyclerView in onCreateView() (so in getItemCount() should be called once) in Fragment but I find getItemCount() called multiple times. 来源: https://stackoverflow.com/questions/31748131/when-does-getitemcount-method-get-called-in-recycleview-adapter

How to get the position of cardView item in recyclerView?

我的未来我决定 提交于 2020-01-10 09:21:29
问题 I created one adapter class for recycler for populating cardview layout in recyclerview. It is working fine, but when i click cardView item in recyclerview i need to get position of that cardview item , based on that i need to write a Intent activity. Along with how to delete that cardview item when i swipe left to right. MyAdapter class. public class MyAdapter extends RecyclerView.Adapter<MyAdapter.ViewHolder> { private NavigationItem[] navigationItem; private Context mContext; public

How to get the position of cardView item in recyclerView?

荒凉一梦 提交于 2020-01-10 09:21:28
问题 I created one adapter class for recycler for populating cardview layout in recyclerview. It is working fine, but when i click cardView item in recyclerview i need to get position of that cardview item , based on that i need to write a Intent activity. Along with how to delete that cardview item when i swipe left to right. MyAdapter class. public class MyAdapter extends RecyclerView.Adapter<MyAdapter.ViewHolder> { private NavigationItem[] navigationItem; private Context mContext; public

How to use the Audio with seekbar on Recyclview android?

不想你离开。 提交于 2020-01-07 03:39:09
问题 I am using the lists of audio on my Recyclview and it is working correct means I am able to play the audio file on my Recyclview . As i am using the Seekbar with my audio file on my Recyclview , the problem is generating that when i am scrolling the Recyclview the other items's of Recyclview Seekbar is changing (Seekbar i am using for the progress of the audio file play.) What i want that other Seekbar item of Recyclview sholud not be change when i scroll the Recyclview Please check my code

RecyclerView Adapter Methods not being called

风流意气都作罢 提交于 2020-01-06 19:47:06
问题 My RecyclerView's Adapter's methods are not being called. Only getItemCount() and class Constructor are called (List is not empty, i have checked that). Methods onCreateViewHolder() and onBindViewHolder() are not called. I have Other fragments in the same activity, using nearly same procedure but they are working perfectly fine. I tried creating a new Adapter class but that also didn't work. Method getItemCount() is called 2 times I am using same XML file for Adapter View for 2 different

on scrolled to add items in recyclerview always comes to top automatically when i scroll down

北城余情 提交于 2020-01-06 06:06:19
问题 I am implementing endless recycler view . Data is getting fine from server aslo scroll down getting down and show it. But on scroll it automatically comes to top again and again. I implemented number of solutions but doesn't work. here is bit of code. private int postNo = 15; public void onScrolled(RecyclerView recyclerView, int dx, int dy) { super.onScrolled(recyclerView, dx, dy); if (!lastTime) { if (dy > 0) { // check for scroll down visibleItemCount = layoutManager.getChildCount();