Skip to content
Snippets Groups Projects
Unverified Commit 09edb8f0 authored by Juraj Kusnier's avatar Juraj Kusnier Committed by GitHub
Browse files

hide empty fields (#3523)

parent dd6465cc
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@ import android.os.Bundle
import android.view.View
import android.widget.LinearLayout
import androidx.coordinatorlayout.widget.CoordinatorLayout
import androidx.core.view.isGone
import androidx.fragment.app.Fragment
import androidx.navigation.fragment.FragmentNavigatorExtras
import androidx.navigation.fragment.findNavController
......@@ -69,16 +70,32 @@ class TestCertificateDetailsFragment : Fragment(R.layout.fragment_test_certifica
diseaseType.text = testCertificate.targetName
testType.text = testCertificate.testType
testName.text = testCertificate.testName
testManufacturer.text = testCertificate.testNameAndManufacturer
testDate.text = "%s %s".format(
testDateTime.toDayFormat(),
testDateTime.toShortTimeFormat()
)
testResult.text = testCertificate.testResult
testCenter.text = testCertificate.testCenter
certificateCountry.text = testCertificate.certificateCountry
certificateIssuer.text = testCertificate.certificateIssuer
certificateId.text = testCertificate.certificateId
if (testCertificate.testCenter.isNullOrBlank()) {
testCenterTitle.isGone = true
testCenter.isGone = true
} else {
testCenter.text = testCertificate.testCenter
testCenter.isGone = false
testCenterTitle.isGone = false
}
if (testCertificate.testNameAndManufacturer.isNullOrBlank()) {
testManufacturer.isGone = true
testManufacturerTitle.isGone = true
} else {
testManufacturer.text = testCertificate.testNameAndManufacturer
testManufacturer.isGone = false
testManufacturerTitle.isGone = false
}
}
private fun FragmentTestCertificateDetailsBinding.onQrCodeReady(bitmap: Bitmap?) {
......
......@@ -208,6 +208,7 @@
tools:text="Xep" />
<TextView
android:id="@+id/test_manufacturer_title"
style="@style/body1Medium"
android:layout_width="match_parent"
android:layout_height="wrap_content"
......@@ -253,6 +254,7 @@
tools:text="negative" />
<TextView
android:id="@+id/test_center_title"
style="@style/body1Medium"
android:layout_width="match_parent"
android:layout_height="wrap_content"
......
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