mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-04-28 02:29:09 +00:00
show details when tapping dictionary
This commit is contained in:
parent
2e899ae3e5
commit
57f0fcb32c
1 changed files with 10 additions and 1 deletions
|
@ -230,9 +230,9 @@ class LanguageSettingsDialog(
|
|||
}
|
||||
val dictType = dictFile.name.substringBefore("_${USER_DICTIONARY_SUFFIX}")
|
||||
val rowBinding = LanguageListItemBinding.inflate(LayoutInflater.from(context), listView, false)
|
||||
val header = DictionaryInfoUtils.getDictionaryFileHeaderOrNull(dictFile, 0, dictFile.length())
|
||||
rowBinding.languageName.text = dictType
|
||||
rowBinding.languageDetails.apply {
|
||||
val header = DictionaryInfoUtils.getDictionaryFileHeaderOrNull(dictFile, 0, dictFile.length())
|
||||
if (header?.description == null) {
|
||||
isGone = true
|
||||
} else {
|
||||
|
@ -240,6 +240,15 @@ class LanguageSettingsDialog(
|
|||
text = header.description
|
||||
}
|
||||
}
|
||||
rowBinding.languageText.setOnClickListener {
|
||||
if (header == null) return@setOnClickListener
|
||||
val locale = LocaleUtils.constructLocaleFromString(header.mLocaleString).getDisplayName(context.resources.configuration.locale)
|
||||
val message = dictType + "\n" + locale + "\nv" + header.mVersionString + "\n" + header.description
|
||||
Builder(context)
|
||||
.setMessage(message)
|
||||
.setPositiveButton(android.R.string.ok, null)
|
||||
.show()
|
||||
}
|
||||
rowBinding.languageSwitch.isGone = true
|
||||
rowBinding.deleteButton.apply {
|
||||
isVisible = true
|
||||
|
|
Loading…
Add table
Reference in a new issue