Fix UI issue notification troubleshot screen

This commit is contained in:
Benoit Marty 2019-06-18 10:30:56 +02:00
parent 53bdd58c1b
commit 273c8a19b8

View File

@ -23,6 +23,7 @@ import android.widget.Button
import android.widget.ImageView import android.widget.ImageView
import android.widget.ProgressBar import android.widget.ProgressBar
import android.widget.TextView import android.widget.TextView
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import butterknife.BindView import butterknife.BindView
import butterknife.ButterKnife import butterknife.ButterKnife
@ -67,24 +68,23 @@ class NotificationTroubleshootRecyclerViewAdapter(val tests: ArrayList<Troublesh
fun bind(test: TroubleshootTest) { fun bind(test: TroubleshootTest) {


val context = itemView.context val context = itemView.context
titleText.setTextColor(ThemeUtils.getColor(context, android.R.attr.textColorTertiary)) titleText.setTextColor(ThemeUtils.getColor(context, R.attr.riotx_text_primary))
descriptionText.setTextColor(ThemeUtils.getColor(context, R.attr.vctr_default_text_hint_color)) descriptionText.setTextColor(ThemeUtils.getColor(context, R.attr.riotx_text_secondary))


when (test.status) { when (test.status) {
TroubleshootTest.TestStatus.NOT_STARTED -> { TroubleshootTest.TestStatus.NOT_STARTED -> {
titleText.setTextColor(ThemeUtils.getColor(context, R.attr.vctr_default_text_hint_color)) titleText.setTextColor(ThemeUtils.getColor(context, R.attr.riotx_text_secondary))
descriptionText.setTextColor(ThemeUtils.getColor(context, R.attr.vctr_default_text_hint_color))


progressBar.visibility = View.INVISIBLE progressBar.visibility = View.INVISIBLE
statusIconImage.visibility = View.VISIBLE statusIconImage.visibility = View.VISIBLE
statusIconImage.setImageResource(R.drawable.unit_test) statusIconImage.setImageResource(R.drawable.unit_test)
} }
TroubleshootTest.TestStatus.RUNNING -> { TroubleshootTest.TestStatus.RUNNING -> {
progressBar.visibility = View.VISIBLE progressBar.visibility = View.VISIBLE
statusIconImage.visibility = View.INVISIBLE statusIconImage.visibility = View.INVISIBLE


} }
TroubleshootTest.TestStatus.FAILED -> { TroubleshootTest.TestStatus.FAILED -> {
progressBar.visibility = View.INVISIBLE progressBar.visibility = View.INVISIBLE
statusIconImage.visibility = View.VISIBLE statusIconImage.visibility = View.VISIBLE
statusIconImage.setImageResource(R.drawable.unit_test_ko) statusIconImage.setImageResource(R.drawable.unit_test_ko)
@ -93,9 +93,9 @@ class NotificationTroubleshootRecyclerViewAdapter(val tests: ArrayList<Troublesh
statusIconImage.imageTintList = null statusIconImage.imageTintList = null
} }


descriptionText.setTextColor(ThemeUtils.getColor(context, R.attr.vctr_highlighted_message_text_color)) descriptionText.setTextColor(ContextCompat.getColor(context, R.color.riotx_notice))
} }
TroubleshootTest.TestStatus.SUCCESS -> { TroubleshootTest.TestStatus.SUCCESS -> {
progressBar.visibility = View.INVISIBLE progressBar.visibility = View.INVISIBLE
statusIconImage.visibility = View.VISIBLE statusIconImage.visibility = View.VISIBLE
statusIconImage.setImageResource(R.drawable.unit_test_ok) statusIconImage.setImageResource(R.drawable.unit_test_ok)