Created
March 11, 2019 12:47
-
-
Save DjakaTechnology/ae63f148188e9a2894406af12cb556ad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
v.img_icon.run { | |
when(data[i].permissionTypeId){ | |
1 -> setImageDrawable(ContextCompat.getDrawable(c, R.drawable.ic_plus)) | |
2 -> setImageDrawable(ContextCompat.getDrawable(c, R.drawable.ic_permission_green)) | |
3 -> setImageDrawable(ContextCompat.getDrawable(c, R.drawable.ic_clock_orange)) | |
} | |
} | |
v.tv_status.run{ | |
when(data[i].statusId){ | |
1 -> background.setColorFilter(ContextCompat.getColor(c, R.color.orange_pale), PorterDuff.Mode.SRC_ATOP) | |
2 -> background.setColorFilter(ContextCompat.getColor(c, R.color.green_pale), PorterDuff.Mode.SRC_ATOP) | |
3 -> background.setColorFilter(ContextCompat.getColor(c, R.color.red_pale), PorterDuff.Mode.SRC_ATOP) | |
} | |
} | |
v.layout.setOnClickListener { | |
val i = Intent(c, SubClassAbsentDetailActivity::class.java) | |
i.putExtra(SharedKey.App.MODEL, data[myViewHolder.adapterPosition]) | |
c.startActivity(i) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment