Skip to content

Instantly share code, notes, and snippets.

@yigitozgumus
Last active December 12, 2023 11:17
Show Gist options
  • Save yigitozgumus/cd738f7ff478ad10e0b9bafcdc454f42 to your computer and use it in GitHub Desktop.
Save yigitozgumus/cd738f7ff478ad10e0b9bafcdc454f42 to your computer and use it in GitHub Desktop.
Example MVVM Violation
override fun showVariantSelectionDialog(pageType: String) {
// Direct data access
val product = productDetailViewModel.getProduct()
if (product == null) {
showProductDetailErrorDialog()
return
}
variantSelectionDialogProvider.provideVariantSelectionDialog(
content = getVariantSelectionContent(product, pageType),
anyVariantSelectedListener = {
// Internal Logic
},
addToBasketClickedListener = {
// Internal Logic
},
).show(childFragmentManager, VariantSelectionDialogProvider.TAG)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment