Skip to content

Instantly share code, notes, and snippets.

@nicoqueijo
Created May 15, 2020 20:23
Show Gist options
  • Save nicoqueijo/8dd05edaadf0bda043ce3d7c2080c1d6 to your computer and use it in GitHub Desktop.
Save nicoqueijo/8dd05edaadf0bda043ce3d7c2080c1d6 to your computer and use it in GitHub Desktop.
class MainActivity : AppCompatActivity() {
...
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
...
findViewById<FloatingActionButton>(R.id.floating_action_button).setOnClickListener {
if (removedCurrencies.isNotEmpty()) {
removedCurrencies.pop().let {
addRow(it)
addedCurrencies.add(it)
}
} else {
Toast.makeText(this, R.string.no_more_items, Toast.LENGTH_SHORT).show()
}
}
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment