Skip to content

Instantly share code, notes, and snippets.

@ngallazzi
Last active February 4, 2022 13:41
Show Gist options
  • Save ngallazzi/042267383e9170a2fe15a47431098913 to your computer and use it in GitHub Desktop.
Save ngallazzi/042267383e9170a2fe15a47431098913 to your computer and use it in GitHub Desktop.
Mastering refactoring - change function declaration, start code
private fun printInvoiceSheet(invoice: Invoice) {
printDetails(invoice)
printInvoiceItemsSection(invoice.items, 22.0)
}
private fun printDetails(invoice: Invoice) {
val invoiceHeader = "INVOICE N° ${invoice.number}, ${invoice.date}\n\n"
binding.tvInvoicePreview.text = invoiceHeader
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment