android-recyclerview

CheckBox in RecyclerView not working when pressed

亡梦爱人 提交于 2019-12-11 04:58:25
问题 I have basic RecyclerView item with TextView and CheckBox. But when I click CheckBox, it does not work. All the more amazing it works when I long pressed. I made a research and found android:descendantFocusability="blocksDescendants" , android:clickable="false" , android:focusable="false" , android:longClickable="false" but they didn't help me Here is my RecyclerView Item layout <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

How to animate RecyclerView height before items are shown

旧时模样 提交于 2019-12-11 04:48:23
问题 How can I, or should I say when can I animate recyclerView height before items are shown ? I can get the final height in onMeasure but the items always appear too fast and the animation doesn't work. Any idea on how I could get this animation to work ? 来源: https://stackoverflow.com/questions/38134727/how-to-animate-recyclerview-height-before-items-are-shown

cannot inherit from final GestureDetectorCompat

痴心易碎 提交于 2019-12-11 04:39:12
问题 I have classes that enable item click for the recycler view. They work both fine. Now I have copied them into a new project and I get the issue: cannot inherit from final 'android.support.v4.GestureDetectorCompat' What could be wrong with my classes now? ClickItemTouchListener.java package com.stack.overflow.helperClasses; import android.content.Context; import android.os.Build; import android.support.v4.view.GestureDetectorCompat; import android.support.v4.view.MotionEventCompat; import

Android RecyclerView: why is first item in list already selected?

痴心易碎 提交于 2019-12-11 04:28:13
问题 I have a RecyclerView list of CardViews with a defaultbackground of white. I set up a OnLongClickListener to select the CardView and load a DialogFragment to confirm deletion for the item (CardView) and change the background color to red. Everything is working correctly except the first CardView created in the list is already showing a red background even though the user has not OnLongClicked the CardView. Thereafter, the newest CardView added always shows the red background even when the

How to auto scroll up the chat messages (using recyclerview instead of listview) above the softkeypad whenever keypad pop ups?

青春壹個敷衍的年華 提交于 2019-12-11 04:27:27
问题 Like in chat applications whenever we want to send messages soft keypad pop ups which also auto scroll the last seen messages to top of the soft keypad provided that nothing is hidden behind the soft keypad. But in my case the keypad hides the conversations. How to fix this issue and I have used to recycler view for displaying the messages. I used android.support.v7.widget.RecyclerView 回答1: With RecyclerView you can achieve this as follows: LinearLayoutManager linearLayoutManager = new

How to set the adapter for an inner RecyclerView item without skipping the layout?

你离开我真会死。 提交于 2019-12-11 04:27:20
问题 I'm using a RecyclerView to display some data. For each item in my RecyclerView I have created a custom layout which holds beside other views a RecyclerView. So I have a nested RecyclerView under each item. <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v7.widget.RecyclerView android:layout_width="180dp" android:layout_height="45dp" android:id="@+id/recycler_view"/> //Other text views </RelativeLayout> The layout for the inner

accessing an adapter's data via another adapter

◇◆丶佛笑我妖孽 提交于 2019-12-11 04:23:45
问题 Is it all possible to access an adapter's data via another adapter? I want to start an activity and pass data from an adapter to a fragment which is used in TabLayout as one of three fragments, I have two adapters and a button which is clicked to start an activity, its Java code is in my first adapter and I need to pass second adapter's data via second adapter itself here is my codes: my first adapter: public class RecyclerViewDataAdapter extends RecyclerView.Adapter<RecyclerViewDataAdapter

Android NetworkImageView disappear in RecyclerView after Scrolling list (Volley)

早过忘川 提交于 2019-12-11 04:23:42
问题 Am using NetworkImageView with volley library and RecyclerView . After scrolling list some images disappear from the NetworkImageView . I am writing my code in the onBindViewHolder() method inside the Adapter class. And code is given below: pvh1.imgmovie.setDefaultImageResId(R.drawable.banner); pvh1.imgmovie.setImageUrl("image_url", imageLoader);` 回答1: I do not know NetworkImageView but I advise you to use Picasso to download images from the web, it's great! Use it with a normal ImageView !

Recyclerview Horizontal span and spacing issues

岁酱吖の 提交于 2019-12-11 04:17:09
问题 So this is what im trying to achieve, is a recycler view with a 3x3 grid and when items exceed the 3x3 ,they spill into the next screen/page. So ive used a recyclerview with horizontal scrolling This is what ive achieved so far and my current code does work when the count of items is 7 and above. When the count is below 7 im facing issues with which i need help. Listing my issues as questions Question 1: Why is the recyclerview items populated in vertical fashion? 1 4 2 5 3 6 I've set my

notifydatasetchanged() not working after onbackpressed()

﹥>﹥吖頭↗ 提交于 2019-12-11 04:15:15
问题 My recyclerview is not updating correctly after the back button is pressed. The recyclerview works fine before the back button is pressed The data is properly updated (seen in the log) but the recyclerview does not reflect the change The purpose of the handler is to poll the database for a notification (working fine) The notification toast is displayed everytime I am not receiving any errors If I can provide any other information to help do not hesitate to ask. Main: public void onCreate