I searched a couple of hours, but did not find anything according to your requirement. But there are some tricks or do with some hacked code that we can get in accordance with your requirements.
Install RecyclerView as shown below in your XML file.
<android.support.v7.widget.RecyclerView android:id="@+id/recyclerView" android:layout_width="match_parent" android:layout_height="wrap_content" android:scrollbarAlwaysDrawHorizontalTrack="true" android:scrollbarSize="10dp" android:scrollbarStyle="outsideInset" android:scrollbarThumbVertical="@color/black" android:scrollbars="horizontal" android:verticalScrollbarPosition="right"/>
Put your data in descending order in a List or ArrayList , because we need to rotate recyclerviews, so when we rotate it, our data will be displayed as an ASEC order.
//call this method for set recyclerview private void setRecyclerView() { //Please make sure with your item that it will be inserted in revers order then an then it will be working ArrayList<String> itemList = new ArrayList<>(); for (int i = 50; i > 0; i--){ itemList.add("item " + i); } ContainerAdapter adapterMessage = new ContainerAdapter(MainActivity.this, itemList); if (adapterMessage != null) { rvItemList.setHasFixedSize(true); rvItemList.setLayoutManager(new LinearLayoutManager(MainActivity.this, LinearLayoutManager.HORIZONTAL, false); rvItemList.setItemAnimator(new DefaultItemAnimator()); rvItemList.setAdapter(adapterMessage); //here is the main line for your requirement rvItemList.setRotation(180); adapterMessage.notifyDataSetChanged(); }
Now, in your adapter, please rotate your view in the opposite direction, as shown below.
public class ViewHolder extends RecyclerView.ViewHolder { TextView txt_name; public ViewHolder(View itemView) { super(itemView); txt_name = (TextView) itemView.findViewById(R.id.txt_name);
If you make the code as above, your element and its output look like OutPut
Please do not forget to make such a code, because android is not responsible for this type of code, but according to your requirement you can do it.
source share