Last active
February 4, 2022 13:45
-
-
Save ngallazzi/07cc7bc5533cdafcba73cf3818ea2ff2 to your computer and use it in GitHub Desktop.
Mastering refactoring - Change function declaration, final code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun printInvoiceSheet(invoice: Invoice) { | |
printInvoiceHeader(invoiceNumber = invoice.number, invoiceDate = invoice.date) | |
printInvoiceItemsSection(invoice.items, 22.0) | |
} | |
private fun printInvoiceHeader(invoiceNumber: Int, invoiceDate: LocalDate) { | |
val invoiceHeader = "INVOICE N° ${invoiceNumber}, ${invoiceDate}\n\n" | |
binding.tvInvoicePreview.text = invoiceHeader | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment