Skip to content

Commit

Permalink
Improve readability of code
Browse files Browse the repository at this point in the history
  • Loading branch information
KCeh committed Jul 10, 2024
1 parent e703f41 commit 8cfbc20
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,23 +88,23 @@ internal class PreferencesFragment :
}.root

private fun SentinelViewItemPreferenceBinding.showPreferenceData(data: PreferencesData) {
data.values.forEach { tuple ->
data.values.forEach { (preferenceType, label, value) ->
prefsLayout.addView(
SentinelViewItemTextBinding.inflate(layoutInflater, prefsLayout, false)
.apply {
labelView.isAllCaps = false
labelView.text = tuple.second
valueView.text = tuple.third.toString()
labelView.text = label
valueView.text = value.toString()
root.setOnClickListener { _ ->
viewModel.cache(
data.name,
tuple
name = data.name,
tuple = Triple(preferenceType, label, value)
)
}
root.setOnLongClickListener {
it.context.copyToClipboard(
key = tuple.second,
value = tuple.third.toString()
key = label,
value = value.toString()
)
}
}.root
Expand Down
2 changes: 1 addition & 1 deletion sentinel/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<string name="sentinel_fragment_saved_state">Fragment Saved State</string>

<string name="sentinel_sort_preference_by_name">Sort preferences by name</string>
<string name="sentinel_hide_expands_the_preferences">Hide/expands the preferences</string>
<string name="sentinel_hide_expands_the_preferences">Hide/expand the preferences</string>
<string name="sentinel_preferences_editor">Preferences editor</string>
<string name="sentinel_key">Key</string>
<string name="sentinel_current_value">Current value</string>
Expand Down

0 comments on commit 8cfbc20

Please sign in to comment.