Skip to content

Instantly share code, notes, and snippets.

@le0nidas
Last active July 12, 2020 08:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save le0nidas/744175f2c7cb0affed3b722910088b68 to your computer and use it in GitHub Desktop.
Save le0nidas/744175f2c7cb0affed3b722910088b68 to your computer and use it in GitHub Desktop.
private fun foo(ui: Ui, system: System) {
if (inLightModeWithItemsInList(ui, system)) {
removeRightMargin(ui)
}
}
private fun removeRightMargin(ui: Ui) {
val uiContainer = ui.container
uiContainer.rightMargin = 0
}
private fun inLightModeWithItemsInList(ui: Ui, system: System): Boolean {
return !ui.itemsAreInGrid() && !system.isDarkThemeEnabled()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment