From 0a2e6fd914ed38b323ccda09c55d113441588f02 Mon Sep 17 00:00:00 2001 From: Aleem Azhar Date: Fri, 1 Nov 2024 07:37:01 +0500 Subject: [PATCH] Search placeholder and qr icon updated --- .../configuration/register/RegisterContentConfig.kt | 1 + .../quest/ui/main/components/TopScreenSection.kt | 4 +++- .../fhircore/quest/ui/register/RegisterScreen.kt | 1 + android/quest/src/main/res/drawable/ic_qr_code.xml | 11 +++++++---- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/android/engine/src/main/java/org/smartregister/fhircore/engine/configuration/register/RegisterContentConfig.kt b/android/engine/src/main/java/org/smartregister/fhircore/engine/configuration/register/RegisterContentConfig.kt index 4dc64dd3e8..43ba2ab4a1 100644 --- a/android/engine/src/main/java/org/smartregister/fhircore/engine/configuration/register/RegisterContentConfig.kt +++ b/android/engine/src/main/java/org/smartregister/fhircore/engine/configuration/register/RegisterContentConfig.kt @@ -23,6 +23,7 @@ import org.smartregister.fhircore.engine.domain.model.RuleConfig data class RegisterContentConfig( val separator: String? = null, val display: String? = null, + val placeholderColor: String? = null, val rules: List? = null, val visible: Boolean? = null, val computedRules: List? = null, diff --git a/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/main/components/TopScreenSection.kt b/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/main/components/TopScreenSection.kt index c56728f026..76086c07cb 100644 --- a/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/main/components/TopScreenSection.kt +++ b/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/main/components/TopScreenSection.kt @@ -72,6 +72,7 @@ import org.smartregister.fhircore.engine.domain.model.TopScreenSectionConfig import org.smartregister.fhircore.engine.ui.theme.GreyTextColor import org.smartregister.fhircore.engine.util.annotation.PreviewWithBackgroundExcludeGenerated import org.smartregister.fhircore.engine.util.extension.getActivity +import org.smartregister.fhircore.engine.util.extension.parseColor import org.smartregister.fhircore.quest.event.ToolbarClickEvent import org.smartregister.fhircore.quest.ui.shared.components.Image import org.smartregister.fhircore.quest.ui.shared.models.SearchMode @@ -105,6 +106,7 @@ fun TopScreenSection( showSearchByQrCode: Boolean = false, filteredRecordsCount: Long? = null, searchPlaceholder: String? = null, + placeholderColor: String? = null, toolBarHomeNavigation: ToolBarHomeNavigation = ToolBarHomeNavigation.OPEN_DRAWER, onSearchTextChanged: (SearchQuery, Boolean) -> Unit = { _, _ -> }, performSearchOnValueChanged: Boolean = true, @@ -217,7 +219,7 @@ fun TopScreenSection( singleLine = true, placeholder = { Text( - color = GreyTextColor, + color = placeholderColor?.parseColor() ?: GreyTextColor, text = searchPlaceholder ?: stringResource(R.string.search_hint), modifier = modifier.testTag(SEARCH_FIELD_TEST_TAG), ) diff --git a/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/register/RegisterScreen.kt b/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/register/RegisterScreen.kt index 515739ff58..653b14e2fb 100644 --- a/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/register/RegisterScreen.kt +++ b/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/register/RegisterScreen.kt @@ -117,6 +117,7 @@ fun RegisterScreen( filteredRecordsCount = registerUiState.filteredRecordsCount, isSearchBarVisible = registerUiState.registerConfiguration?.searchBar?.visible ?: true, searchPlaceholder = registerUiState.registerConfiguration?.searchBar?.display, + placeholderColor = registerUiState.registerConfiguration?.searchBar?.placeholderColor, showSearchByQrCode = registerUiState.registerConfiguration?.showSearchByQrCode ?: false, toolBarHomeNavigation = toolBarHomeNavigation, onSearchTextChanged = { uiSearchQuery, performSearchOnValueChanged -> diff --git a/android/quest/src/main/res/drawable/ic_qr_code.xml b/android/quest/src/main/res/drawable/ic_qr_code.xml index e08ef94df7..519f19de69 100644 --- a/android/quest/src/main/res/drawable/ic_qr_code.xml +++ b/android/quest/src/main/res/drawable/ic_qr_code.xml @@ -1,10 +1,13 @@ + android:viewportWidth="20" + android:viewportHeight="20"> + + android:fillAlpha="0.25"/>