scaledownby, scaledowndistance not work at the start app.
Item is imageview. I make drawable xml file like round shape, and setImageresource xml file. When i was start app, No scaleDown, No scaleDownDistance, looks like 0dp margin. I touch recyclerview, suddenly work scaleDown, scaleDownDistance. Why does this happen?
Hey thanks for pointing that out
Actually, I have overridden
scrollHorizontallyBy(int dx, RecyclerView.Recycler recycler, RecyclerView.State state)
method of LinearLayoutManger
So till the moment, this method is called nothing is scaling down.
Easy but hacky fix will be call
recyclerView.scrollBy(10, 0);
Will try to fix it.
Thanks for your advice. I tried it but didn't work. Sorry.
Here is my code.
PickerLayoutManager pickerLayoutManager = new PickerLayoutManager(getContext(), PickerLayoutManager.HORIZONTAL, false);
pickerLayoutManager.setChangeAlpha(true);
pickerLayoutManager.setScaleDownBy(0.4f);
pickerLayoutManager.setScaleDownDistance(0.3f);
SnapHelper snapHelper = new LinearSnapHelper();
snapHelper.attachToRecyclerView(recyclerview);
recyclerview.setLayoutManager(pickerLayoutManager);
Adapter adapter = new Adapter();
recyclerview.setAdapter(adapter);
recyclerview.scrollBy(10, 0);
I want show like this. O O O O O
O is round item.
but it show like this. no margin between items. OOOOO
Thanks again. Have a good day.
Hi I solve this problem.
I try recyclerview.scrollBy method but it doesn't work.
but recyclerview.smoothScrollBy method is work!
Thanks for your ideas. Today is Happy day! :-) 👍👍