android-recyclerview

Prevent Recyclerview from intercepting scroll/touch events

折月煮酒 提交于 2019-12-11 12:09:25
问题 So I looked everywhere for this and I've been stuck for a few hours; I really need the help! So I have a (fixed size) recyclerview inside another scrollview, which is the nestedscrollview. I also have the CollapsingToolbarLayout on this view. The problem is that when I scroll the entire view and I'm on the recyclerview, the CollapsingToolbarLayout doesnt expand/contract (it only does so when the CollapsingToolbarLayout has contracted, and I'm scrolling down and so it does expand). Otherwise,

Android: how do I switch layouts for a RecyclerView list?

ⅰ亾dé卋堺 提交于 2019-12-11 11:57:39
问题 I have a default layout that holds a bunch of blank CardViews in a RecyclerView list, basically a welcome screen for the user to show them what CardViews look like. The user then launches an input screen for some data and clicks a "Save" button to save the data into a CardView. Once the user clicks Save, the layout should change from the default layout with the blank CardViews to the new, single CardView that contains the user data. Later, if the user deletes all of their CardViews, then the

Programmatically “swipe-to-dismiss” an item in a ListView/RecyclerView?

橙三吉。 提交于 2019-12-11 11:56:29
问题 I need to be able to programmatically dismiss an item inside a RecyclerView without the user actually swiping (instead I want to dismiss the item when they tap a button in the card). A lot of libraries I've seen only seem to support actual swipes. I've tried using an existing library and just simulate a MotionEvent by creating a swipe on my own programmatically, but this interferes with another horizontal-swipe listener, so I'm wondering how else this could be done, ideally for a RecyclerView

RecyclerView with checkbox checked/unchecked automatically when I am scrolling

左心房为你撑大大i 提交于 2019-12-11 11:52:44
问题 this is my QuestionHolder : private class QuestionHolder extends RecyclerView.ViewHolder implements View.OnClickListener { private JSONObject question; private CheckBox checkBox; private TextView question_txt; public QuestionHolder(final LayoutInflater inflater, ViewGroup parent) { super(inflater.inflate(R.layout.question_item, parent, false)); checkBox = (CheckBox) itemView.findViewById(R.id.question_checkbox); checkBox.setOnClickListener(new View.OnClickListener() { @Override public void

Android: Permanently elevate View

不打扰是莪最后的温柔 提交于 2019-12-11 11:46:09
问题 I have a RecyclerView , that has a RippleEffect as well as a StateListAnimator (which is shown below): anim_lift.xml <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_enabled="true" android:state_pressed="true"> <set> <objectAnimator android:duration="@android:integer/config_shortAnimTime" android:propertyName="translationZ" android:valueTo="8dp" android:valueType="floatType"/> </set> </item> <item> <set>

ImageDetailsActivity for a recycler view

邮差的信 提交于 2019-12-11 11:44:07
问题 in my android app, I am listing the images' previews with network image view. I want that if user press the previews it opens an activity with viewpager and show the original images of specific item of my recycler view. So, i have a two method in my mind. 1-) I will save two image for each of my images in my database. One of them will be preview image with small size and other one will be the original one. In my main newsfeed, app will load the preview images so download size will be smaller.

Using Fresco + S3 in Android

烂漫一生 提交于 2019-12-11 11:43:48
问题 I need a way to show several ( maybe 20-30 ) images on screen on an Android application i'm working on. Considerations: My images are stored in AWS S3. The list that displays these images is implemented using RecyclerView. After some research, i've decided to use Fresco to show and cache these images, but now i realize that i need a Uri from said S3 images. How can i accomplish this? Maybe using the newer TransferObserver.download(); and just display the images is better? But again, caching

Populate Data into RecyclerView

一个人想着一个人 提交于 2019-12-11 11:16:27
问题 I would like to show JSON Object's data into RecyclerView for that I have tried this but did not get any data. May, I know where I am doing mistake and What I have missed ? How could I pass learning objects data from MainAdapter to LearningActivity MainAdapter class: @Override public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) { View v = LayoutInflater.from(viewGroup.getContext()).inflate(rowLayout, viewGroup, false); return new ViewHolder(v); } @Override public void

Android: RecyclerView behaving as a GridLayout

徘徊边缘 提交于 2019-12-11 11:14:02
问题 I need to create a RecyclerView with 3 columns, with a button that when clicked, a custom view is added into the RecyclerView. And when I click in a view, it gets deleted. for example: I added 5 views, if I click on number 3, number 3 gets destroyed, and number 4 e 5 take one step back. I've created this in a GridLayout, but I want it to be in a RecyclerView, I'm aware that I need an Adapter, a Viewholder and a LayoutManager. So how is this done? This is how it looked with a GridLayout:

RecyclerView and IndexOutOfBoundsException: Invalid index #, size is #

泄露秘密 提交于 2019-12-11 11:12:14
问题 I have a simple RecyclerView and I want to remove those items onClick. I was continuously running into a crash depending on when I clicked on certain items in the list with the above error. If you're having similar issues, here's how I solved it: 回答1: public void onBindViewHolder(final CardViewHolder holder, final int position) Using position here is useful for some things, but if I used it when removing items from the list, it was causing a crash, instead using: holder.getAdapterPosition();