android-recyclerview

horizontal recycler view inside vertical recycler View inside a fragment with onactivityResult

£可爱£侵袭症+ 提交于 2019-12-11 07:38:49
问题 I have a 'Fragment' which has a vertical RecyclerView , inside every item of the RecyclerView there is a horizontal RecyclerView with an add button. On clicking the Add button startActivityOnResult is called. The values on the onActivityResult have to update the horizontal RecyclerView in the particular view where I clicked add button. I have achieved almost everything but what's happening is when I update the horizontal RecyclerView , all the vertical view items horizontal RecyclerView is

How to create custom image buttons in Android studio?

穿精又带淫゛_ 提交于 2019-12-11 07:33:06
问题 How to create image buttons like this one in android studio? Does it need dependencies? or are there any other methods? 回答1: It can be done by various ways. Its just depends upon how you customize your layout. you can do that by.... 1- Linear layout with with white background with 1 image view and 1 textview inside... 2- using frame layout with image view and Text view. 3- the view in your image is a recycler view with cardviews. for using recycler and card you need support design

Repeat background on element with scroll RecycleAdapter and scroll

我是研究僧i 提交于 2019-12-11 07:29:24
问题 I have customrecycleAdapter and when I click on element i would change color of row, but if I scroll view background change position or appear on other element. I have read about Receycle of view, but so, What is workoround for this problem? my adapter is: public class CustomRecycleAdapter extends RecyclerView.Adapter<CustomRecycleAdapter.ViewHolder> { private JSONArray dataSource; private AdapterCallback mAdapterCallback; public static SparseBooleanArray selectedItems; public

Android - How to disable RecyclerView auto scroll from clicking

人走茶凉 提交于 2019-12-11 07:18:24
问题 Since API 24, the RecyclerView will auto scroll to a item which is displayed in partial by the user click the item. How to disable this feature? The codes below works before support-library 25.0.1 . @Override public boolean requestChildRectangleOnScreen(View child, Rect rect, boolean immediate) { Object tag = child.getTag(); if( tag != null && tag.toString().equalsIgnoreCase("preventAutoScroll") ){ return false; } return super.requestChildRectangleOnScreen(child, rect, immediate); } It has to

Hilighted/Selected items colour changes when not in view in RecyclerView

荒凉一梦 提交于 2019-12-11 07:15:11
问题 I have a RecyclerView with a large list of items. This RecyclerView has OnScrollListener for endless scrolling. When an item is selected I highlight it with a specific colour and when unselected the colour changes to normal/white. The issue that I am facing is after selecting a few visible items in my view when I scroll up or down to select a few more items the colour of already selected items changes to white. I tried adding a boolean variable (isSelected) in the model class and highlight

Why does RecyclerView scroll to top of view when view is focused

两盒软妹~` 提交于 2019-12-11 06:53:05
问题 I have RecyclerView , some kind of chat. Items are TextViews The layout is reversed. Input field below RecyclerView . When I scroll to the bottom of RecyclerView and click to the bottom item it gets focused (only when it gets focused, not every click) and RecyclerView scrolls automatically to the top of that item (when the text in item is larger than screen height). Also when the keyboard is visible and I click to RecyclerView item - keyboard hides and recycler view scrolls to the top of that

RecyclerView displaying the last item in the adapter several times. Need all adapter items to show in RecyclerView

≡放荡痞女 提交于 2019-12-11 06:46:08
问题 So I am trying to load data from a Parse database query into a recyclerView. The query is loading all my data into my ArrayList perfectly, which I then add to my adapter. Unfortunately, my recyclerView only displays the last addition to the adapter's data. However, if there are 15 objects in the adapter, then this last addition will be repeated 15 times on screen. I believe the issue is that the values inside of the data ArrayList, for some reason, do not exist outside of the query, even

Need an explanation why RecyclerView.Adapter.notifyItemChanged(int position, Object payload) and I bind payload parameter is List of objects

家住魔仙堡 提交于 2019-12-11 06:43:14
问题 RecyclerView.Adapter.notifyItemChanged(int position, Object payload), where payload is an arbitrary object that will be passed to RecyclerView.Adapter.onBindViewHolder(VH holder, int position, List payloads) So why list of payloads passed in the bind method if I can't pass than 1 object on item changed? 回答1: Well, there is a concept of Partial and Full binding in recycler view. This is what Android Developers site says about the onBindViewHolder method: The payloads parameter is a merge list

android value passing adapter to fragment

北城余情 提交于 2019-12-11 06:40:55
问题 I am developing an app for displaying images and text. When clicking on the item it goes to another fragment. The listing showing is correct but when I click on the item it does not go to fragment. I am using recycler adapter to listing the items. The code is shown below. public class MyRecyclerAdapter extends RecyclerView.Adapter < MyRecyclerAdapter.MyViewHolder > { String categoryId; private List < NewsFeeds > feedsList; private Context context; private LayoutInflater inflater; public

Android: how do I return to to top of RecyclerView after adding item?

给你一囗甜甜゛ 提交于 2019-12-11 06:28:37
问题 I have a RecyclerView list of CardViews. New CardViews are inserted at the top of the list. If the View is currently at the bottom of the CardView list and I click my "Add" button to create a new CardView, I want the RecyclerView to then show the new CardView at the top of the list. Currently, when the new CardView is created the RecyclerView just returns to the previous View at the bottom of the list. I've tried many things, without any luck, including: recyclerView.getLayoutManager()