android-recyclerview

How to apply ItemDecoration from left and right side both to RecyclerView item?

不想你离开。 提交于 2021-01-27 07:32:13
问题 I have been trying to achieve this for so long. What I want is to overlap the selected RecyclerView item from left and right as shown in the picture below. I'm able to achieve left or right by ItemDecoration like below: class OverlapDecoration(private val overlapWidth:Int) : RecyclerView.ItemDecoration() { private val overLapValue = -40 val TAG = OverlapDecoration::class.java.simpleName override fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State?) {

How to apply ItemDecoration from left and right side both to RecyclerView item?

给你一囗甜甜゛ 提交于 2021-01-27 07:31:23
问题 I have been trying to achieve this for so long. What I want is to overlap the selected RecyclerView item from left and right as shown in the picture below. I'm able to achieve left or right by ItemDecoration like below: class OverlapDecoration(private val overlapWidth:Int) : RecyclerView.ItemDecoration() { private val overLapValue = -40 val TAG = OverlapDecoration::class.java.simpleName override fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State?) {

Prevent RecyclerView to scroll by hand

混江龙づ霸主 提交于 2021-01-27 06:47:11
问题 I have a list of items like an album and I show it by RecyclerView. Also, each item has a button to send some data to the server by clicking and then scroll to the next position in list. So my question is: How to prevent RecyclerView from scrolling by hand (gesture) but scroll to a position if smoothScrollToPosition() method called? 回答1: Here's a solution for horizontal scrolling that allows you to turn off scrolling, but still enable it via calling smoothScrollToPosition. It also lets the

Prevent RecyclerView to scroll by hand

穿精又带淫゛_ 提交于 2021-01-27 06:46:10
问题 I have a list of items like an album and I show it by RecyclerView. Also, each item has a button to send some data to the server by clicking and then scroll to the next position in list. So my question is: How to prevent RecyclerView from scrolling by hand (gesture) but scroll to a position if smoothScrollToPosition() method called? 回答1: Here's a solution for horizontal scrolling that allows you to turn off scrolling, but still enable it via calling smoothScrollToPosition. It also lets the

Prevent RecyclerView to scroll by hand

前提是你 提交于 2021-01-27 06:42:31
问题 I have a list of items like an album and I show it by RecyclerView. Also, each item has a button to send some data to the server by clicking and then scroll to the next position in list. So my question is: How to prevent RecyclerView from scrolling by hand (gesture) but scroll to a position if smoothScrollToPosition() method called? 回答1: Here's a solution for horizontal scrolling that allows you to turn off scrolling, but still enable it via calling smoothScrollToPosition. It also lets the

Espresso Matcher for Nested RecyclerView

落花浮王杯 提交于 2021-01-27 06:02:40
问题 So here's a breakdown of my hierarchy: RecyclerView --> LinearLayout --> RecyclerView --> FrameLayout -> FrameLayout Here's a screenshot: I would like to be able to verify the FrameLayout with the text is displayed. This what I have tried so far: onView(withRecyclerView(R.id.container_list).atPositionOnView(0, R.id.row_content)) .check(matches(withRecyclerView(R.id.row_content).atPositionOnView(0, R.id.info_field))) .check(matches(isDisplayed())); But it causes an

Talkback focus goes to toolbar items when recyclerview within nestedscrollview is scrolled

老子叫甜甜 提交于 2021-01-27 05:27:14
问题 I have a nestedscrollview within my layout which contains few texts, buttons and recyclerviews. When talkback is on, I am able to traverse through all elements. But I face an issue. When my horizontal recyclerview is scrolled and then I swipe to hear the talkback, the focus moves to the toolbar first item. Then I need to traverse through all the visible items to reach to the horizontal scrollview scrolled item. This issue arises only for recyclerviews within nestedscrollview. My

Talkback focus goes to toolbar items when recyclerview within nestedscrollview is scrolled

微笑、不失礼 提交于 2021-01-27 05:25:56
问题 I have a nestedscrollview within my layout which contains few texts, buttons and recyclerviews. When talkback is on, I am able to traverse through all elements. But I face an issue. When my horizontal recyclerview is scrolled and then I swipe to hear the talkback, the focus moves to the toolbar first item. Then I need to traverse through all the visible items to reach to the horizontal scrollview scrolled item. This issue arises only for recyclerviews within nestedscrollview. My

Talkback focus goes to toolbar items when recyclerview within nestedscrollview is scrolled

走远了吗. 提交于 2021-01-27 05:25:27
问题 I have a nestedscrollview within my layout which contains few texts, buttons and recyclerviews. When talkback is on, I am able to traverse through all elements. But I face an issue. When my horizontal recyclerview is scrolled and then I swipe to hear the talkback, the focus moves to the toolbar first item. Then I need to traverse through all the visible items to reach to the horizontal scrollview scrolled item. This issue arises only for recyclerviews within nestedscrollview. My

how to get string from string.xml in adapter class on click method

浪尽此生 提交于 2021-01-24 01:28:51
问题 I want to get string in my adapter class on view holder in on click method my app crash when i implement the code write below in on click if(postion==1) . public class Adapter extends RecyclerView.Adapter<Adapter.ViewHolder>{ private Context context; String SongURL; private String[] data; public Adapter(String[] data){ this.data = data; } @NonNull @Override public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { LayoutInflater inflater = LayoutInflater.from(parent