Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add search option #2

Merged
merged 6 commits into from
Apr 9, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add string into string resource
  • Loading branch information
cp-luzi-p committed Apr 9, 2022
commit 67405a7df2a903ea6c809fef5b86f476c36234b3
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalFocusManager
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
Expand Down Expand Up @@ -55,7 +56,7 @@ fun SampleCountryPicker() {
modifier = Modifier
.fillMaxWidth()
.padding(16.dp),
text = "Select Country", textAlign = TextAlign.Center,
text = stringResource(R.string.select_country_text), textAlign = TextAlign.Center,
fontWeight = FontWeight.Bold,
fontSize = 20.sp
)
Expand All @@ -71,7 +72,7 @@ fun SampleCountryPicker() {
}
) {
CountryTextField(
label = "Select country",
label = stringResource(R.string.select_country_text),
modifier = Modifier
.padding(top = 50.dp)
.align(Alignment.TopCenter),
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<resources>
<string name="app_name">JetCountyPicker</string>
<string name="select_country_text">Select country</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
Expand Down Expand Up @@ -76,7 +77,7 @@ fun countrySearchView(state: ModalBottomSheetState): String {
)
if (searchValue.isEmpty()) {
Text(
text = "Search",
text = stringResource(R.string.search_text),
style = MaterialTheme.typography.body1,
color = Color.Gray,
modifier = Modifier
Expand Down
4 changes: 4 additions & 0 deletions countrypicker/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="search_text">Search</string>
</resources>