diff --git a/app/src/main/java/dgca/verifier/app/android/verification/VerificationResultDialogFragment.kt b/app/src/main/java/dgca/verifier/app/android/verification/VerificationResultDialogFragment.kt index 7f584fb0..fc1f0f3a 100644 --- a/app/src/main/java/dgca/verifier/app/android/verification/VerificationResultDialogFragment.kt +++ b/app/src/main/java/dgca/verifier/app/android/verification/VerificationResultDialogFragment.kt @@ -85,6 +85,7 @@ class VerificationResultDialogFragment : override fun actionButton(): Button = binding.actionButton private fun handleDecodeResult() { + binding.verificationResultHeaderView.setUp(args.standardizedVerificationResult, args.certificateModel, args.ruleValidationResultModelsContainer) handleVerificationResult( args.certificateModel, args.standardizedVerificationResult.category @@ -101,7 +102,6 @@ class VerificationResultDialogFragment : setCertStatusUI(standardizedVerificationResultCategory) setCertDataVisibility(standardizedVerificationResultCategory) certificateModel?.let { it -> - binding.personFullName.text = it.getFullName() toggleButton(it) if (standardizedVerificationResultCategory != StandardizedVerificationResultCategory.INVALID) { @@ -175,9 +175,6 @@ class VerificationResultDialogFragment : } } - binding.status.text = text - binding.certStatusIcon.setImageResource(imageId) - binding.verificationStatusBg.backgroundTintList = statusColor actionButton().isVisible = true actionButton().backgroundTintList = statusColor actionButton().text = actionBtnText diff --git a/app/src/main/java/dgca/verifier/app/android/verification/detailed/DetailedVerificationResultHeaderView.kt b/app/src/main/java/dgca/verifier/app/android/verification/detailed/DetailedVerificationResultHeaderView.kt index b9df51fd..1adaab2a 100644 --- a/app/src/main/java/dgca/verifier/app/android/verification/detailed/DetailedVerificationResultHeaderView.kt +++ b/app/src/main/java/dgca/verifier/app/android/verification/detailed/DetailedVerificationResultHeaderView.kt @@ -26,6 +26,7 @@ import android.content.Context import android.content.res.ColorStateList import android.util.AttributeSet import android.view.LayoutInflater +import android.view.View import androidx.constraintlayout.widget.ConstraintLayout import androidx.core.content.ContextCompat import dgca.verifier.app.android.R @@ -51,6 +52,10 @@ class DetailedVerificationResultHeaderView(context: Context, attrs: AttributeSet ) { binding.personFullName.text = certificateModel?.getFullName() ?: "" + val isValid = + standardizedVerificationResult.category == StandardizedVerificationResultCategory.VALID + binding.information.visibility = if (isValid) View.GONE else View.VISIBLE + val (colorRes, textRes) = when (standardizedVerificationResult.category) { StandardizedVerificationResultCategory.VALID -> Pair(R.color.green, R.string.cert_valid) StandardizedVerificationResultCategory.INVALID -> Pair( @@ -66,9 +71,18 @@ class DetailedVerificationResultHeaderView(context: Context, attrs: AttributeSet binding.verificationStatusBackground.backgroundTintList = ColorStateList.valueOf(ContextCompat.getColor(context, colorRes)) - binding.detailedVerificationResultView.setUp( - standardizedVerificationResult, - ruleValidationResultModelsContainer - ) + if (isValid) { + binding.detailedVerificationResultView.visibility = View.GONE + binding.certStatusIcon.visibility = View.VISIBLE + View.GONE + } else { + binding.detailedVerificationResultView.visibility = View.VISIBLE + binding.certStatusIcon.visibility = View.GONE + binding.detailedVerificationResultView.setUp( + standardizedVerificationResult, + ruleValidationResultModelsContainer + ) + View.VISIBLE + } } } \ No newline at end of file diff --git a/app/src/main/res/layout/dialog_fragment_verification_result.xml b/app/src/main/res/layout/dialog_fragment_verification_result.xml index a4c95da2..da48106b 100644 --- a/app/src/main/res/layout/dialog_fragment_verification_result.xml +++ b/app/src/main/res/layout/dialog_fragment_verification_result.xml @@ -29,61 +29,13 @@ android:layout_marginTop="50dp" android:minHeight="500dp"> - - - - - - - - - + app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintTop_toBottomOf="@id/verificationResultHeaderView" /> + + @@ -79,7 +93,6 @@ android:id="@+id/detailedVerificationResultView" android:layout_width="0dp" android:layout_height="wrap_content" - android:layout_marginTop="@dimen/default_margin" android:layout_marginBottom="@dimen/default_half_margin" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="@id/personFullName"