how stick the child of linear layout in the bottom

Viewed 12

I have a linear layout that has a buttons inside of it. My problem is whenever I try to change the height of the button, the button will adjust it self to match with the highest value of height. What is the proper way to stick the buttons in the bottom [Example is given below][1]

The code:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fullscreen"
android:background="@color/black">

<EditText
    android:id="@+id/inputBox"
    android:layout_width="fill_parent"
    android:layout_height="40dp"
    android:layout_alignParentStart="true"
    android:layout_alignParentBottom="true"
    android:layout_marginStart="10dp"
    android:layout_marginTop="10dp"
    android:layout_marginEnd="10dp"
    android:layout_marginBottom="20dp"
    android:layout_toStartOf="@+id/shuffle"
    android:background="@drawable/round_edit_text"
    android:hint="@string/type_here"
    android:inputType="numberSigned|numberDecimal"
    android:padding="10dp"
    android:textColor="@color/black"
    android:textColorHint="@color/black"
    android:textSize="15sp" />

<ImageView
    android:id="@+id/shuffle"
    android:layout_width="40dp"
    android:layout_height="40dp"
    android:layout_alignParentBottom="true"
    android:layout_marginStart="10dp"
    android:layout_marginTop="10dp"
    android:layout_marginEnd="10dp"
    android:layout_marginBottom="20dp"
    android:layout_toStartOf="@+id/add"
    app:srcCompat="@drawable/ic_baseline_shuffle_24"
    android:contentDescription="@string/shuffle" />

<ImageView
    android:id="@+id/add"
    android:layout_width="40dp"
    android:layout_height="40dp"
    android:layout_alignParentBottom="true"
    android:layout_marginStart="10dp"
    android:layout_marginTop="10dp"
    android:layout_marginEnd="10dp"
    android:layout_marginBottom="20dp"
    android:layout_toStartOf="@+id/play"
    app:srcCompat="@drawable/ic_baseline_add_circle_24" />

<ImageView
    android:id="@+id/play"
    android:layout_width="40dp"
    android:layout_height="40dp"
    android:layout_alignParentEnd="true"
    android:layout_alignParentBottom="true"
    android:layout_marginStart="10dp"
    android:layout_marginTop="10dp"
    android:layout_marginEnd="10dp"
    android:layout_marginBottom="20dp"
    app:srcCompat="@drawable/ic_baseline_play_circle_filled_24" />
<View
    android:id="@+id/divider"
    android:layout_width="match_parent"
    android:layout_height="1dp"
    android:background="?android:attr/listDivider"
    android:backgroundTint="@color/white"
    android:layout_above="@+id/inputBox"
    android:layout_marginBottom="10dp" />

