add a label at the last settings item
This commit is contained in:
parent
5e31e72504
commit
22ecef42cf
2 changed files with 19 additions and 0 deletions
|
@ -102,6 +102,7 @@ class SettingsActivity : SimpleActivity() {
|
|||
}
|
||||
|
||||
private fun setupReplaceTitle() {
|
||||
settings_show_filename.text = getReplaceTitleText()
|
||||
settings_show_filename_holder.setOnClickListener {
|
||||
val items = arrayListOf(
|
||||
RadioItem(SHOW_FILENAME_NEVER, getString(R.string.never)),
|
||||
|
@ -111,8 +112,17 @@ class SettingsActivity : SimpleActivity() {
|
|||
|
||||
RadioGroupDialog(this@SettingsActivity, items, config.showFilename) {
|
||||
config.showFilename = it as Int
|
||||
settings_show_filename.text = getReplaceTitleText()
|
||||
sendIntent(REFRESH_LIST)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun getReplaceTitleText() = getString(
|
||||
when (config.showFilename) {
|
||||
SHOW_FILENAME_NEVER -> R.string.never
|
||||
SHOW_FILENAME_IF_UNAVAILABLE -> R.string.title_is_not_available
|
||||
else -> R.string.always
|
||||
}
|
||||
)
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/settings_scrollview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
@ -135,6 +136,14 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:text="@string/show_filename" />
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/settings_show_filename"
|
||||
style="@style/SettingsTextValueStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/settings_show_filename_label"
|
||||
tools:text="@string/title_is_not_available" />
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
|
Loading…
Reference in a new issue