Позиционирование элементов с ListView

Очень надолго застрял с проблемой, нужно отпозиционировать элементы вертикально следующим образом: введите сюда описание изображения

И проблема в том что при Linaerlayout - listItem(ListView) выталкивает по высоте всё что под ним вниз за экран, либо при Relativelayout элементы залезают под меню из кнопок если применить к меню из кнопок фиксацию вида: android:layout_gravity="bottom". Мне нужно зафиксировать эти кнопки внизу независимо от количества элементов в listItem, и чтобы listItem был так как показано на изображении.

<?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"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/motionLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".MainActivity">

    <RelativeLayout
        android:id="@+id/menu_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="15dp"
        android:orientation="horizontal">

        <ImageView
            android:id="@+id/image_logo"
            android:layout_width="110dp"
            android:layout_height="110dp"
            app:srcCompat="@mipmap/ic_launcher_foreground" />

        <SearchView
            android:id="@+id/search_bar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:layout_marginStart="65dp"
            android:iconifiedByDefault="false"
            android:orientation="horizontal"
            android:queryHint="Поиск по имени" />
    </RelativeLayout>

    <ListView
        android:id="@+id/listItem"
        android:layout_width="match_parent"
        android:layout_height="655dp"/> <!-- wrong -->



    <HorizontalScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom"
        android:fillViewport="true">

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:orientation="horizontal">

            <Button
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="@android:color/white"
                android:text="Name_1" />

            <Button
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="@android:color/white"
                android:text="Name_2" />

            <Button
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="@android:color/white"
                android:text="Name_3" />

            <Button
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="@android:color/white"
                android:text="Name_4" />

            <Button
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="@android:color/white"
                android:text="Name_5" />

            <Button
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="@android:color/white"
                android:text="name_6" />

        </LinearLayout>
    </HorizontalScrollView>
</LinearLayout>

Ответы (0 шт):