0% found this document useful (0 votes)
9 views

Assignment 12

Uploaded by

PAVAN
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Assignment 12

Uploaded by

PAVAN
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Mobile App Development

Assignment 12

Basic Instructions:

1. In every file submitted you MUST place the following comments:


a. Assignment #.
b. File Name.
c. Full name of the student.
2. Each group is required to submit the assignment on Canvas.
3. Submit Codes:
a. Zip all the project folder to be submitted on canvas.
4. Submission details:
a. The file name is very important and should follow the following format:
Assignment#.zip
b. You should submit the assignment through Canvas: Submit the zip file.
5. Failure to follow the above instructions will result in point deductions.

1 of 6
Assignment 12 (100 Points)
In this assignment you will be building an application that uses RecyclerViews to
manage bills. This app is composed of two actives and multiple fragments. The app
requirements are as follows:
1. You are provided with a skeleton app that includes all the required UI and classes
needed to complete this assignment.
2. Note that, the ArrayList of Bill objects should be stored in the Main Activity to maintain
the list of bills added.
3. All communication between fragments should be performed through the Main Activity.
4. When the Main Activity starts it should load the “Bills” Fragment as the initial
fragment.

Welcome Bills Create Bill Select Discount Select Category


Bill Name: Enter Bill Name Custom %: 25%
Clear New Housing
Bill Amount: Enter Bill Amount 10% Transportation
Groceries
Bill Amount : $100.00 Discount %: N/A Select
15% Food
Discount: %15 ($15.00) 18%
Total Bill: $85.00 Category: N/A Select
Health
06/08/2024 Custom Other
Food Bill Date: N/A Select

Cancel Create

Start Cancel Cancel

(a) Welcome Activity (b) Bills Fragment (c) Create Bill (d) Select Discount (e) Select Category

Figure 1, App Wireframe

Part 1, Welcome activity (0 Points - Implemented):


This activity displays the welcome screen as shown in Figure 1(a). Please follow the
steps to build this activity:
1. The activity displays the banner photo as shown in Figure 1(a).
2. Clicking the “Start” button should
a. Start the “Main” activity.
b. Finish this activity.

Part 2, Bills Fragment (60 Points):


The bills fragment displays the RecyclerView of bills as shown in Figure 1(b). Please
follow the steps:
1. This fragment should receive the ArrayList of bills from the Main Activity, and should
display the list of bills as shown in Figure 1(b).
a. You should create and use an interface to request the ArrayList of bills from the
Main Activity.
b. Use a RecyclerView, extend an adapter which should be implemented inside the
Bills Fragment.
c. Each row item should display the name, amount, discount (discount amount), total
bill, date, and category as shown in Figure 1(b).

2 of 6
2. Clicking the “Clear” button should communicate with the Main Activity to:
a. Remove all the bills from the bills ArrayList.
b. Reload the RecyclerView to display no bills as the users ArrayList is empty.
3. Clicking the “New” button should communicate with the Main Activity to:
a. Replace the current fragment with the Create Bill fragment.
b. Push the current fragment on the back stack.
c. Upon returning from the Create Bill Fragment this fragment should request the
updated ArrayList of bills from the Main Activity and refresh the RecyclerView to
show the list of bills which contains the newly added bill as shown in Figure 2(c).
4. Clicking on “Trash Can” Icon should communicate with the Main Activity to:
a. Using an interface, communicate with the Main Activity to delete the selected item
from the ArrayList.
b. Delete the selected item from the local ArrayList
c. Reload the RecyclerView to display the updated list.
5. Clicking on “Edit Icon” should communicate with the Main Activity to:
a. Replace the current fragment with the Edit Bill fragment, send the selected Bill
object to the Edit Bill fragment.
b. Push the current fragment on the back stack.
6. Clicking on the row item should communicate with the Main Activity to:
a. Replace the current fragment with the Bill Summary fragment, send the selected
Bill object to the Bill Summary fragment.
b. Push the current fragment on the back stack.

Part 2, Create Bill Fragment (0 Points - Mostly Implemented):


This fragment is used to add a new bill see Fig 1(c). The requirements are listed below:
1. There are several “Select” buttons that should be used by the user to transition to a
fragment to allow the selection of a specific attribute. For example there is select
discount, category and bill date.
2. Clicking on the “Select” should communicate with the Main Activity to:
a. Replace the current fragment with the corresponding Select fragment.
b. Push the current fragment on the back stack.
c. Upon returning from the Select fragment the selected value should be received
through the Main Activity, sent to the Create Bill fragment and should be
displayed see Fig 2(b).
3. Clicking on the Submit button should:
a. If any of the entries is not entered or selected then show a toast message
indicating the missing input.
b. If all the required data is entered then create a Bill object which contains all the
entered and selected values. Send the created Bill object to the Main Activity
which should:
i. Add the new bill to the bills ArrayList hosted in the Main Activity.
ii. Pop the back stack which should go back to the Bills fragment.

Part 3 (20 Points): Select Discount Fragment


This fragment is shown in Fig 1(d). The requirements are listed below:

