mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-06-23 09:30:53 +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 dictType = dictFile.name.substringBefore("_${USER_DICTIONARY_SUFFIX}")
|
||||||
val rowBinding = LanguageListItemBinding.inflate(LayoutInflater.from(context), listView, false)
|
val rowBinding = LanguageListItemBinding.inflate(LayoutInflater.from(context), listView, false)
|
||||||
|
val header = DictionaryInfoUtils.getDictionaryFileHeaderOrNull(dictFile, 0, dictFile.length())
|
||||||
rowBinding.languageName.text = dictType
|
rowBinding.languageName.text = dictType
|
||||||
rowBinding.languageDetails.apply {
|
rowBinding.languageDetails.apply {
|
||||||
val header = DictionaryInfoUtils.getDictionaryFileHeaderOrNull(dictFile, 0, dictFile.length())
|
|
||||||
if (header?.description == null) {
|
if (header?.description == null) {
|
||||||
isGone = true
|
isGone = true
|
||||||
} else {
|
} else {
|
||||||
|
@ -240,6 +240,15 @@ class LanguageSettingsDialog(
|
||||||
text = header.description
|
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.languageSwitch.isGone = true
|
||||||
rowBinding.deleteButton.apply {
|
rowBinding.deleteButton.apply {
|
||||||
isVisible = true
|
isVisible = true
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue