Ответ 1
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="@+id/categoryItems"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:visibility="visible">
<org.lucasr.twowayview.TwoWayView
android:id="@+id/filterGrid"
style="@style/TwoWayView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_small"
android:drawSelectorOnTop="false"
app:twowayview_numRows="3"
app:twowayview_layoutManager="GridLayoutManager" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#d3d3d3" />
</LinearLayout>
Используйте горизонтальную ориентацию для внутреннего LinearLayout