android-recyclerview

RecyclerView onClick notifyItemRemoved doesn't trigger onBindView

南笙酒味 提交于 2019-12-22 01:37:46
问题 I use notifyItemRemoved() method I want to change other remaining item , but the method doesn't trigger onBindView() method. How can I do that, except using the notifyDataSetChanged() . I want to have the animation that comes with notifyItemRemoved() method 回答1: If you are trying to remove an item from RecyclerView Adapter and want to show animation all over your list in RecyclerView . after using notifyItemRemoved(position) use notifyItemRangeChanged(position, getItemCount());

RecyclerView display multiple images

随声附和 提交于 2019-12-22 01:18:36
问题 I recently tried to code a gallery type app that can display thumbnails of images from your phone. For that I used RecyclerView and I resized the Bitmaps using this tutorial: https://developer.android.com/training/displaying-bitmaps/load-bitmap.html However, when I run my app I realized that there was only one image displayed at a time, and not multiple like I was expecting. On this image we can clearly see the huge gap between the two pictures, and it's not a third picture that couldn't load

Pass data between fragments

可紊 提交于 2019-12-22 00:48:15
问题 I have one MainActivity and two fragments. In FragmentA I have a recycler view. If I click on "add" button there, the FragmentB is open. The thing I would like to is to write text into some EditTexts and send data back to FragmentA (and render that data in the recycler view). Could you suggest me something please? Thanks FragmentB public class NewContactFragment extends Fragment { EditText name, number, email; public String mName; public String mNumber; public String mEmail; boolean

Recycler view not scrolling to the top after adding new item at the top, as changes to the list adapter has not yet occurred

六月ゝ 毕业季﹏ 提交于 2019-12-21 23:18:53
问题 I am getting the new list with new item at the start in my live data and then using its data to update the adapter viewModel.myLiveData.observe { this, Observer { myList -> adapter.submitList(myList) recyclerView.scrollToPosition(0) } 回答1: submitList does its work on a background thread, so there will always be race conditions that delays can't solve. Fortunately, we can use a RecyclerView.AdapterDataObserver callback to be informed when the list calculations are complete:

How to add search filter for RecyclerView while working with Firestore?

泪湿孤枕 提交于 2019-12-21 21:27:50
问题 So, i'm trying to create app that shows list of writers(image,name,bio) and the thing is that I have problem implementing search functionality. The guide for working with RecyclerView I used is here. Code: MainActivity public class MainActivity extends AppCompatActivity { private FirebaseFirestore db; private FirestoreRecyclerAdapter adapter; private LinearLayoutManager linearLayoutManager;//nodrosina kada veida recycle attelos private List<Klasiki> list; @BindView(R.id.imageRecycleView)

RecyclerView is below toolbar

北城余情 提交于 2019-12-21 19:51:47
问题 Problem: I have a RecyclerView and a Toolbar in a CoordinatorLayout . The RecyclerView is below the Toolbar but it should not. Question: How can I achieve that the RecyclerView and the Toolbar have one border? activity_main.xml <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res

Android: RecyclerView, Drag-and-Drop (External View), and Auto-Scroll?

北城余情 提交于 2019-12-21 18:43:18
问题 Here is an image of what I am trying to do: Image: Drag-and-drop app with a list and an item outside the list I am trying to make an explorer-like file browser, with drag-and-drop to move the files, but I run into a problem. I know there is a special RecyclerView drag-and-drop interface (there is this, for example), but I haven't been able to find examples that tell how to move things between the inside and outside of the list. Here is my XML: <?xml version="1.0" encoding="utf-8"?>

Is there a way to use a ViewStub inside a RecyclerView?

走远了吗. 提交于 2019-12-21 18:30:16
问题 i'm new to android, I've been working on a project, and in my news feeds page, I'm trying to include a modular feed RecyclerView, which shows a question with different answer forms, varrying according to the Question type. The way I was doing it so far was by using the include and turning the forms visible when needed. recently since i added more modules, the app started to slowdown segnificantly, so i'm trying to implement ViewStubs. This is my RecyclerView adapter: public class

AsyncTask loading image RecyclerView

孤街浪徒 提交于 2019-12-21 17:56:19
问题 I'm trying to create an app similar to that one: An app with some images and description (cardview) in a recyclerview First at all i load all the information for my CardView from a database Title of the image, Description and the URL from the image. When i put all that information in the RecyclerView, (title and description) shows correctly, but for the image I create a AsyncTask class to load the images from the URL and let the user don't wait to much time waiting for the app to response. If

Is there anything similar to Android RecyclerView for C# Winforms

廉价感情. 提交于 2019-12-21 17:30:10
问题 Currently am working on an winforms application which shows contacts, but I have a problem with memory. For each contact I build a panel with labels inside for name inside for name and number, and I will add this to my main Panel. Assume I have 1000 contacts; I would end up creating 1000 Panels along with one main panel. My problem is, even though only 10 or so Panels (contacts) are visible in main Panel at any one time, I would still build all 1000 Panels, which is consuming a lot of memory.