Skip to content

Commit

Permalink
Search placeholder and qr icon updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleem92 committed Nov 1, 2024
1 parent 64a55e6 commit 0a2e6fd
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<RuleConfig>? = null,
val visible: Boolean? = null,
val computedRules: List<String>? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -217,7 +219,7 @@ fun TopScreenSection(
singleLine = true,
placeholder = {
Text(
color = GreyTextColor,
color = placeholderColor?.parseColor() ?: GreyTextColor,

Check warning on line 222 in android/quest/src/main/java/org/smartregister/fhircore/quest/ui/main/components/TopScreenSection.kt

View check run for this annotation

Codecov / codecov/patch

android/quest/src/main/java/org/smartregister/fhircore/quest/ui/main/components/TopScreenSection.kt#L222

Added line #L222 was not covered by tests
text = searchPlaceholder ?: stringResource(R.string.search_hint),
modifier = modifier.testTag(SEARCH_FIELD_TEST_TAG),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ->
Expand Down
11 changes: 7 additions & 4 deletions android/quest/src/main/res/drawable/ic_qr_code.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
android:viewportWidth="20"
android:viewportHeight="20">
<path
android:pathData="M4.167,9.167C3.708,9.167 3.316,9.003 2.99,8.677C2.663,8.351 2.5,7.958 2.5,7.5V4.167C2.5,3.708 2.663,3.316 2.99,2.99C3.316,2.663 3.708,2.5 4.167,2.5H7.5C7.958,2.5 8.351,2.663 8.677,2.99C9.003,3.316 9.167,3.708 9.167,4.167V7.5C9.167,7.958 9.003,8.351 8.677,8.677C8.351,9.003 7.958,9.167 7.5,9.167H4.167ZM4.167,7.5H7.5V4.167H4.167V7.5ZM4.167,17.5C3.708,17.5 3.316,17.337 2.99,17.01C2.663,16.684 2.5,16.292 2.5,15.833V12.5C2.5,12.042 2.663,11.649 2.99,11.323C3.316,10.997 3.708,10.833 4.167,10.833H7.5C7.958,10.833 8.351,10.997 8.677,11.323C9.003,11.649 9.167,12.042 9.167,12.5V15.833C9.167,16.292 9.003,16.684 8.677,17.01C8.351,17.337 7.958,17.5 7.5,17.5H4.167ZM4.167,15.833H7.5V12.5H4.167V15.833ZM12.5,9.167C12.042,9.167 11.649,9.003 11.323,8.677C10.997,8.351 10.833,7.958 10.833,7.5V4.167C10.833,3.708 10.997,3.316 11.323,2.99C11.649,2.663 12.042,2.5 12.5,2.5H15.833C16.292,2.5 16.684,2.663 17.01,2.99C17.337,3.316 17.5,3.708 17.5,4.167V7.5C17.5,7.958 17.337,8.351 17.01,8.677C16.684,9.003 16.292,9.167 15.833,9.167H12.5ZM12.5,7.5H15.833V4.167H12.5V7.5ZM16.25,17.5C16.139,17.5 16.042,17.458 15.958,17.375C15.875,17.292 15.833,17.194 15.833,17.083V16.25C15.833,16.139 15.875,16.042 15.958,15.958C16.042,15.875 16.139,15.833 16.25,15.833H17.083C17.194,15.833 17.292,15.875 17.375,15.958C17.458,16.042 17.5,16.139 17.5,16.25V17.083C17.5,17.194 17.458,17.292 17.375,17.375C17.292,17.458 17.194,17.5 17.083,17.5H16.25ZM11.25,12.5C11.139,12.5 11.042,12.458 10.958,12.375C10.875,12.292 10.833,12.194 10.833,12.083V11.25C10.833,11.139 10.875,11.042 10.958,10.958C11.042,10.875 11.139,10.833 11.25,10.833H12.083C12.194,10.833 12.292,10.875 12.375,10.958C12.458,11.042 12.5,11.139 12.5,11.25V12.083C12.5,12.194 12.458,12.292 12.375,12.375C12.292,12.458 12.194,12.5 12.083,12.5H11.25ZM12.917,14.167C12.806,14.167 12.708,14.125 12.625,14.042C12.542,13.958 12.5,13.861 12.5,13.75V12.917C12.5,12.806 12.542,12.708 12.625,12.625C12.708,12.542 12.806,12.5 12.917,12.5H13.75C13.861,12.5 13.958,12.542 14.042,12.625C14.125,12.708 14.167,12.806 14.167,12.917V13.75C14.167,13.861 14.125,13.958 14.042,14.042C13.958,14.125 13.861,14.167 13.75,14.167H12.917ZM11.25,15.833C11.139,15.833 11.042,15.792 10.958,15.708C10.875,15.625 10.833,15.528 10.833,15.417V14.583C10.833,14.472 10.875,14.375 10.958,14.292C11.042,14.208 11.139,14.167 11.25,14.167H12.083C12.194,14.167 12.292,14.208 12.375,14.292C12.458,14.375 12.5,14.472 12.5,14.583V15.417C12.5,15.528 12.458,15.625 12.375,15.708C12.292,15.792 12.194,15.833 12.083,15.833H11.25ZM12.917,17.5C12.806,17.5 12.708,17.458 12.625,17.375C12.542,17.292 12.5,17.194 12.5,17.083V16.25C12.5,16.139 12.542,16.042 12.625,15.958C12.708,15.875 12.806,15.833 12.917,15.833H13.75C13.861,15.833 13.958,15.875 14.042,15.958C14.125,16.042 14.167,16.139 14.167,16.25V17.083C14.167,17.194 14.125,17.292 14.042,17.375C13.958,17.458 13.861,17.5 13.75,17.5H12.917ZM14.583,15.833C14.472,15.833 14.375,15.792 14.292,15.708C14.208,15.625 14.167,15.528 14.167,15.417V14.583C14.167,14.472 14.208,14.375 14.292,14.292C14.375,14.208 14.472,14.167 14.583,14.167H15.417C15.528,14.167 15.625,14.208 15.708,14.292C15.792,14.375 15.833,14.472 15.833,14.583V15.417C15.833,15.528 15.792,15.625 15.708,15.708C15.625,15.792 15.528,15.833 15.417,15.833H14.583ZM14.583,12.5C14.472,12.5 14.375,12.458 14.292,12.375C14.208,12.292 14.167,12.194 14.167,12.083V11.25C14.167,11.139 14.208,11.042 14.292,10.958C14.375,10.875 14.472,10.833 14.583,10.833H15.417C15.528,10.833 15.625,10.875 15.708,10.958C15.792,11.042 15.833,11.139 15.833,11.25V12.083C15.833,12.194 15.792,12.292 15.708,12.375C15.625,12.458 15.528,12.5 15.417,12.5H14.583ZM16.25,14.167C16.139,14.167 16.042,14.125 15.958,14.042C15.875,13.958 15.833,13.861 15.833,13.75V12.917C15.833,12.806 15.875,12.708 15.958,12.625C16.042,12.542 16.139,12.5 16.25,12.5H17.083C17.194,12.5 17.292,12.542 17.375,12.625C17.458,12.708 17.5,12.806 17.5,12.917V13.75C17.5,13.861 17.458,13.958 17.375,14.042C17.292,14.125 17.194,14.167 17.083,14.167H16.25Z"
android:fillColor="#282828"/>
<path
android:pathData="M4.167,9.167C3.708,9.167 3.316,9.003 2.99,8.677C2.663,8.351 2.5,7.958 2.5,7.5V4.167C2.5,3.708 2.663,3.316 2.99,2.99C3.316,2.663 3.708,2.5 4.167,2.5H7.5C7.958,2.5 8.351,2.663 8.677,2.99C9.003,3.316 9.167,3.708 9.167,4.167V7.5C9.167,7.958 9.003,8.351 8.677,8.677C8.351,9.003 7.958,9.167 7.5,9.167H4.167ZM4.167,7.5H7.5V4.167H4.167V7.5ZM4.167,17.5C3.708,17.5 3.316,17.337 2.99,17.01C2.663,16.684 2.5,16.292 2.5,15.833V12.5C2.5,12.042 2.663,11.649 2.99,11.323C3.316,10.997 3.708,10.833 4.167,10.833H7.5C7.958,10.833 8.351,10.997 8.677,11.323C9.003,11.649 9.167,12.042 9.167,12.5V15.833C9.167,16.292 9.003,16.684 8.677,17.01C8.351,17.337 7.958,17.5 7.5,17.5H4.167ZM4.167,15.833H7.5V12.5H4.167V15.833ZM12.5,9.167C12.042,9.167 11.649,9.003 11.323,8.677C10.997,8.351 10.833,7.958 10.833,7.5V4.167C10.833,3.708 10.997,3.316 11.323,2.99C11.649,2.663 12.042,2.5 12.5,2.5H15.833C16.292,2.5 16.684,2.663 17.01,2.99C17.337,3.316 17.5,3.708 17.5,4.167V7.5C17.5,7.958 17.337,8.351 17.01,8.677C16.684,9.003 16.292,9.167 15.833,9.167H12.5ZM12.5,7.5H15.833V4.167H12.5V7.5ZM16.25,17.5C16.139,17.5 16.042,17.458 15.958,17.375C15.875,17.292 15.833,17.194 15.833,17.083V16.25C15.833,16.139 15.875,16.042 15.958,15.958C16.042,15.875 16.139,15.833 16.25,15.833H17.083C17.194,15.833 17.292,15.875 17.375,15.958C17.458,16.042 17.5,16.139 17.5,16.25V17.083C17.5,17.194 17.458,17.292 17.375,17.375C17.292,17.458 17.194,17.5 17.083,17.5H16.25ZM11.25,12.5C11.139,12.5 11.042,12.458 10.958,12.375C10.875,12.292 10.833,12.194 10.833,12.083V11.25C10.833,11.139 10.875,11.042 10.958,10.958C11.042,10.875 11.139,10.833 11.25,10.833H12.083C12.194,10.833 12.292,10.875 12.375,10.958C12.458,11.042 12.5,11.139 12.5,11.25V12.083C12.5,12.194 12.458,12.292 12.375,12.375C12.292,12.458 12.194,12.5 12.083,12.5H11.25ZM12.917,14.167C12.806,14.167 12.708,14.125 12.625,14.042C12.542,13.958 12.5,13.861 12.5,13.75V12.917C12.5,12.806 12.542,12.708 12.625,12.625C12.708,12.542 12.806,12.5 12.917,12.5H13.75C13.861,12.5 13.958,12.542 14.042,12.625C14.125,12.708 14.167,12.806 14.167,12.917V13.75C14.167,13.861 14.125,13.958 14.042,14.042C13.958,14.125 13.861,14.167 13.75,14.167H12.917ZM11.25,15.833C11.139,15.833 11.042,15.792 10.958,15.708C10.875,15.625 10.833,15.528 10.833,15.417V14.583C10.833,14.472 10.875,14.375 10.958,14.292C11.042,14.208 11.139,14.167 11.25,14.167H12.083C12.194,14.167 12.292,14.208 12.375,14.292C12.458,14.375 12.5,14.472 12.5,14.583V15.417C12.5,15.528 12.458,15.625 12.375,15.708C12.292,15.792 12.194,15.833 12.083,15.833H11.25ZM12.917,17.5C12.806,17.5 12.708,17.458 12.625,17.375C12.542,17.292 12.5,17.194 12.5,17.083V16.25C12.5,16.139 12.542,16.042 12.625,15.958C12.708,15.875 12.806,15.833 12.917,15.833H13.75C13.861,15.833 13.958,15.875 14.042,15.958C14.125,16.042 14.167,16.139 14.167,16.25V17.083C14.167,17.194 14.125,17.292 14.042,17.375C13.958,17.458 13.861,17.5 13.75,17.5H12.917ZM14.583,15.833C14.472,15.833 14.375,15.792 14.292,15.708C14.208,15.625 14.167,15.528 14.167,15.417V14.583C14.167,14.472 14.208,14.375 14.292,14.292C14.375,14.208 14.472,14.167 14.583,14.167H15.417C15.528,14.167 15.625,14.208 15.708,14.292C15.792,14.375 15.833,14.472 15.833,14.583V15.417C15.833,15.528 15.792,15.625 15.708,15.708C15.625,15.792 15.528,15.833 15.417,15.833H14.583ZM14.583,12.5C14.472,12.5 14.375,12.458 14.292,12.375C14.208,12.292 14.167,12.194 14.167,12.083V11.25C14.167,11.139 14.208,11.042 14.292,10.958C14.375,10.875 14.472,10.833 14.583,10.833H15.417C15.528,10.833 15.625,10.875 15.708,10.958C15.792,11.042 15.833,11.139 15.833,11.25V12.083C15.833,12.194 15.792,12.292 15.708,12.375C15.625,12.458 15.528,12.5 15.417,12.5H14.583ZM16.25,14.167C16.139,14.167 16.042,14.125 15.958,14.042C15.875,13.958 15.833,13.861 15.833,13.75V12.917C15.833,12.806 15.875,12.708 15.958,12.625C16.042,12.542 16.139,12.5 16.25,12.5H17.083C17.194,12.5 17.292,12.542 17.375,12.625C17.458,12.708 17.5,12.806 17.5,12.917V13.75C17.5,13.861 17.458,13.958 17.375,14.042C17.292,14.125 17.194,14.167 17.083,14.167H16.25Z"
android:fillColor="@android:color/white"
android:pathData="M120,440L120,120L440,120L440,440L120,440ZM200,360L360,360L360,200L200,200L200,360ZM120,840L120,520L440,520L440,840L120,840ZM200,760L360,760L360,600L200,600L200,760ZM520,440L520,120L840,120L840,440L520,440ZM600,360L760,360L760,200L600,200L600,360ZM760,840L760,760L840,760L840,840L760,840ZM520,600L520,520L600,520L600,600L520,600ZM600,680L600,600L680,600L680,680L600,680ZM520,760L520,680L600,680L600,760L520,760ZM600,840L600,760L680,760L680,840L600,840ZM680,760L680,680L760,680L760,760L680,760ZM680,600L680,520L760,520L760,600L680,600ZM760,680L760,600L840,600L840,680L760,680Z"/>
android:fillAlpha="0.25"/>
</vector>

0 comments on commit 0a2e6fd

Please sign in to comment.