android-recyclerview

Staggered Gridview (Recycleview) with load more functionality inside the NestedScrollView

半城伤御伤魂 提交于 2019-12-17 19:56:46
问题 I want to implement the load more functionality inside my Staggered gridview. I have tried some lines of code for it like using addOnScrollListener but did not call when i come to the bottom the list. Please find my code which i have tried to implement the load more functionality but not getting the expected result. MY_STRAGGED_RECYCLIVIEW.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrolled(RecyclerView recyclerView, int dx, int dy) { super.onScrolled

OnClickListener for RecyclerView

☆樱花仙子☆ 提交于 2019-12-17 19:54:46
问题 Unlike ListView, the Android RecyclerView seems way too complicated to implement. Since there is no OnItemClickListener for RecyclerView child, I've been trying to implement the following to register click events: final RecyclerView rv=(RecyclerView)findViewById(R.id.recycler_view); LinearLayoutManager llm=new LinearLayoutManager(this); rv.setLayoutManager(llm); MyRVAdapter rva=new MyRVAdapter(persons); rv.setAdapter(rva); rv.setOnClickListener(new View.OnClickListener() { @Override public

Why RecyclerView items disappear with scrolling

有些话、适合烂在心里 提交于 2019-12-17 19:52:37
问题 I am using a RecyclerView in my app but when I scroll on my RecyclerView my items will disappear! I used this code for a lot of RecyclerView but this time I don't know what is happening. there is my code for my Activity: public class ActivityStartup extends AppCompatActivity { Toolbar toolbar; DrawerLayout drawerLayout; NavigationView navigationView; RecyclerView menuListRecycler; RecyclerView schedualRecycler; private List<ReminderModel> tempSchedualArray = new ArrayList<>(); /** * ATTENTION

How is the position of a RecyclerView adapter related to the index of its dataset?

风格不统一 提交于 2019-12-17 19:43:00
问题 I thought they were the same, but they're not. The following code gives an indexOutOfBounds exception when I try to access the "position" index of my dataset, in this case a list of a model I created called Task: public class TaskAdapter extends RecyclerView.Adapter<TaskAdapter.TaskViewHolder> { private List<Task> taskList; private TaskAdapter thisAdapter = this; // cache of views to reduce number of findViewById calls public static class TaskViewHolder extends RecyclerView.ViewHolder {

RecyclerView focus scrolling

偶尔善良 提交于 2019-12-17 19:24:59
问题 I have a RecyclerView with usually two columns and up to eight. We use a lot of D-PAD navigation. We have a problem when scrolling, the focused item will jump from left to right. See photos: I noticed that if the items that are coming up next are cached, there is no focus problem when scrolling. Another problem I have is my focus item can appear below my sticky header. This is not desired. So I feel like if I made it so when scrolling it would have a sort of "threshold". This way when the

How to load data(json) into recycler view using volley

倾然丶 夕夏残阳落幕 提交于 2019-12-17 19:03:56
问题 I have implemented recyclerview in my application and now i need to fetch data from the server and i just came to know about volley being the best way to fetch data. I searched online but i am unable to find a proper tutorial for the same. This is how i initialized the recyclerview in my code.(which has hardcoded data set) mRecyclerView = (RecyclerView) findViewById(R.id.recyclerview); LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this); linearLayoutManager.setOrientation

Highlight selected item inside a RecyclerView

会有一股神秘感。 提交于 2019-12-17 18:19:31
问题 I'm having trouble with highlighted an item within a RecyclerView, similar to setting the selected item in a ListView. At the moment, I've set up up the RecyclerView, have a default LayoutManager, and have an adapter which displays all the data. I've just recently got the onClickListener() working (although I'm not sure if it should go in the onCreateViewHolder() or onBindViewHolder*( - not sure when onBindViewHolder() is called). I've tried searching around, and the closest I've gotten is

Handle on item long click on recycler view

邮差的信 提交于 2019-12-17 18:15:47
问题 I have an adapter that customizes a recyclerView and I want to open a popup menu on long click event on recyclerView 's items. How can I do this? 回答1: This has already been answered here. Anyway, you can do it like this: class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener, View.OnLongClickListener { private Article article; private TextView nameTextView; public ViewHolder(View itemView) { super(itemView); itemView.setOnClickListener(this); itemView

android - how to catch Drop action of ItemTouchHelper which is used with RecyclerView

萝らか妹 提交于 2019-12-17 18:13:08
问题 I have a problem with ItemTouchHelper of RecyclerView . I am making a game. The game board is actually a RecyclerView. RecyclerView has GridLayoutManager with some span count. I want to implement drag & drop recyclerview's items. Any item can dragging over all directions (up, down, left, right). private void initializeLayout() { recyclerView.setHasFixedSize(true); recyclerView.setLayoutFrozen(true); recyclerView.setNestedScrollingEnabled(false); // set layout manager GridLayoutManager

Android: RecyclerView content messed up after scrolling [closed]

浪子不回头ぞ 提交于 2019-12-17 18:03:24
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I'm using RecyclerView to display a list of marks, and each mark of the value is shown as a CardView. But some contents of the cards are lost after the scrolling the RecyclerView down and scrolling back, as shown in the two screenshots below. The contents in the red rectangle is lost after scrolling. BEFORE THE