Skip to content
Permalink
Browse files

Add explicit lambda parameter names

  • Loading branch information
zsmb13 committed Jan 7, 2020
1 parent 2bc8d9a commit 96a246b97647513082c96bfc6903c456450e2f19
@@ -48,23 +48,23 @@ class DashboardFragment : Fragment() {
activity?.window?.statusBarColor =
PokemonColorUtil(view.context).getPokemonColor(pokemon?.typeofpokemon)

pokemon?.typeofpokemon?.elementAtOrNull(0).let {
textViewType3.text = it
if (it == null) {
pokemon?.typeofpokemon?.elementAtOrNull(0).let { firstType ->
textViewType3.text = firstType
if (firstType == null) {
textViewType3.visibility = View.GONE
}
}

pokemon?.typeofpokemon?.elementAtOrNull(1).let {
textViewType2.text = it
if (it == null) {
pokemon?.typeofpokemon?.elementAtOrNull(1).let { secondType ->
textViewType2.text = secondType
if (secondType == null) {
textViewType2.visibility = View.GONE
}
}

pokemon?.typeofpokemon?.elementAtOrNull(2).let {
textViewType1.text = it
if (it == null) {
pokemon?.typeofpokemon?.elementAtOrNull(2).let { thirdType ->
textViewType1.text = thirdType
if (thirdType == null) {
textViewType1.visibility = View.GONE
}
}
@@ -29,23 +29,23 @@ class PokemonAdapter(
itemView.relativeLayoutBackground.background.colorFilter =
PorterDuffColorFilter(color, PorterDuff.Mode.SRC_ATOP)

item.typeofpokemon?.elementAtOrNull(0).let {
itemView.textViewType3.text = it
if (it == null) {
item.typeofpokemon?.elementAtOrNull(0).let { firstType ->
itemView.textViewType3.text = firstType
if (firstType == null) {
itemView.textViewType3.visibility = View.GONE
}
}

item.typeofpokemon?.elementAtOrNull(1).let {
itemView.textViewType2.text = it
if (it == null) {
item.typeofpokemon?.elementAtOrNull(1).let { secondType ->
itemView.textViewType2.text = secondType
if (secondType == null) {
itemView.textViewType2.visibility = View.GONE
}
}

item.typeofpokemon?.elementAtOrNull(2).let {
itemView.textViewType1.text = it
if (it == null) {
item.typeofpokemon?.elementAtOrNull(2).let { thirdType ->
itemView.textViewType1.text = thirdType
if (thirdType == null) {
itemView.textViewType1.visibility = View.GONE
}
}

0 comments on commit 96a246b

Please sign in to comment.
You can’t perform that action at this time.