1

I'm currently using the Devsmartlib.jar library.

This is what's in my activitymain.xml file:

<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:gravity="right">

<com.devsmart.android.ui.HorizontalListView
    android:id="@+id/hlistview"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="right" />
</LinearLayout>

I want to show my list right to left , But it is not working.
Please help me.

Mohammad
  • 15
  • 1
  • 7

3 Answers3

0

If you're trying to modify the width to give space for your circle, you could do that in your actual items. If you think you need more space around that circle of yours in each item, edit the XML for the individual items and add this to the ImageView for the circle that you have:

android:padding = "6dp"

or whatever size you think looks better for that circle to not be so cramped.

Your other main option here would be to add this to your actual ListView XML:

android:minWidth="50dp"

or any value that looks appropriate. That'll set the minimum width for each of those views. I recommend working with the XML for the view as I noted above, though, as that's a more general expanding solution.

You can read more about android:minWidth in the Android docs here.

Alex K
  • 8,269
  • 9
  • 39
  • 57
0
<LinearLayout
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:gravity="right">

<com.devsmart.android.ui.HorizontalListView
    android:id="@+id/hlistview"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:stackFromBottom="true" //<==Add this
    android:layout_gravity="right" />
</LinearLayout>
Rajesh
  • 2,618
  • 19
  • 25
0


this code is work!

mLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, true);

mRecyclerView.setLayoutManager(mLayoutManager);
Yaser Niknam
  • 3
  • 1
  • 5
  • You should provide a bit more information on what the answer does instead of just "This code works!" - it will help the person who asked the question understand the solution and also for future users – Alan Kavanagh Nov 29 '17 at 11:13