Skip to content

Commit

Permalink
Past orders implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob-i committed May 12, 2020
1 parent facf931 commit 2c4d764
Show file tree
Hide file tree
Showing 3 changed files with 155 additions and 138 deletions.
89 changes: 50 additions & 39 deletions android/MobileOrders/app/src/main/res/layout/fragment_checkout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,48 +55,59 @@
android:layout_marginEnd="1dp"
android:layout_marginBottom="1dp" />

<TextView
android:id="@+id/text_total_ordered"
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="40dp"
android:layout_marginEnd="20dp"
android:layout_gravity="center"
android:textAlignment="center"
android:textSize="20sp"/>
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/text_total_ordered"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="40dp"
android:layout_marginEnd="20dp"
android:layout_gravity="center"
android:textAlignment="center"
android:textSize="20sp"/>

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="horizontal"
android:layout_marginTop="40dp">
<Button
android:id="@+id/orderButton"
android:layout_width="140dp"
android:layout_height="60dp"
android:layout_gravity="center"
android:background="@color/colorPrimary"
android:textColor="#fff"
android:textSize="16sp"
android:textStyle="bold"
android:text="Place Order"
/>

<Button
android:id="@+id/clearButton"
android:layout_width="140dp"
android:layout_height="60dp"
android:layout_gravity="center"
android:layout_marginStart="8dp"
android:background="#fff"
android:textColor="@color/colorPrimary"
android:textSize="16sp"
android:textStyle="bold"
android:text="Cancel"
/>
</LinearLayout>
</LinearLayout>
</ScrollView>

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="horizontal"
android:layout_marginTop="40dp">
<Button
android:id="@+id/orderButton"
android:layout_width="140dp"
android:layout_height="60dp"
android:layout_gravity="center"
android:background="@color/colorPrimary"
android:textColor="#fff"
android:textSize="16sp"
android:textStyle="bold"
android:text="Place Order"
/>

<Button
android:id="@+id/clearButton"
android:layout_width="140dp"
android:layout_height="60dp"
android:layout_gravity="center"
android:layout_marginStart="8dp"
android:background="#fff"
android:textColor="@color/colorPrimary"
android:textSize="16sp"
android:textStyle="bold"
android:text="Cancel"
/>
</LinearLayout>


</LinearLayout>
202 changes: 104 additions & 98 deletions android/MobileOrders/app/src/main/res/layout/fragment_detail.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,114 +17,120 @@
type="com.glowbom.mobileorders.model.ItemPalette" />
</data>

<RelativeLayout
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@{palette.color}"
tools:context=".view.ui.orders.DetailFragment">


<ImageView
android:id="@+id/image"
android:layout_alignParentTop="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="fitCenter"
android:minHeight="200dp"/>

<WebView
android:background="#fff"
android:id="@+id/webview"
android:layout_alignParentTop="true"
android:layout_width="match_parent"
android:layout_height="230dp"
android:scaleType="fitCenter"
/>

<LinearLayout
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/webview"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="12dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:id="@+id/name"
android:text="@{item.title}"
style="@style/Title"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:padding="12dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:id="@+id/temperament"
android:text="@{item.description}"
style="@style/Text"/>

<Spinner
android:id="@+id/choice1"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="16dp"
android:visibility="gone"/>
android:background="@{palette.color}"
tools:context=".view.ui.orders.DetailFragment">


<Spinner
android:id="@+id/choice2"
android:layout_width="200dp"
<ImageView
android:id="@+id/image"
android:layout_alignParentTop="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="16dp"
android:visibility="gone"/>

<Button
android:id="@+id/orderButton"
android:layout_width="200dp"
android:layout_height="80dp"
android:layout_gravity="center"
android:layout_marginTop="12dp"
android:scaleType="fitCenter"
android:minHeight="200dp"/>

<WebView
android:background="#fff"
android:textColor="@color/colorPrimary"
android:textSize="30sp"
android:textStyle="bold"
android:text="Order"
android:id="@+id/webview"
android:layout_alignParentTop="true"
android:layout_width="match_parent"
android:layout_height="230dp"
android:scaleType="fitCenter"
/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="12dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:id="@+id/purpose"
android:textStyle="bold"
android:text="@{String.format(@string/currency_format, item.price)}"
style="@style/Text"/>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/webview"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="12dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:id="@+id/name"
android:text="@{item.title}"
style="@style/Title"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:padding="12dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:id="@+id/temperament"
android:text="@{item.description}"
style="@style/Text"/>

<Spinner
android:id="@+id/choice1"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="16dp"
android:visibility="gone"/>

<Spinner
android:id="@+id/choice2"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="16dp"
android:visibility="gone"/>

<Button
android:id="@+id/orderButton"
android:layout_width="200dp"
android:layout_height="80dp"
android:layout_gravity="center"
android:layout_marginTop="12dp"
android:background="#fff"
android:textColor="@color/colorPrimary"
android:textSize="30sp"
android:textStyle="bold"
android:text="Order"
/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="12dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:id="@+id/purpose"
android:textStyle="bold"
android:text="@{String.format(@string/currency_format, item.price)}"
style="@style/Text"/>



<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="12dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:id="@+id/total"
android:text="Total Ordered: $0.00"
style="@style/Text"/>
</LinearLayout>

</RelativeLayout>
</ScrollView>


<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="12dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:id="@+id/total"
android:text="Total Ordered: $0.00"
style="@style/Text"/>
</LinearLayout>

</RelativeLayout>

</layout>

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="260dp"
android:layout_height="match_parent"
android:layout_marginStart="1dp"
android:layout_marginTop="1dp"
android:layout_marginEnd="1dp"
Expand Down

0 comments on commit 2c4d764

Please sign in to comment.