android-recyclerview

Android - clicking on a widget inside a clickable cardview

戏子无情 提交于 2019-12-11 04:12:42
问题 After fighting and eventually implementing this: RecyclerView onClick I manage to make the cardviews clickable and long-clickable. This is working well, or maybe too well, because I also want a certain widget inside the cardview to be clickable so when clicking on it, the cardview should ignore the click, what happens now is that both the widget and the cardview, consume the click. Here is the code: The recyclerview: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

Multiple RecyclerView inside NestedScrollView Performance issue

浪尽此生 提交于 2019-12-11 03:54:49
问题 I am facing performance issue while adding multiple RecyclerView inside NestedScrollView. I am displaying two horizontal on top and vertical RecyclerView on bottom. I have Added below line recyclerView.setNestedScrollingEnabled(false); This is showing all list properly but real question is I am facing performance issue. All three RecyclerView is showing after ~5 sec of all response come. This is also blocking UI as it busy for RecyclerView to appear. XML <android.support.v4.widget

Recyclerview is not displaying data when using generic adapter & viewholder

两盒软妹~` 提交于 2019-12-11 03:44:22
问题 In my android project, I created Generic RecyclerView's Adapter class & Viewholder class like below, Adapter class, public class BaseRecyclerViewAdapter extends RecyclerView.Adapter<BaseViewHolder> { private ItemClickListener itemClickListener; private List<? extends Object> objectArrayList; private int layout; private BaseViewHolder baseViewHolder; public BaseRecyclerViewAdapter(int layout, ItemClickListener itemClickListener, List<? extends Object> objectArrayList) { this.layout = layout;

Multiple EditTexts in RecyclerView results in strange tab order

↘锁芯ラ 提交于 2019-12-11 03:37:31
问题 Thanks in advance for any help. I have an application that uses several ListViews. I am re-writing for Lollipop release and converting all ListViews into RecyclerViews. 2 out of 3 conversions were seamless, but I have 1 ListView that has several EditTexts per ViewHolder. After I've converted it to a RecyclerView, the 'tab order' or 'focus order' behaves strangely. Each ViewHolder has 4 EditTexts. If I start editing one, and press the Next button in the keyboard it advances to edit the next

Android Cursor RecyclerView does a flick on swipe

こ雲淡風輕ζ 提交于 2019-12-11 03:17:57
问题 I want to implement swipeable items in my recycler view. I'm using a custom recycler adapter populated with a Loader (Github link here) and a custom listener for swipe (Github link here). Data is stored locally with a SQLite and retrieved with a call to a filtered Cursor. I think I'm doing something wrong with the implementations, because what happens when I try to swipe is that my recycler item get like "flashed" for a very short time and then disappear. Everything works fine except for this

How to show multiple data soruce data in single recycle view or adapter?

核能气质少年 提交于 2019-12-11 03:11:15
问题 I have four type of different data with different view type like the below image . but that is not a problem problem is the data will came from different api. My question is how to combine them in a single adapter because i need to use lazy loading .so I cant load whole data at a time so i need to call the different type of api like : goallist api , aprisaList api , post Api etc. When user scroll. any one can give me a idea with example . How can i handle that ? Also when user will scroll it

setUserVisibleHint with Fragments for android

你。 提交于 2019-12-11 03:02:12
问题 Im using 3 fragments in my ViewPager adapter . I will be loading data from Parse(parse.com) and displaying them in recycler views. The following code is causing my app to crash. What my understanding is that when my MainActivity loads, this is my first fragment ie, it gets viewed by user immediately so the setUserVisibleHint function gets called immediately and in that v.findViewById code causes a null pointer exception since setContentView hasnt/ may not been called. My proof for this is if

RecyclerView should not have too many items?

只愿长相守 提交于 2019-12-11 02:53:42
问题 Please do not question the 'why' of this issue. I ran into it while prototyping some stuff, so will probably never end up in a released version. But that the crash occurred, troubled me. I use RecyclerView with a horizontal oriented LinearLayoutManager . I wanted to create a huge adapter, unlimited amount of items. So what I did was: @Override public int getItemCount() { return Integer.MAX_VALUE; } and to reuse the items: @Override public void onBindViewHolder(final RecyclerViewHolder holder,

Displaying messages from firebase database

半腔热情 提交于 2019-12-11 02:51:43
问题 I'm creating a social messaging app. the ideal on how the app function is where the messages are saved to the firebase database and then displayed on the RecyclerView.. the messages are saved to the database but not displayed on the RecyclerView. please help... thank you message adopter class. public class MessagesAdopter extends RecyclerView.Adapter { public MessagesAdopter(List<Messages> messagesList) { } @NonNull @Override public RecyclerView.ViewHolder onCreateViewHolder(@NonNull

PagedListAdapter does not update list if just the content of an item changes

别等时光非礼了梦想. 提交于 2019-12-11 02:39:14
问题 I'm using the Room and Paging libraries to display categories. My Entity: @Entity(tableName = Database.Table.CATEGORIES) data class Category( @PrimaryKey(autoGenerate = true) @ColumnInfo(name = ID) var id: Long = 0, @ColumnInfo(name = NAME) var name: String = "", @ColumnInfo(name = ICON_ID) var iconId: Int = 0, @ColumnInfo(name = COLOR) @ColorInt var color: Int = DEFAULT_COLOR ) My DAO: @Query("SELECT * FROM $CATEGORIES") fun getPagedCategories(): DataSource.Factory<Int, Category> @Update fun