android-recyclerview

Map Recyclerview inside scrollview display black flickering background while scrolling

江枫思渺然 提交于 2019-12-10 15:54:16
问题 I have used map view inside recyclerview row. I have attached screenshot. While scrolling maps display black flickering background. Adapter code: @Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { if (viewType == TASK_VIEW) { return new TasksViewHolder(LayoutInflater.from(parent.getContext()) .inflate(R.layout.item_task_row, parent, false)); } else if (viewType == CHECKIN_VIEW) { return new CheckInViewHolder(LayoutInflater.from(parent.getContext())

Android SearchView requires two clicks to expand the view

大兔子大兔子 提交于 2019-12-10 15:38:54
问题 Short: When I click on my SearchViewIcon, the SearchView doesn't collapse/expand. Long: I"m using a SearchView to filter a RecyclerView in a Fragment that is in my MainActivity. When I click on the SearchViewIcon (SearchView is iconified by default). I open the tab with the correct Fragment with this code: searchView.setOnSearchClickListener(new View.OnClickListener() { @Override public void onClick(View v) { viewPager.setCurrentItem(2, false); } }); The Tab with the correct Fragment is

RecyclerView 23.2.x height=0dp causes onBind called for all items and scrollToPosition not working

痞子三分冷 提交于 2019-12-10 15:32:22
问题 UPDATE I just updated the support library to 23.3.0 and this problem does not seem to happen any more. I suppose this was a bug in the 23.2.X version. Well, this is not the first time that I have spent hours on a weird problem, and then later found that it was a bug of the Android SDK. END UPDATE In the following code, I set layout_height="0dp" and layout_weight="1" to the recycler view to make it fill the remaining space of a linear layout. It looks to me that layout_height would not be

getWidth() & getHeight() returning 0 inside RecyclerView/Fragment

走远了吗. 提交于 2019-12-10 15:24:50
问题 I'm calling the populating method for the RecyclerView inside the OnCreateView method in several fragments, they are then directed to the adapter for which populates the feeds (depending on the context of the Fragment ). At the minute, I am adding tags to an uploaded image from a user on the feed. Those tags require an x and y value (position), in which is a percentage of the container (which is set and saved to a BaaS when they upload). At the moment, the pixel to percentage formula works

Synchronize scrolling on multiple RecyclerViews in adapter

感情迁移 提交于 2019-12-10 15:19:36
问题 I want to implement an horizontal RecyclerView inside a vertical RecyclerView . The end result should be like this: So, for each element in the vertical RecyclerView , I need another one in an horizontal way. Kind of like a school schedule, with the Day in the left, and the actual schedule on the right, scroll-able horizontally. I managed to achieve this, by putting an RecyclerView inside of the first RecyclerView item. Everything works perfectly, but all the horizontal RecyclerView s are

How to Limit Number of Items in RecyclerView?

流过昼夜 提交于 2019-12-10 14:47:01
问题 How can I limit the number of items displayed by the RecyclerView ? I can limit the amount inserted it if I override getChildCount , but that causes it to only insert that number and then stop. I want it to keep inserting/scrolling, but only display X number of items. (Note: The height of each item can differ, so it's important that the limit is based on quantity rather than some hard coded value.) 回答1: Inside your Recyclerview's adapter class; private final int limit = 10; @Override public

parent.getContext within RecyclerView.Adapter's onCreateViewHolder method

依然范特西╮ 提交于 2019-12-10 14:11:46
问题 I have a custom fragment which is attached to my MainActivity. The layout file of the fragment contains the recyclerview widget. fragment_main.xml: <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v7.widget.RecyclerView android:id="@+id/recycler_view" android:layout_width="match_parent" android:layout_height="match_parent" android:scrollbars=

2D List with RecyclerView in HorizontalScrollView

冷暖自知 提交于 2019-12-10 13:59:19
问题 I am trying to build a view which will allow the user to scroll an Excel-like structure both horizontally and vertically. My initial idea was to put a RecyclerView (with LinearManager) into a HorizontalScrollView. But it does not seem to work. Here is my code: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v7.widget.Toolbar

Unexplainable forced scroll down in RecyclerView after notifyItemMoved() is called

好久不见. 提交于 2019-12-10 13:36:01
问题 In my app I have a list of items implemented with RecyclerView. Under certain conditions items might be moved to the very end of the list and I need that to be animated. So first I move the items to the end in the data source (ArrayList in my case) and call adapter's notifyItemMoved(oldPosition, dataSet.size() - 1) method. Everything works ok except the case when the element I move to the end (it doesn't actually matter if it's the very end of the list or just a bit lower position) is either

Android with Kotlin error when use RecyclerView in Fragment

喜你入骨 提交于 2019-12-10 13:32:27
问题 I have error said this: Process: com.example.yudha.kotlinauth, PID: 16435 java.lang.IllegalStateException: video_recyclerview must not be null at com.example.yudha.kotlinauth.fragments.VideoFragment.onCreateView(VideoFragment.kt:30) RecyclerView Adapter: class MainAdapter : RecyclerView.Adapter<CustomViewHolder>(){ val videoTitles = listOf("First title", "Second", "3rd", "Moore Title") //number of item override fun getItemCount(): Int { return videoTitles.size } override fun