-
Star
(110)
You must be signed in to star a gist -
Fork
(88)
You must be signed in to fork a gist
-
-
Save anonymous/256752a04db14a3947a8 to your computer and use it in GitHub Desktop.
<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: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=".MainActivity"> | |
<TextView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_marginBottom="16dp" | |
android:text="Quantity" | |
android:textAllCaps="true" /> | |
<LinearLayout | |
android:layout_width="wrap_content" | |
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:layout_marginLeft="8dp" | |
android:layout_marginRight="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="Price" | |
android:textAllCaps="true" /> | |
<TextView | |
android:id="@+id/price_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> |
<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="horizontal" | |
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=".MainActivity"> | |
<TextView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_marginBottom="16dp" | |
android:text="Quantity" | |
android:textAllCaps="true" /> | |
<LinearLayout | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:orientation="vertical"> | |
<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:layout_marginLeft="8dp" | |
android:layout_marginRight="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="Price" | |
android:textAllCaps="true" /> | |
<TextView | |
android:id="@+id/price_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> |
<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: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=".MainActivity"> | |
<LinearLayout | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:orientation="horizontal"> | |
<TextView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_marginBottom="16dp" | |
android:text="Quantity" | |
android:textAllCaps="true" /> | |
<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:layout_marginLeft="8dp" | |
android:layout_marginRight="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="Price" | |
android:textAllCaps="true" /> | |
<TextView | |
android:id="@+id/price_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> |
A
A
a
option A is correct Answer Because orientation property of root view is vertical But in Option B That's Horizontal....:)
Option A is correct
OPTION A is the Correct Answer because OPTION B is created by horizontal orientation and OPTION C is different with the layouts in activity_main.xml
OPTION -A
A
A is the right answer
A
Ais the right answer
A
A
A
A is the correct hierarchy diagram.
In Option B the second child layout arranges the element verticaly.
In Option C the second child layout included the first text(Quantity) to group it with the other 2 buttons and 1 text.
Still it is sotricky
Its Nice
I think A is correct
A best
A
A is the best choice
option A is the correct answer
A
A
Option A would be the best choice, because it aligns the decrement and increment buttons horizontally and the rest elements correctly.
A
A is correct answer
A