<LinearLayout
    android:id="@+id/barBox"
    android:layout_width="match_parent"
    android:layout_height="fill_parent"
    android:layout_above="@+id/divider"
    android:layout_alignParentStart="true"
    android:layout_alignParentTop="true"
    android:layout_alignParentEnd="true"
    android:layout_centerInParent="true"
    android:layout_centerVertical="true"
    android:orientation="horizontal"
    android:gravity="bottom"
   >

    <Button
        android:id="@+id/button1"
        android:layout_width="0dp"
        android:layout_gravity="bottom"
        android:layout_height="100dp"
        android:layout_weight="1"
        android:background="@color/white"
        android:textColor="@color/black"
        android:textSize="11sp" />

    <Button
        android:layout_gravity="bottom"
        android:id="@+id/button2"
        android:layout_width="0dp"
        android:layout_height="30dp"
        android:layout_marginStart="1dp"
        android:layout_weight="1"
        android:background="@color/white"
        android:gravity="bottom"
        android:textColor="@color/black"
        android:textSize="11sp" />

    <Button
        android:id="@+id/button3"
        android:layout_width="0dp"
        android:layout_height="200dp"
        android:layout_marginStart="1dp"
        android:layout_weight="1"
        android:background="@color/white"
        android:textColor="@color/black"
        android:textSize="11sp" />

    <Button
        android:id="@+id/button4"
        android:layout_width="0dp"
        android:layout_height="wrap_content"

        android:layout_marginStart="1dp"
        android:layout_weight="1"
        android:background="@color/white"
        android:textColor="@color/black"
        android:textSize="11sp" />

    <Button
        android:id="@+id/button5"
        android:layout_width="0dp"
        android:layout_height="wrap_content"

        android:layout_marginStart="1dp"
        android:layout_weight="1"
        android:background="@color/white"
        android:textColor="@color/black"
        android:textSize="11sp" />

    <Button
        android:id="@+id/button6"
        android:layout_width="0dp"
        android:layout_height="wrap_content"

        android:layout_marginStart="1dp"
        android:layout_weight="1"
        android:background="@color/white"
        android:textColor="@color/black"
        android:textSize="11sp" />

    <Button
        android:id="@+id/button7"
        android:layout_width="0dp"
        android:layout_height="wrap_content"

        android:layout_marginStart="1dp"
        android:layout_weight="1"
        android:background="@color/white"
        android:textColor="@color/black"
        android:textSize="11sp" />

    <Button
        android:id="@+id/button8"
        android:layout_width="0dp"
        android:layout_height="wrap_content"

        android:layout_marginStart="1dp"
        android:layout_weight="1"
        android:background="@color/white"
        android:textColor="@color/black"
        android:textSize="11sp" />

    <Button
        android:id="@+id/button9"
        android:layout_width="0dp"
        android:layout_height="wrap_content"

        android:layout_marginStart="1dp"
        android:layout_weight="1"
        android:background="@color/white"
        android:textColor="@color/black"
        android:textSize="11sp" />

    <Button
        android:id="@+id/button10"
        android:layout_width="0dp"
        android:layout_height="wrap_content"

        android:layout_marginStart="1dp"
        android:layout_weight="1"
        android:background="@color/white"
        android:textColor="@color/black"
        android:textSize="11sp" />

    <Button
        android:id="@+id/button11"
        style="?android:attr/buttonBarButtonStyle"
        android:layout_width="0dp"
        android:layout_height="wrap_content"

        android:layout_marginStart="1dp"
        android:layout_weight="1"
        android:background="@color/white"
        android:textColor="@color/black"
        android:textSize="11sp" />

    <Button
        android:id="@+id/button12"
        style="?android:attr/buttonBarButtonStyle"
        android:layout_width="0dp"
        android:layout_height="wrap_content"

        android:layout_marginStart="1dp"
        android:layout_weight="1"
        android:background="@color/white"
        android:textColor="@color/black"
        android:textSize="11sp" />

    <Button
        android:id="@+id/button13"
        style="?android:attr/buttonBarButtonStyle"
        android:layout_width="0dp"
        android:layout_height="wrap_content"

        android:layout_marginStart="1dp"
        android:layout_weight="1"
        android:background="@color/white"
        android:textColor="@color/black"
        android:textSize="11sp" />

    <Button
        android:id="@+id/button14"
        android:layout_width="0dp"
        android:layout_height="wrap_content"

        android:layout_marginStart="1dp"
        android:layout_weight="1"
        android:background="@color/white"
        android:textColor="@color/black"
        android:textSize="11sp" />

    <Button
        android:id="@+id/button15"
        android:layout_width="0dp"
        android:layout_height="wrap_content"

        android:layout_marginStart="1dp"
        android:layout_weight="1"
        android:background="@color/white"
        android:textColor="@color/black"
        android:textSize="11sp" />

    <Button
        android:id="@+id/button16"
        android:layout_width="0dp"
        android:layout_height="wrap_content"

        android:layout_marginStart="1dp"
        android:layout_weight="1"
        android:background="@color/white"
        android:textColor="@color/black"
        android:textSize="11sp" />

    <Button
        android:id="@+id/button17"
        android:layout_width="0dp"
        android:layout_height="wrap_content"

        android:layout_marginStart="1dp"
        android:layout_weight="1"
        android:background="@color/white"
        android:textColor="@color/black"
        android:textSize="11sp" />

    <Button
        android:id="@+id/button18"
        android:layout_width="0dp"
        android:layout_height="wrap_content"

        android:layout_marginStart="1dp"
        android:layout_weight="1"
        android:background="@color/white"
        android:textColor="@color/black"
        android:textSize="11sp" />

    <Button
        android:id="@+id/button19"
        android:layout_width="0dp"
        android:layout_height="wrap_content"

        android:layout_marginStart="1dp"
        android:layout_weight="1"
        android:background="@color/white"
        android:textColor="@color/black"
        android:textSize="11sp" />

    <Button
        android:id="@+id/button20"
        android:layout_width="0dp"
        android:layout_height="wrap_content"

        android:layout_marginStart="1dp"
        android:layout_weight="1"
        android:background="@color/white"
        android:textColor="@color/black"
        android:textSize="11sp" />
</LinearLayout>

Thank you in advance!!! [1]: https://i.stack.imgur.com/qc43P.png

0 Answers
Related