android-recyclerview

How to pass value from recyclerview item to another activity

↘锁芯ラ 提交于 2020-05-27 18:35:13
问题 I'm trying to pass the value in recyclerview item to another activity when we click the recyclerview item. Here I use the OnItemTouchListener . I retrieve data from JSON and parse it into ArrayList. I save 5 parameters. Title, ID, Rating, ReleaseDate, urlPoster, but right now i only show 2 parameters, Title, and image from urlposter. I want to pass the other parameters to another activity, but i can't find out how to do that. There's another question similar like this (Values from

How to detect if RecyclerView is empty?

和自甴很熟 提交于 2020-05-25 10:55:41
问题 I have a RecyclerView getting external JSON data parsed from a server. It works fine however the Volley async task on JSON sometimes takes a while and when it does the fragment displays an empty blank view. How can I create a test to check if the view is empty and display a msg if it is? I tried to check: if (recyclerView == null) if (jsonList == null) if (adapter.getItemCount() == 0) if (bundle == null) But those tests either dont do anything or they display the error message every single

How to detect if RecyclerView is empty?

最后都变了- 提交于 2020-05-25 10:52:53
问题 I have a RecyclerView getting external JSON data parsed from a server. It works fine however the Volley async task on JSON sometimes takes a while and when it does the fragment displays an empty blank view. How can I create a test to check if the view is empty and display a msg if it is? I tried to check: if (recyclerView == null) if (jsonList == null) if (adapter.getItemCount() == 0) if (bundle == null) But those tests either dont do anything or they display the error message every single

CardView suddenly turned black

淺唱寂寞╮ 提交于 2020-05-25 07:54:07
问题 I've got a problem with the CardView in the RecyclerView . My CardView suddenly became black and my RatingBar became blue. I'm using the InfiniteRecyclerView but changing it to the simple RecyclerView has no effect. I can change the CardView 's background colour to white but the RatingBar will still be blue. This is an example of what is happening: Black CardView I use the normal RecyclerView in another activity within a fragment with the same adapter and it looks just fine. Here is an

CardView suddenly turned black

爱⌒轻易说出口 提交于 2020-05-25 07:52:04
问题 I've got a problem with the CardView in the RecyclerView . My CardView suddenly became black and my RatingBar became blue. I'm using the InfiniteRecyclerView but changing it to the simple RecyclerView has no effect. I can change the CardView 's background colour to white but the RatingBar will still be blue. This is an example of what is happening: Black CardView I use the normal RecyclerView in another activity within a fragment with the same adapter and it looks just fine. Here is an

Part of the content of a CollapsingToolbarLayout is getting sticky on top, when used with viewpager and recyclerview

社会主义新天地 提交于 2020-05-23 04:31:45
问题 I am trying to implement a layout like this: The issue is that when scrolling up the card touches the toolbar and it does not go up anymore like this: I want it to scroll up till the viewpager to fills the screen ie, at least the rectangle card, should scroll up beyond the toolbar(Even the tabLayout can also scroll up). But I don't want it to stay sticky at the top. The main layout is here: <?xml version="1.0" encoding="utf-8"?> <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns

Using ViewTreeObserver i am adding setMaxLines and setEllipsize in MaterialTextView inside RecyclerView.Adapter

回眸只為那壹抹淺笑 提交于 2020-05-21 07:24:46
问题 I am set MaterialTextView inside RelativeLayout and set RelativeLayout size programmatically different size for every device. Then i have using ViewTreeObserver to set setMaxLines and setEllipsize in MaterialTextView but i am facing some problem show the text in MaterialTextView using RecyclerView.Adapter. I am using load more RecyclerView i am getting all data then after show text automatically in list and also notify data adapter then show text. not showing text inside MaterialTextView in

Using ViewTreeObserver i am adding setMaxLines and setEllipsize in MaterialTextView inside RecyclerView.Adapter

瘦欲@ 提交于 2020-05-21 07:23:02
问题 I am set MaterialTextView inside RelativeLayout and set RelativeLayout size programmatically different size for every device. Then i have using ViewTreeObserver to set setMaxLines and setEllipsize in MaterialTextView but i am facing some problem show the text in MaterialTextView using RecyclerView.Adapter. I am using load more RecyclerView i am getting all data then after show text automatically in list and also notify data adapter then show text. not showing text inside MaterialTextView in

Delay recyclerview every item click functionality

爱⌒轻易说出口 提交于 2020-05-17 07:42:26
问题 I have a recyclerview . I want to achieve one functionality, but I can't implement it. My RecyclerView item has 2 textView and a button . public class Task { private String id; private String title; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } } So let me explain a little. The button in my recyclerView item uses stateListDrawable , so it becomes active

Recyclerview not showing kotlin [duplicate]

情到浓时终转凉″ 提交于 2020-05-17 06:45:13
问题 This question already has answers here : recyclerview No adapter attached; skipping layout (34 answers) Closed 8 months ago . Recyclerview is not showing on screen just show white background. Is it there any mistake? Please tell me, thanks. Adapter class NeedsAdapter(var context: Context) : RecyclerView.Adapter<NeedsAdapter.ViewHolder>() { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): NeedsAdapter.ViewHolder { var view = View.inflate(parent.context, R.layout.needs_item,