This project consists of TransactionManager interface and its dummy implementation TransactionManagerImpl
that mocks making a transaction.
To start a transaction you should first get a new transaction flow through TransactionManager.newTransactionFlow().
Using this flow you can get notified about the state of the Transaction as it goes through.
The flow would need some input in order to continue and complete. These inputs can be passed as Inputs into the flow using TransactionManager.dispatch().
To get a better understanding of how everything works checkout the documentations on TransactionManager.kt.
- Download this project.
- Inside the app module create a
TransactionActivitywith these screens: - Create a loading screen that should be shown whenever the state of the
Transactionis inPROCESSING. - Create a screen for the user to enter an amount when the state is
AWAITING_AMOUNTand then dispatch it into the flow. - Create a screen to show the
Storedetails with the amount and a confirmation button when the state isAWAITING_CONFIRMATION. - Create a screen to show the final state of the transaction, whether it's a success or a failure, and to show the details of the transaction including its
referenceId. - Make sure you give the user the ability to cancel the transaction when they want before the state is final.
- When you're finished with this task, send us your changes in a zip file.
As you can see there is not much repository or business layer code needed for this task, so our main focus is going to be on the View layer. We will particularly evaluate these points:
- How polished the code is. It needs to be written in Kotlin.
- Having a smooth UI is really important. Use the UX points you learned to make the screens user friendly.
- The app should be able to rotate. This way we can know you have a good understanding of Android lifecycles.
- Remember that you should use the mocked implementation of
TransactionManagerfor this task like so:
val transactionManager: TransactionManager = TransactionManagerImpl()
Good to haves:
- Having some animations including transitions between the screens.
- Using libraries like Compose and Hilt is a huge plus as well.
- Having an error/exception handling mechanism to prevent the app from crashing.