<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 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"
    android:focusable="auto"
    android:focusableInTouchMode="true"
    android:focusedByDefault="false"
    tools:context="com.miguel.amm.simplesqlite.MainActivity">


    <Button
        android:id="@+id/btnBuscar"
        android:layout_width="181dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="188dp"
        android:text="Buscar"
        app:layout_constraintEnd_toStartOf="@+id/btnInsertar"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintHorizontal_chainStyle="spread"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/btnAll" />

    <Button
        android:id="@+id/btnInsertar"
        android:layout_width="182dp"
        android:layout_height="wrap_content"
        android:text="Insertar"
        app:layout_constraintBaseline_toBaselineOf="@+id/btnBuscar"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toEndOf="@+id/btnBuscar" />

    <Button
        android:id="@+id/btnActualizar"
        android:layout_width="181dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="16dp"
        android:text="Actualizar"
        app:layout_constraintEnd_toStartOf="@+id/btnBorrar"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintHorizontal_chainStyle="spread"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/btnBuscar" />

    <Button
        android:id="@+id/btnBorrar"
        android:layout_width="182dp"
        android:layout_height="wrap_content"
        android:text="Borrar"
        app:layout_constraintBaseline_toBaselineOf="@+id/btnActualizar"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toEndOf="@+id/btnActualizar" />

    <TextView
        android:id="@+id/tvId"
        android:layout_width="@dimen/anchoTextView"
        android:layout_height="wrap_content"
        android:layout_marginTop="32dp"
        android:text="Id"
        app:layout_constraintEnd_toStartOf="@+id/etId"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <EditText
        android:id="@+id/etId"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:ems="10"
        android:inputType="number"
        app:layout_constraintBaseline_toBaselineOf="@+id/tvId"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toEndOf="@+id/tvId" />

    <TextView
        android:id="@+id/tvNombre"
        android:layout_width="@dimen/anchoTextView"
        android:layout_height="wrap_content"
        android:layout_marginTop="32dp"
        android:text="Nombre"
        app:layout_constraintEnd_toStartOf="@+id/etNombre"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/tvId" />

    <EditText
        android:id="@+id/etNombre"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:ems="10"
        android:inputType="textPersonName"
        app:layout_constraintBaseline_toBaselineOf="@+id/tvNombre"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toEndOf="@+id/tvNombre" />

    <TextView
        android:id="@+id/tvApellidos"
        android:layout_width="@dimen/anchoTextView"
        android:layout_height="wrap_content"
        android:layout_marginTop="32dp"
        android:text="Apellidos"
        app:layout_constraintEnd_toStartOf="@+id/etApellidos"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/tvNombre" />

    <EditText
        android:id="@+id/etApellidos"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:ems="10"
        android:inputType="textPersonName"
        app:layout_constraintBaseline_toBaselineOf="@+id/tvApellidos"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toEndOf="@+id/tvApellidos" />

    <Button
        android:id="@+id/btnClear"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="32dp"
        android:text="Limpiar"
        app:layout_constraintStart_toStartOf="@+id/tvApellidos"
        app:layout_constraintTop_toBottomOf="@+id/tvApellidos" />

    <Button
        android:id="@+id/btnAll"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="8dp"
        android:text="Todos"
        app:layout_constraintStart_toStartOf="@+id/btnClear"
        app:layout_constraintTop_toBottomOf="@+id/btnClear" />

    <ListView
        android:id="@+id/lvPersonas"
        android:layout_width="246dp"
        android:layout_height="274dp"
        android:layout_marginEnd="8dp"
        android:layout_marginTop="24dp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/etApellidos" />

    <RadioGroup
        android:id="@+id/rgBuscar"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="16dp"
        android:layout_marginBottom="8dp"
        app:layout_constraintBottom_toTopOf="@+id/btnBuscar"
        app:layout_constraintStart_toStartOf="parent">

        <RadioButton
            android:id="@+id/rbId"
            android:layout_width="137dp"
            android:layout_height="wrap_content"
            android:text="por Id" />

        <RadioButton
            android:id="@+id/rbNombre"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="por Nombre" />

        <RadioButton
            android:id="@+id/rbApellidos"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="por Apellidos" />
    </RadioGroup>


</android.support.constraint.ConstraintLayout>
