Adding a Button and EditTextView

We are going to add a button and an EditText view to start adding items to our merchant.

<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Create Item"
    android:id="@+id/createItemButton"/>

<EditText
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:hint="Item"
    android:id="@+id/createItemEditText"/>

Your Acivity Main view should look like:

<?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"
    tools:context="com.jamescha.clovercodelab.MainActivity">

    <LinearLayout
        android:layout_width="368dp"
        android:layout_height="495dp"
        android:orientation="vertical"
        tools:context="com.jamescha.clovercodelab.MainActivity"
        tools:layout_editor_absoluteY="8dp"
        tools:layout_editor_absoluteX="8dp">

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id = "@+id/merchantName"/>

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/inventoryItems"/>

        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Create Item"
            android:id="@+id/createItemButton"/>

        <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="Item"
            android:id="@+id/createItemEditText"/>
    </LinearLayout>

</android.support.constraint.ConstraintLayout>

results matching ""

    No results matching ""