3 of 6
1. Use a RecyclerView to enable the user select the discount value. The discount
options 10%, 15%, 18% and Custom. When the user selects “Custom”, then the
SeekBar progress is used as the custom discount value.
2. The SeekBar should be setup as follows:
a. Use the SeekBar to enable the user to pick a custom discount value, the
maximum value should be set to 50%.
b. When the fragment starts the custom discount value should be set to 25%.
c. On the right of the SeekBar use a TextView to display the current custom discount
progress of the SeekBar, which represents the current custom discount value.
3. Clicking on a row item should:
a. If the selection is not “Custom” then the corresponding discount value is
dependent on the selected discount value.
b. If the selection is “Custom” the discount value is based the current SeekBar
progress value.
c. Communicate with the Main Activity:
1) Send the selected discount value to the Main Activity using the interface.
2) Find the Create Bill fragment by tag, send it the received discount value.
3) Pop the back stack, which should display the Create Bill fragment which
should display the received discount value.
4. Clicking the “Cancel” button should:
a. Using an interface, communicate with the Main Activity to pop the back stack,
which should display the Create Bill fragment.

Part 4 (20 Points): Select Category Fragment


This fragment is shown in Fig 1(e). The requirements are listed below:
1. Use a RecyclerView to enable the user select the category. The category values are
provided in array in the Fragment.
2. Clicking on a row item should communicate with the Main Activity:
a. Send the selected category value to the Main Activity using the interface.
b. Find the Create Bill fragment by tag, send it the received category value.
c. Pop the back stack, which should display the Create Bill fragment which should
display the received category value.
3. Clicking the “Cancel” button should:
a. Using an interface, communicate with the Main Activity to pop the back stack,
which should display the Create Bill fragment.

Part 5 (0 Points - Mostly Implemented): Select Bill Date Fragment


This fragment is shown in Fig 2(a). The requirements are listed below:
1. The user is able to select the bill date using the DatePicker, make sure to setup the
maximum date to today.
2. Clicking the “Submit” button should:
a. If a selection is not made, then show a Toast message indicating that a selection
is required.
b. If the selection is correctly provided then using an interface, communicate with
the Main Activity:

4 of 6
1) Send the selected date value to the Main Activity using the interface.

Bill Date Create Bill Bills Bill Summary Update Bill


Select the bill date: Bill Name: Apt Rent Clear New Bill Name: Apt Rent Bill Name: Apt Rent

2024 Bill Amount: 200 Bill Amount: $200.00 Bill Amount: 200
Sat, Jun 1 Groceries
Discount %: 10%
Discount %: 10% Select Bill Amount : $100.00 Discount %: 10% Select
< June 2024 > Discount: %15 ($15.00) Discount Amount: $20.00
Category: Housing Select Total Bill: $85.00 Total Bill: $180.00 Category: Housing Select
S M T W T F S
06/08/2024 Category: Housing
1 Bill Date: 06/09/2024 Select Food Bill Date: 06/09/2024 Select
Bill Date: 06/09/2024
2 3 4 5 6 7 8
Cancel Create Apt Rent Cancel Update
9 10 11 12 13 14 15 Bill Amount : $200.00
16 17 18 19 20 21 22 Discount: %10 ($20.00) Delete Back
Total Bill: $180.00
23 24 25 26 27 28 29
06/09/2024
30
Housing

Cancel Submit

(a) Select Bill Date (b) Create Bill (c) Bills Fragment (d) Bill Summary (e) Edit Bill

Figure 2, App Wireframe

2) Find the Create Bill fragment by tag, send it the received received date value.
3) Pop the back stack, which should display the Create Bill fragment which
should display the received date value.
3. Clicking the “Cancel” button should:
a. Using an interface, communicate with the Main Activity to pop the back stack,
which should display the Create Bill fragment.

Part 6 (0 Points - Mostly Implemented): Bill Summary Fragment


This fragment is shown in Fig 2(d). The requirements are listed below:
1. This fragment should receive the Bill object from the Bills Fragment.
2. Calculate the discount and total bill, and display the results as shown in Figure 2(d).
3. Clicking “Delete” should:
a. Using an interface, communicate with the Main Activity to delete the selected
item from the ArrayList.
b. Pop the back stack, which should display the Bills fragment.
4. Clicking “Back” should:
a. Using an interface, communicate with the Main Activity to pop the back stack,
which should display the Bills fragment.

Part 7, Edit Bill Fragment (0 Points - Mostly Implemented):


This fragment is used to edit a bill see Fig 2(e). The requirements are listed below:
1. There are several “Select” buttons that should be used by the user to transition to a
fragment to allow the selection of a specific attribute. For example there is select
discount, category and bill date.
2. Clicking on the “Select” should communicate with the Main Activity to:
a. Replace the current fragment with the corresponding Select fragment.
b. Push the current fragment on the back stack.

5 of 6
c. Upon returning from the Select fragment the selected value should be received
through the Main Activity, sent to the Create Bill fragment and should be
displayed see Fig 2(b).
5. Clicking on the Submit button should:
a. If any of the entries is not entered or selected then show a toast message
indicating the missing input.
b. If all the required data is entered then update the Bill object which contains all
the entered and selected values. Send the updated Bill object to the Main Activity
which should:
i. Update the bills ArrayList hosted in the Main Activity.
ii. Pop the back stack which should go back to the Bills fragment.

6 of 6

You might also like