android-recyclerview

Firebase UI RecyclerView onClick

不问归期 提交于 2019-12-29 04:54:48
问题 I am using Firebase UI FirebaseRecyclerAdapter to populate a RecyclerView. I managed to get click events from components of my item view (the title), but not for anywhere in the item view, which is what I need. I followed google sample. In my Activity: private void setRecyclerView() { recyclerView = (RecyclerView) findViewById(R.id.recycler_view_gigs); recyclerView.setHasFixedSize(true); recyclerView.setLayoutManager(new LinearLayoutManager(this)); mAdapter = new FirebaseRecyclerAdapter<Gig,

Zoom central image recycler view

风流意气都作罢 提交于 2019-12-29 04:50:07
问题 I have RecyclerView with images. It based on this solution. Images are lazy loaded into view with Glide. I need to add zoom on central image like in this: How can i do it? 回答1: The most direct way to affect what you want is to extend LinearLayoutManager . As you've no doubt discovered, hooking into the scroll events properly is a pain: So let's extend the manager. We'll create a few parameters that you might expose. public class ZoomCenterCardLayoutManager extends LinearLayoutManager { //

Why Glide blink the item ImageView when notifydatasetchanged

空扰寡人 提交于 2019-12-29 04:19:08
问题 I am using Glide 3.7.0 with RecyclerView . The item view always blinks when refreshing (calling notifyDataSetChanged ). Here is my code: Glide .with(context) .load(filepath) .diskCacheStrategy(DiskCacheStrategy.NONE) .skipMemoryCache(true) .dontAnimate() .into(imageview); When I use no cache, the ImageView has a null Bitmap when notifyDataSetChanged method is called and Glide hasn't finished loading the bitmap. If I use the code below: Glide .with(context) .load(filepath) .dontAnimate() .into

RecyclerView ItemTouchHelper swipe remove animation

╄→гoц情女王★ 提交于 2019-12-29 04:16:12
问题 I've got a remove on swipe, that draws a background (much like the Inbox app), implemented by an ItemTouchHelper - by overriding the onChilDraw method and drawing a rectangle on the provided canvas: ItemTouchHelper mIth = new ItemTouchHelper( new ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.RIGHT) { public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) { remove(viewHolder.getAdapterPosition()); } public boolean onMove(RecyclerView recyclerview, RecyclerView.ViewHolder v

Recycler view inside NestedScrollView causes scroll to start in the middle

吃可爱长大的小学妹 提交于 2019-12-29 02:21:11
问题 I am getting a weird scrolling behavior when I add a RecyclerView inside a NestedScrollView. What happens is that whenever the scrollview has more rows than can be shown in the screen, as soon as the activity is launched, the NestedScrollView starts with an offset from the top (image 1). If there are few items in the scroll view so that they can all be shown at once, this doesn't happen (image 2). I am using version 23.2.0 of the support library. Image 1 : WRONG - starts with offset from the

Recycler view inside NestedScrollView causes scroll to start in the middle

微笑、不失礼 提交于 2019-12-29 02:20:24
问题 I am getting a weird scrolling behavior when I add a RecyclerView inside a NestedScrollView. What happens is that whenever the scrollview has more rows than can be shown in the screen, as soon as the activity is launched, the NestedScrollView starts with an offset from the top (image 1). If there are few items in the scroll view so that they can all be shown at once, this doesn't happen (image 2). I am using version 23.2.0 of the support library. Image 1 : WRONG - starts with offset from the

how to read all value from room data base and show into recyclerview?

馋奶兔 提交于 2019-12-29 02:00:12
问题 I am using room database for storing json data from URL its working fine but while accessing data from data base to show on recyclerview its give one result at time and if i am open app second time then second object is showing, i am new in room can any one suggest me how to do this my code is. App my pojo class. My Adapter Class is. recyclerView = view.findViewById(R.id.recyclerView); postsAdapter = new PostsAdapter(new ArrayList<Example>()); recyclerView.setLayoutManager(new

Background color or Images shuffling on scrolling in recyclerview?

允我心安 提交于 2019-12-29 00:46:29
问题 I am wondering that my images and color of layouts shuffling when i scrolls downwards or upwards, I created cardview using recyclerview. and set an image(changes color on click like to know if its user's favourite item) and setbackgroundcolor(randomly chossen) to the parent layout to make cardview attractive. but when i scrolls 1. the image that image changes position, 2. the layout background changes color automatically. I am posting my adapter's code here. public class TOAdapter extends

RecyclerView won't update child until I scroll

我与影子孤独终老i 提交于 2019-12-28 18:52:34
问题 I think I've read pretty much all the answers to all of the similar SO questions, and NONE of them seem to be working for me. It's driving me nuts, and I've spent too much time on this. I'm implementing a RecyclerView here and I can't for the life of me update it's children. What happens is that after I update nothing changes on the screen, UNLESS I start scrolling. Once I scroll it updates perfectly . This is my code: public void updateDataAtIndex(final int indexToUpdate, ReadableMap

RecyclerView won't update child until I scroll

[亡魂溺海] 提交于 2019-12-28 18:50:13
问题 I think I've read pretty much all the answers to all of the similar SO questions, and NONE of them seem to be working for me. It's driving me nuts, and I've spent too much time on this. I'm implementing a RecyclerView here and I can't for the life of me update it's children. What happens is that after I update nothing changes on the screen, UNLESS I start scrolling. Once I scroll it updates perfectly . This is my code: public void updateDataAtIndex(final int indexToUpdate, ReadableMap