Skip to content

Commit

Permalink
Merge pull request #8 from Jaehwa-Noh/add-placeholder
Browse files Browse the repository at this point in the history
Add placeholder to SearchBar
  • Loading branch information
Jaehwa-Noh authored May 17, 2024
2 parents 7fc8f06 + fdc5452 commit 1c00706
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalFocusManager
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.heading
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.unit.dp
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.lifecycle.viewmodel.compose.viewModel
import com.example.flightsearchapp.R
import com.example.flightsearchapp.ui.flight.FlightsListScreen
import com.example.flightsearchapp.ui.suggestion.SuggestionsListScreen

Expand Down Expand Up @@ -174,6 +176,9 @@ fun FlightSearchBar(
contentDescription = null,
)
},
placeholder = {
Text(text = stringResource(id = R.string.search_bar_placeholder))
},
modifier = modifier
.testTag("Search bar"),
) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<resources>
<string name="app_name">Flight Search App</string>
</resources>
<string name="search_bar_placeholder">Enter departure airport</string>
</resources>

0 comments on commit 1c00706

Please sign in to comment.