TableView
TableView copied to clipboard
display from the right of RecyclerView
Is it possible to display from the right? Help me please. It is very necessary
I may help if you can give me more details about what you want to do.
i use android:layoutDirection="rtl"
I want to show the horizontal scrollbar recyclerView from the right for the first time.
As far as I understand, you want RecyclerView to scroll right on the first boot.
manager.smoothScrollToPosition(rvClub, null,0);
manager : FixedGridLayoutManager manager; rvClub : your RecyclerView.
state and the position are not important at this time. keep it null and 0.
Unfortunately it didn't work 😢
Then I have no other solution or idea. Good luck. Please let me know when you find the answer.
Hi How can I use scrollHorizontallyBy in the FixedGridLayoutManager?
The parameter dx means the change in x coordinate. In your case, you want to move it in the opposite direction. which means dx must be a negative value. But I have no idea about other parameters of scrollHorizontallyBy.
Still, I am not sure if you use manager.smoothScrollToPosition(rvClub, null,0) correctly.
/**
* Handles RecyclerView for the action
*/
private void setUpRecyclerView()
{
clubAdapter = new ClubAdapter(MainActivity.this, clubList);
FixedGridLayoutManager manager = new FixedGridLayoutManager();
manager.setTotalColumnCount(1);
rvClub.setLayoutManager(manager);
rvClub.setAdapter(clubAdapter);
rvClub.addItemDecoration(new DividerItemDecoration(MainActivity.this, DividerItemDecoration.VERTICAL));
manager.smoothScrollToPosition(rvClub, null, 0);
}
I got the following result from physical device, operating system Android 9.
Did you tried setReverseLayout(true) ? https://stackoverflow.com/questions/31728837/recyclerview-grow-element-from-right-to-left
Hi, Could you please help me out? I am trying to add views dynamically (not fixed in size) for each recycler view item, but the problem is after adding views, it's not scrolling horizontally. Attached screenshot for reference
.
Hi,
Can you give 200dp width to each element you add to the row of the RecyclerView and tell me if it works? The width of each row of the RecyclerView must be wrap_content.
Do you have the 16th, 17th or 20th element in each row?
Hi, I tried to set a fixed height/width for the row item element, but still, it is not getting scroll. It gets scrolled when we have fixed views in each item of recycler view.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/score_text_view"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_centerInParent="true"
android:gravity="center"
android:textColor="@color/colorPrimaryDark" />
</RelativeLayout>
Then I have no other solution. Hope you can solve it.