Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PatrickPRAR/d00b700f2acece1a5fee5abcc5781092 to your computer and use it in GitHub Desktop.
Save PatrickPRAR/d00b700f2acece1a5fee5abcc5781092 to your computer and use it in GitHub Desktop.
Android Development for Beginners_Lesson 2A: Making an App Interactive_AlternativeCode_XML
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:orientation="vertical"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
tools:context="com.example.android.justjava.MainActivity">
<TextView
android:id="@+id/quantity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAllCaps="true"
android:text="quantity"
android:paddingBottom="16dp"
/>
<Button
android:id="@+id/plus_boton"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginBottom="8dp"
android:text="+"
android:onClick="increment"
/>
<TextView
android:id="@+id/quantity_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#000000"
android:textSize="16sp"
android:textStyle="bold"
android:text="1"
/>
<Button
android:id="@+id/minus_boton"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginTop="8dp"
android:text="-"
android:onClick="decrement"
/>
<TextView
android:id="@+id/price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAllCaps="true"
android:text="price"
android:paddingTop="16dp"
/>
<TextView
android:id="@+id/price_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="16dp"
android:text="$0"
android:textColor="#000000"
android:textSize="16sp"
android:textStyle="bold"
/>
<Button
android:id="@+id/order_boton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="ORDER"
android:onClick="submitOrder"
/>
</LinearLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment