android - FlexboxLayoutManager setFlexDirection.ROW is not working -


the problem items show 1 item per row. this:

|   item    | |   item    | |   item    | 

i want show them this:

| item item | |   item    | |           | 

i have explicity set width of items 148dp. working fine in gridlayoutmanager when column span 2 or dynamic column per row based on width show many screen width there not center them easily.

after flexlayoutmanager got problem. although when set direction column items show attached left side still on each row. have realmrecycleview:

   <co.moonmonkeylabs.realmrecyclerview.realmrecyclerview     android:id="@+id/recycleviewdashboard"     android:layout_width="match_parent"     android:padding="@dimen/grid_item_offset"     android:cliptopadding="false"     android:layout_height="wrap_content"     app:rrvisrefreshable="false"     app:rrvlayouttype="linearlayout">    </co.moonmonkeylabs.realmrecyclerview.realmrecyclerview> 

and set layoutmanager

flexboxlayoutmanager layoutmanager = new flexboxlayoutmanager(getcontext());     layoutmanager.setflexdirection(flexdirection.row);     layoutmanager.setjustifycontent(justifycontent.space_around);     mrecyclerview.getrecycleview().setlayoutmanager(layoutmanager); 

and itemview:

<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="wrap_content" android:layout_height="wrap_content">  <imageview     android:id="@+id/image_view"     android:layout_centerinparent="true"     android:layout_width="148dp"     android:layout_height="148dp"     android:background="#ccc"     android:scaletype="fitxy" /> </relativelayout> 


Comments

Popular posts from this blog

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -

python - Error while using APScheduler: 'NoneType' object has no attribute 'now' -