-
-
Save omprakashkyadav/f3b7d35592cb10c3d0bcbd904f6d3930 to your computer and use it in GitHub Desktop.
Android for Beginners : Add the Chocolate Topping Checkbox Solution XML
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <ScrollView 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" | |
| tools:context=".MainActivity"> | |
| <LinearLayout | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| android:orientation="vertical" | |
| android:paddingBottom="@dimen/activity_vertical_margin" | |
| android:paddingLeft="@dimen/activity_horizontal_margin" | |
| android:paddingRight="@dimen/activity_horizontal_margin" | |
| android:paddingTop="@dimen/activity_vertical_margin"> | |
| <TextView | |
| android:layout_width="wrap_content" | |
| android:layout_height="wrap_content" | |
| android:layout_marginBottom="16dp" | |
| android:text="Toppings" | |
| android:textAllCaps="true" /> | |
| <CheckBox | |
| android:id="@+id/whipped_cream_checkbox" | |
| android:layout_width="wrap_content" | |
| android:layout_height="wrap_content" | |
| android:paddingLeft="24dp" | |
| android:text="Whipped cream" | |
| android:textSize="16sp" /> | |
| <CheckBox | |
| android:id="@+id/chocolate_checkbox" | |
| android:layout_width="wrap_content" | |
| android:layout_height="wrap_content" | |
| android:paddingLeft="24dp" | |
| android:text="Chocolate" | |
| android:textSize="16sp" /> | |
| <TextView | |
| android:layout_width="wrap_content" | |
| android:layout_height="wrap_content" | |
| android:layout_marginBottom="16dp" | |
| android:layout_marginTop="16dp" | |
| android:text="Quantity" | |
| android:textAllCaps="true" /> | |
| <LinearLayout | |
| android:layout_width="match_parent" | |
| android:layout_height="wrap_content" | |
| android:orientation="horizontal"> | |
| <Button | |
| android:layout_width="48dp" | |
| android:layout_height="48dp" | |
| android:onClick="decrement" | |
| android:text="-" /> | |
| <TextView | |
| android:id="@+id/quantity_text_view" | |
| android:layout_width="wrap_content" | |
| android:layout_height="wrap_content" | |
| android:paddingLeft="8dp" | |
| android:paddingRight="8dp" | |
| android:text="2" | |
| android:textColor="@android:color/black" | |
| android:textSize="16sp" /> | |
| <Button | |
| android:layout_width="48dp" | |
| android:layout_height="48dp" | |
| android:onClick="increment" | |
| android:text="+" /> | |
| </LinearLayout> | |
| <TextView | |
| android:layout_width="wrap_content" | |
| android:layout_height="wrap_content" | |
| android:layout_marginTop="16dp" | |
| android:text="Order Summary" | |
| android:textAllCaps="true" /> | |
| <TextView | |
| android:id="@+id/order_summary_text_view" | |
| android:layout_width="wrap_content" | |
| android:layout_height="wrap_content" | |
| android:layout_marginTop="16dp" | |
| android:text="$10" | |
| android:textColor="@android:color/black" | |
| android:textSize="16sp" /> | |
| <Button | |
| android:layout_width="wrap_content" | |
| android:layout_height="wrap_content" | |
| android:layout_marginTop="16dp" | |
| android:onClick="submitOrder" | |
| android:text="Order" /> | |
| </LinearLayout> | |
| </ScrollView> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment