Skip to content

Instantly share code, notes, and snippets.

@antonicg
Created February 17, 2018 17:45
Show Gist options
  • Save antonicg/f9b61a0a4f9a08b9eea134b1da01f14d to your computer and use it in GitHub Desktop.
Save antonicg/f9b61a0a4f9a08b9eea134b1da01f14d to your computer and use it in GitHub Desktop.
fun limitCryptoListSizeArrayEmptyCryptoViewModel(): List<CryptoViewModel> =
ArrayList<CryptoViewModel>(Collections.nCopies(LIMIT_CRYPTO_LIST, CryptoViewModel()))
fun cryptoPOJOmodel() =
Crypto("1", "name", "sy", 10, "100", "0.1", "100", "1000", "0", "500", "5", "10", "-10", "")
fun cryptoViewModelFrom(crypto:Crypto) =
CryptoViewModel(crypto.id, crypto.name, crypto.symbol, crypto.rank, crypto.priceUsd.toFloat(), crypto.priceBtc.toFloat(), crypto.percentChange24h.toFloat())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment