android-recyclerview

RecyclerView settle item with Decelerate Interpolator once scroll finishes

时间秒杀一切 提交于 2019-12-24 20:19:03
问题 I want to animate the RecyclerView scrolling. I don't want to animate adding or removal of items but rather animate items which are on screen, i.e visible items. What I want is, item settle down smoothly when scrolling is about to finish. I am not sure what approach should I take or how this can be done. I have tried following till now Using RecyclerView.OnScrollListener , when I get onScrolled callback, I find visible items & animate them upside or downside based on scroll direction. But

Collections.swap changes the position of the RecyclerView but it doesn't show anymore at Fragment

时光毁灭记忆、已成空白 提交于 2019-12-24 19:54:13
问题 I am trying to change the position of the RecyclerView this take changes but if I go to another Activity or exit the app and again open it, it tells me the right position. The data are saved to an DB SDQLite and with Adapter I read from there and show to a Fragment . onMove I have write a Log and it says the correct which position was and which is new. At the Log the arrayList = getSampleData() it is working it saves always the position and read the actual position but the ArrayList at

How to fix view that is misplaced and only comes to right place after I scroll inside the RecyclerView

丶灬走出姿态 提交于 2019-12-24 19:39:16
问题 This is the problem: https://imgur.com/gallery/pRFhG9e?s=wa I already asked once (How to avoid admob adview being cut off) but didn't get any successful answers. I have new info that I didn't provide in the previous question. I have realized that the AdView comes back to the right place after I scroll up or down the RecyclerView, so I think the problem is related to the RecyclerView somehow pushing down the AdView. Some new solutions I have tried inside onResume and have failed: Use

Wrong object selected with ItemTouchHelper

て烟熏妆下的殇ゞ 提交于 2019-12-24 19:38:58
问题 I have a problem with my recyclerView. I'm developing a "ToDo" App where the user can add some tasks to do and these tasks are displayed with a recyclerView. I'm also using Room, so I have a ViewModel, a Repository and a DAO. Inside the method onOptionsItemSelected (MainActivity) I have some filter like "Pending Tasks", Private Tasks, ... I would like to use an ItemTouchHelper to delete (swipe Left) and update a task from "pending" to "completed" (swipe Right). PROBLEM When I start the app I

Set text and show TextView conditionally in a RecyclerView

怎甘沉沦 提交于 2019-12-24 19:15:12
问题 I'm displaying a list alphabetically in a RecyclerView, each letter group should have a letter displayed to the left side, once, at the top of each group. The divider line is rendered in an ItemDecorator. I'm trying to solve this in onBindViewHolder. The initial layout works fine. As I scroll from the top to bottom everthing is as expected. But when I scroll back up the the initial/capital letter goes missing or it gets reordered. Scrolling down is showing the initial letter conditionally as

How to add Progress Dialog Box

荒凉一梦 提交于 2019-12-24 18:33:49
问题 I'm using Fragment to Display the Movies name, poster and reviews and Trailer using API key. I am trying to add progressbar such that when the RecyclerView is loading it will display the progress bar and when loading is complete..it will become invisible. I tried to put various method but it always gives me error or app compiles and run but crashes. Below is my MoviesUtil class file public class MoviesUtil { private static final Webb WEBB = Webb.create(); private static final String TMDB_API

Recyclerview show wrong when the keyboard open

爱⌒轻易说出口 提交于 2019-12-24 18:20:05
问题 Hi I have the next problem: I have 3 textviews and a RecyclerView below. When I touch one of them, the keyboard appear and the content of the RecyclerView hide. I check al the linear layout become moved. Here is my xml: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:card_view="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <android.support.design.widget

RecyclerView Adapter - NotifyItemRemoved - Removed item appears again after scroll

北慕城南 提交于 2019-12-24 17:13:24
问题 I think I am doing it all wrong, but I have a RecyclerView Adapter and simple button click (in this case a LinearLayout ) which triggers the following this.NotifyItemRemoved(position); The full button code is the following public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) { .......... LinearLayout _ARC = V.FindViewById<LinearLayout>(Resource.Id.moreArc); _ARC.Click += async delegate { try { Log.Info("101029", "ARC_Clicked"); await usersAct.SWITCH

How to make RecyclerView header not sticky?

怎甘沉沦 提交于 2019-12-24 16:58:03
问题 i have the following layout: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context="com.example.mkallingal.freakingnav.CardsListFragment"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="@color/darktext" android:layout_marginBottom="6dp" android

recyclerview.adapter resets radio-buttons

末鹿安然 提交于 2019-12-24 16:39:49
问题 This is my problem: https://youtu.be/k-N5uthYhYw and this is my onBindViewHolder() method. // Replace the contents of a view (invoked by the layout manager) @Override public void onBindViewHolder(final ViewHolder holder, final int position) { // - get element from your dataset at this position // - replace the contents of the view with that element holder.specName.setText(specList.get(position).getSpecName()); // Assign a tag number to later identify what radio-button holder.specRadioBtn