Skip to content
Snippets Groups Projects
Unverified Commit b869b1da authored by Chilja Gossow's avatar Chilja Gossow Committed by GitHub
Browse files

Fix crash when displaying test result (DEV) (#2039)

* fix crash
parent 69a1c619
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,7 @@ import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.observe
import dagger.android.AndroidInjector
import dagger.android.DispatchingAndroidInjector
import dagger.android.HasAndroidInjector
......
......@@ -26,10 +26,11 @@ constructor(
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr) {
private val binding = ViewTestResultSectionBinding.bind(this)
private val binding: ViewTestResultSectionBinding
init {
inflate(context, R.layout.view_test_result_section, this)
binding = ViewTestResultSectionBinding.bind(this)
context.withStyledAttributes(attrs, R.styleable.TestResultSection) {
binding.testResultSectionHeadline.text =
getText(R.styleable.TestResultSection_test_result_section_headline)
......@@ -85,7 +86,7 @@ constructor(
DeviceUIState.PAIRED_POSITIVE,
DeviceUIState.PAIRED_POSITIVE_TELETAN,
DeviceUIState.PAIRED_NEGATIVE -> formatTestResult(uiState)
DeviceUIState.PAIRED_NEGATIVE -> SpannableString(formatTestResult(uiState))
else -> SpannableString("")
}
}
......
......@@ -96,7 +96,7 @@ fun formatTestResultCardContent(uiState: NetworkRequestWrapper<DeviceUIState, Th
DeviceUIState.PAIRED_POSITIVE,
DeviceUIState.PAIRED_POSITIVE_TELETAN,
DeviceUIState.PAIRED_NEGATIVE -> formatTestResult(uiState)
DeviceUIState.PAIRED_NEGATIVE -> SpannableString(formatTestResult(uiState))
else -> SpannableString("")
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment