Skip to content

Commit

Permalink
Add Shopping List Page
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanWidjanarko committed Dec 16, 2021
1 parent a9cf376 commit 9c3d39a
Show file tree
Hide file tree
Showing 7 changed files with 148 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Trolleapp">
<activity
android:name=".ui.pay.ShoppingListActivity"
android:exported="true" />
<activity
android:name=".ui.side_menu.HelpActivity"
android:exported="true" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.trolle.trolleapp.ui.pay

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.trolle.trolleapp.R

class ShoppingListActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_shopping_list)
}
}
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
android:gravity="center"
android:orientation="vertical"
android:background="@color/bgc"
tools:context=".ui.side_menu.AboutActivityy">
tools:context=".ui.side_menu.AboutActivity">

<LinearLayout
android:layout_width="match_parent"
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/res/layout/activity_checkout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="25dp"
android:orientation="horizontal">
android:orientation="horizontal"
tools:ignore="UseCompoundDrawables">

<ImageView
android:id="@+id/image_view_icon"
Expand Down Expand Up @@ -235,7 +236,7 @@
android:id="@+id/button_pay"
android:layout_width="150dp"
android:layout_height="50dp"
android:text="@string/sign_in"
android:text="@string/pay"
android:textColor="@color/bgc"
android:layout_margin="15dp"
android:background="@drawable/rounded_button"
Expand Down
121 changes: 121 additions & 0 deletions app/src/main/res/layout/activity_shopping_list.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:orientation="vertical"
android:background="@color/bgc"
tools:context=".ui.pay.ShoppingListActivity">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical"
android:background="@color/bgc">

<TextView
android:id="@+id/text_view_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/shopping_list"
android:textSize="32sp"
android:textStyle="bold"
android:textColor="@color/pink"
android:layout_margin="25dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
/>

<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content">

<!-- TODO! Add Shopping List Table (Recycler View) -->

<TextView
android:id="@+id/text_view_end_of_list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="@string/end_of_the_list"
android:textSize="12sp"
android:textColor="@color/pink"
android:layout_marginBottom="30dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />

</ScrollView>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center">

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_margin="15dp">

<TextView
android:id="@+id/text_view_sub_total"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="@string/sub_total"
android:textSize="18sp"
android:textColor="@color/white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/text_view_sub_total_price"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="@string/sub_total_price_dummy"
android:textColor="@color/white"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />

</LinearLayout>

<Button
android:id="@+id/button_checkout"
android:layout_width="150dp"
android:layout_height="50dp"
android:text="@string/checkout"
android:textColor="@color/bgc"
android:layout_margin="15dp"
android:background="@drawable/rounded_button"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
/>

</LinearLayout>

</LinearLayout>

<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/bottom_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_alignParentBottom="true"
android:background="@drawable/rounded_bottom_bar"
app:menu="@menu/bottom_bar"
/>

</RelativeLayout>
6 changes: 5 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<string name="shopeepay">ShopeePay</string>
<string name="dana">Dana</string>
<string name="payment_summary">Payment Summary</string>
<string name="sub_total">Sub Total</string>
<string name="sub_total">Sub-Total</string>
<string name="sub_total_price_dummy">Rp 103.000,-</string>
<string name="admin_fee">Admin Fee</string>
<string name="admin_fee_price_dummy">Rp 6.500,-</string>
Expand Down Expand Up @@ -92,4 +92,8 @@
<li>Press the Pay button to pay for all purchased products. Wait until there is a notification stating that the payment has been successfully made.</li><br />
<li>The shopping process has been completed and the cart connected to the app will be offline after a certain amount of time.</li>
</string>
<string name="shopping_list">Shopping List</string>
<string name="pay">Pay</string>
<string name="checkout">Checkout</string>
<string name="end_of_the_list">- end of the list -</string>
</resources>

0 comments on commit 9c3d39a

Please sign in to comment.