<!--
  ~ Copyright (c) 2015, Nordic Semiconductor
  ~ All rights reserved.
  ~
  ~ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
  ~
  ~ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  ~
  ~ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the
  ~ documentation and/or other materials provided with the distribution.
  ~
  ~ 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this
  ~ software without specific prior written permission.
  ~
  ~ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  ~ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  ~ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  ~ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  ~ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
  ~ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  -->
<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:background="@color/nordicBackground"
	android:orientation="vertical">

	<!-- The size of text below must be fixed, therefore dp are used instead of sp -->

	<no.nordicsemi.android.nrftoolbox.widget.TrebuchetBoldTextView
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:layout_centerVertical="true"
		android:layout_marginLeft="@dimen/uart_feature_title_long_margin"
		android:rotation="270"
		android:text="@string/uart_feature_title_long"
		android:textColor="@color/darkGray"
		android:textSize="32dp"
		android:textStyle="bold"/>

	<no.nordicsemi.android.nrftoolbox.widget.TrebuchetTextView
		android:id="@+id/device_name"
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:layout_centerHorizontal="true"
		android:layout_marginLeft="10dp"
		android:layout_marginTop="@dimen/feature_device_name_margin_top"
		android:ellipsize="end"
		android:freezesText="true"
		android:maxLines="1"
		android:text="@string/uart_default_name"
		android:textAllCaps="true"
		android:textAppearance="?android:attr/textAppearanceLarge"/>

	<LinearLayout
		android:layout_width="match_parent"
		android:layout_height="match_parent"
		android:layout_above="@+id/action_connect"
		android:layout_below="@+id/device_name"
		android:layout_marginLeft="@dimen/feature_horizontal_margin"
		android:layout_marginRight="@dimen/feature_horizontal_margin"
		android:gravity="center"
		android:orientation="vertical">

		<GridView
			android:id="@+id/grid"
			android:layout_width="@dimen/feature_uart_buttons_pane_width"
			android:layout_height="@dimen/feature_uart_buttons_pane_height"
			android:layout_margin="4dp"
			android:gravity="center"
			android:horizontalSpacing="4dp"
			android:numColumns="3"
			android:verticalSpacing="4dp"
			tools:listitem="@layout/feature_uart_button"/>

	</LinearLayout>

	<Button
		android:id="@+id/action_connect"
		style="@style/Widget.Connect"
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:layout_above="@+id/spacer"
		android:layout_centerHorizontal="true"
		android:onClick="onConnectClicked"
		android:text="@string/action_connect"/>

	<View
		android:id="@+id/spacer"
		android:layout_width="wrap_content"
		android:layout_height="@dimen/activity_vertical_margin_bottom"
		android:layout_alignParentBottom="true"/>

	<ImageView
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:layout_alignParentBottom="true"
		android:layout_centerHorizontal="true"
		android:layout_marginBottom="6dp"
		android:src="@drawable/background_title"/>

</RelativeLayout>