Skip to content

Instantly share code, notes, and snippets.

@vidia
Created September 29, 2016 19:25
Show Gist options
  • Save vidia/ea22f5a7597e6e72c844b7fd6750d375 to your computer and use it in GitHub Desktop.
Save vidia/ea22f5a7597e6e72c844b7fd6750d375 to your computer and use it in GitHub Desktop.
State of the tutorial XML for the TextView tutorial
<?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:id="@+id/activity_main"
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="edu.purdue.cs.sigapp.tutorialproject.MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
android:layout_above="@+id/button"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<Button
android:text="Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:onClick="onClick"
android:id="@+id/button" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:text="Name"
android:ems="10"
android:layout_alignTop="@+id/button"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:id="@+id/editText"
android:layout_toLeftOf="@+id/button"
android:layout_toStartOf="@+id/button" />
</RelativeLayout>
@vidia
Copy link
Author

vidia commented Sep 29, 2016

Note: On like #11 you need to change this to the package and name of your MainActivity or else it will be highlighted red.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment