Assignment 12
Assignment 12
Assignment 12
Basic Instructions:
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.
Cancel Create
(a) Welcome Activity (b) Bills Fragment (c) Create Bill (d) Select Discount (e) Select Category
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.
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.
4 of 6
1) Send the selected date value to the Main Activity using the interface.
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
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.
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