checkout / frames-android

Frames Android: making native card payments simple
https://www.checkout.com/docs/integrate/sdks/android-sdk
MIT License
51 stars 37 forks source link

Billing details refactor #21

Closed john-ohalloran-cko closed 5 years ago

john-ohalloran-cko commented 5 years ago

Proposed changes

This PR converts Billing Details to MVP / "Clean Code"

Since a lot of the inputs for the BillingDetails for are of the same format (TextInputLayout containing EditText) I have extracted this as a View and made a Presenter for it. The use cases are the same for each presenter and the different behaviour is implemented in the different Strategy for each component (https://en.wikipedia.org/wiki/Strategy_pattern). The strategy is specified using the xml property of the TextInputView: "strategy".

BillingDetailsView is now in close to its final state.

Types of changes

What types of changes does your code introduce to frames-android? Put an x in the boxes that apply

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.