Skip to content

Instantly share code, notes, and snippets.

@asafstr2
Created December 5, 2017 06:35
Show Gist options
  • Save asafstr2/5342c0b330929848dc48ef704411f1f8 to your computer and use it in GitHub Desktop.
Save asafstr2/5342c0b330929848dc48ef704411f1f8 to your computer and use it in GitHub Desktop.
the main upgraded layout for the just java app
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="left">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/cofee"
android:scaleType="fitXY"/>
<!--
we can change the android:gravity="right" to left in order to support english
-->
<LinearLayout
android:id="@+id/layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="right"
android:orientation="vertical">
<EditText
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="@string/your_name"
android:paddingBottom="6dp"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:paddingTop="6dp"
android:textSize="20sp"
android:inputType="textCapWords"/>
<TextView
android:id="@+id/topping"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:paddingBottom="6dp"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:paddingTop="6dp"
android:text="@string/topping"
android:textAllCaps="true"
android:textSize="12sp"
android:textStyle="bold"/>
<CheckBox
android:id="@+id/checkBox"
style="@android:style/Widget.DeviceDefault.Light.CompoundButton.CheckBox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:button="@null"
android:drawableLeft="?android:attr/listChoiceIndicatorMultiple"
android:drawablePadding="24dp"
android:text="@string/whiped_cream"
android:textSize="16sp"
android:typeface="serif"
android:onClick="whipped"/>
<CheckBox
android:id="@+id/chocoled"
style="@android:style/Widget.DeviceDefault.Light.CompoundButton.CheckBox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:button="@null"
android:drawableLeft="?android:attr/listChoiceIndicatorMultiple"
android:drawablePadding="24dp"
android:text="@string/chocoled"
android:textSize="16sp"
android:typeface="serif"
android:onClick="chocolad"/>
<TextView
android:id="@+id/quantity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:paddingBottom="6dp"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:paddingTop="6dp"
android:text="@string/quantity"
android:textAllCaps="true"
android:textSize="12sp"
android:textStyle="bold"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:id="@+id/plus"
android:layout_width="45dp"
android:layout_height="40dp"
android:layout_margin="6dp"
android:layout_marginBottom="16dp"
android:onClick="plus"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:text="+"
android:textSize="16sp" />
<TextView
android:id="@+id/quantity_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="6dp"
android:fontFamily="sans-serif-light"
android:text="0"
android:textColor="#000000"
android:textSize="20sp" />
<Button
android:id="@+id/minus"
android:layout_width="45sp"
android:layout_height="40dp"
android:layout_margin="6dp"
android:onClick="minus"
android:text="-"
android:textSize="16sp" />
</LinearLayout>
<TextView
android:id="@+id/price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:fontFamily="sans-serif-light"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:text="@string/price"
android:textAllCaps="true"
android:textSize="12sp"
android:textStyle="bold"/>
<TextView
android:id="@+id/price_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:fontFamily="sans-serif-light"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:text="@string/_0"
android:textAllCaps="true"
android:textColor="#000000"
android:textSize="20sp" />
<TextView
android:id="@+id/thank_you"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:fontFamily="sans-serif-light"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:text="@string/thank_you"
android:textAllCaps="true"
android:textColor="#000000"
android:textSize="20sp" />
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="8dp"
android:layout_marginTop="16dp"
android:onClick="order2"
android:paddingLeft="6dp"
android:text="@string/order"
android:textSize="16sp"
android:layout_marginLeft="8dp" />
</LinearLayout>
</RelativeLayout>
</ScrollView>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment