Tag: recyclerview

RecyclerView with GridLayoutManager and Picasso showing wrong image

Update #1 Added hasStableIds(true) and updated Picasso to version 2.5.2. It does not solve the issue. Reproduction: RecyclerView with GridLayoutManager (spanCount = 3). List items are CardViews with ImageView inside. When all the items does not fit the screen calling notifyItemChanged on one item causes more than one calls to onBindViewHolder(). One call is for […]

How to mimic Lollipop's phone app, with resizing of upper items before the scrollable content?

Background On Lollipop’s Phone app, when you reach the “recents” or “contacts” tab, and you try to scroll, first thing that happens is resizing of the upper area, which consist of a recent event and a search box, as such : If there were a lot more than 3 items on the RecyclerView, the RecyclerView […]

NestedScrollView scroll with recyclerview

I layout a RecyclerView in a NestedScrollView and I want make the NestedScrollView scroll with RecyclerView, but this only happens when the recyclerView reach the end, below is my layout code: <android.support.v4.widget.NestedScrollView android:id=”@+id/lists_frame” 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:animateLayoutChanges=”true” tools:context=”com.example.niuky.design.MainActivity4″ > <LinearLayout android:layout_width=”match_parent” android:layout_height=”match_parent” android:orientation=”vertical” > <View android:id=”@+id/header” android:layout_width=”match_parent” android:layout_height=”256dp” android:background=”@color/material_blue_grey_800″ /> <View android:id=”@+id/tabs” android:layout_width=”match_parent” android:layout_height=”?android:attr/actionBarSize” […]

How to Skip First Row in RecyclerView Item Decoration for GridLayout?

I’m using this ItemDecoration class for GridLayout -> https://github.com/devunwired/recyclerview-playground/blob/master/app/src/main/java/com/example/android/recyclerplayground/GridDividerDecoration.java But the problem is, my first row in GridLayout is an image and I set the span to 2. You can view my screen as per screenshot below : How to skip the first row so that ItemDecoration didn’t draw on the Image? Below is the […]

Pause a video in a recyclerView when it is a certain percentage on the screen

I want to play a video when its view is 75% on the screen inside of the recyclerView adapter. So findFirstVisibleItem and all those would not work here. (Or if they do, I have no idea how they would work). Currently I am waiting for views to be recycled before I am able to pause […]

Recyclerview binds all views at the same time

I have a vertical recyclerview (with a GridLayoutManager) inside another recyclerview (with LinearLayoutManager). The problem I am facing right now is that, the inner recyclerview (with GridLayoutManager) binds all of it’s items at the same time, even the views that are not on the screen at the moment (onBindViewHolder() gets called for all of its […]

How implement sticky footer in recyclerview

I have RecyclerView and I need next behavior: if there are a lot of items (more then fits screen) – footer is last item if few item/no item – footer is located at screen bottom Please advise how can I implement this behavior.

Update RecyclerView.Adapter after Camera Intent

So currently, I’m capturing an image and updating it in a RecyclerView using the Camera Intent: private void cameraIntent() { Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); if (takePictureIntent.resolveActivity(getActivity().getPackageManager()) != null) { File photoFile = null; try { photoFile = createImageFile(); } catch (IOException ex) { Log.e(TAG, ex.getLocalizedMessage()); } if (photoFile != null) { Uri uri = […]

Drag and Drop view outside of Recyclerview

What I want to achieve: I want to have a view inside a scrollable layout (Recyclerview with GridlayoutManager) with tiles (Views) in it. Dragging and dropping an item inside of the RecyclerView should adjust the position of the icon and swap with the other elements. When a drag starts, an icon above the RecyclerView will […]

something weird happens while scrolling RecyclerView too fast

I’m using RecyclerView for a long list and when i scroll too fast, something weird happens. There are two problems. First one is the one in the image below. One of items (like red bordered one in the image) sticks on some random part of the screen and blocks other items. It disappears when the […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.