I have a layout with 4 buttons in the center. I simply want to add a textview next to the four buttons (WITHOUT MOVING THE FOUR BUTTONS FROM THE CENTER), like illustrated here (TextView should be in the place of the red) :
[![enter image description here][1]][1]
Right now, I have the textview in its own linear layout and the four buttons in their own Relative Layout, all in one big relative layout. When ever I try to move the textview to the left of the buttons, the buttons move over to the right. How do I achieve what I illustrated? Here is my XML:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.ruchir.circleswithmap.MainActivity"
android:id="@+id/layout"
android:gravity="center"
android:background="#010101">
<LinearLayout
android:id="@+id/text_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/relativeLayout"
android:layout_centerHorizontal="true"
android:layout_marginBottom="10dp"
>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="20:00"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="50sp"
android:textColor="#fbfafa"
android:id="@+id/timetext" />
</LinearLayout>
<RelativeLayout
android:id="@+id/relativeLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true">
<ImageButton
android:layout_width="150dp"
android:layout_height="150dp"
android:id="@+id/Blue"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:background="@drawable/bluesquare" />
<ImageButton
android:layout_width="150dp"
android:layout_height="150dp"
android:id="@+id/Green"
android:layout_below="@+id/Blue"
android:layout_alignLeft="@+id/Blue"
android:layout_alignStart="@+id/Blue"
android:background="@drawable/greensquare" />
<ImageButton
android:layout_width="150dp"
android:layout_height="150dp"
android:id="@+id/Red"
android:layout_alignTop="@+id/Blue"
android:layout_toRightOf="@+id/Blue"
android:layout_toEndOf="@+id/Blue"
android:background="@drawable/redsquare" />
<ImageButton
android:layout_width="150dp"
android:layout_height="150dp"
android:id="@+id/Purple"
android:layout_alignBottom="@+id/Green"
android:layout_alignLeft="@+id/Red"
android:layout_alignStart="@+id/Red"
android:background="@drawable/purplesquare" />
</RelativeLayout>
</RelativeLayout>