Skip to content

Commit

Permalink
Extract string resources
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahmud0808 committed Jan 5, 2025
1 parent 5ee255d commit f04b69c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class StylesFragment : Fragment() {
}

val titleBinding = ViewTextFieldOutlinedBinding.inflate(layoutInflater).apply {
outlinedTextField.hint = "Title"
outlinedTextField.hint = getString(R.string.title)
outlinedTextField.boxBackgroundMode = TextInputLayout.BOX_BACKGROUND_OUTLINE
outlinedTextField.editText?.gravity = Gravity.TOP or Gravity.START
if (title.isNotEmpty()) {
Expand All @@ -129,7 +129,7 @@ class StylesFragment : Fragment() {
}

val descBinding = ViewTextFieldOutlinedBinding.inflate(layoutInflater).apply {
outlinedTextField.hint = "Description"
outlinedTextField.hint = getString(R.string.description)
outlinedTextField.boxBackgroundMode = TextInputLayout.BOX_BACKGROUND_OUTLINE
outlinedTextField.editText?.gravity = Gravity.TOP or Gravity.START
if (desc.isNotEmpty()) {
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@
<string name="monet_content">Content</string>
<string name="monet_content_desc">Balanced and calming palette, promoting a sense of tranquility and contentment.</string>
<string name="save_current_style">Save current style</string>
<string name="title_and_desc_cant_be_empty">Title and description can\'t be empty</string>
<string name="title">Title</string>
<string name="description">Description</string>
<string name="save">Save</string>
<string name="title_and_desc_cant_be_empty">Title and description can\'t be empty</string>

<!-- Settings -->
<string name="app_service_title">%s service</string>
Expand Down

0 comments on commit f04b69c

Please sign in to comment.