removed "Provider" from extension name (#97)

* remove "Provider" from extension name
This commit is contained in:
Hexated 2022-09-09 18:13:25 +07:00 committed by GitHub
parent 5b67bde06a
commit 9383a2d176
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -135,6 +135,7 @@ class PluginAdapter(
) {
val metadata = data.plugin.second
val disabled = metadata.status == PROVIDER_STATUS_DOWN
val name = metadata.name.removeSuffix("Provider")
val alpha = if (disabled) 0.6f else 1f
val isLocal = !data.plugin.second.url.startsWith("http")
itemView.main_text?.alpha = alpha
@ -177,7 +178,7 @@ class PluginAdapter(
} catch (e: Throwable) {
Log.e(
"PluginAdapter",
"Failed to open ${metadata.name} settings: ${
"Failed to open $name settings: ${
Log.getStackTraceString(e)
}"
)
@ -235,7 +236,7 @@ class PluginAdapter(
} else {
itemView.ext_filesize?.isVisible = false
}
itemView.main_text.setText(if(disabled) txt(R.string.single_plugin_disabled, metadata.name) else txt(metadata.name))
itemView.main_text.setText(if(disabled) txt(R.string.single_plugin_disabled, name) else txt(name))
itemView.sub_text?.isGone = metadata.description.isNullOrBlank()
itemView.sub_text?.text = metadata.description.html()
}

View file

@ -64,7 +64,7 @@ class PluginDetailsFragment(val data: PluginViewData) : BottomSheetDialogFragmen
) {
plugin_icon?.setImageResource(R.drawable.ic_baseline_extension_24)
}
plugin_name?.text = metadata.name
plugin_name?.text = metadata.name.removeSuffix("Provider")
plugin_version?.text = metadata.version.toString()
plugin_description?.text = metadata.description ?: getString(R.string.no_data)
plugin_size?.text = if (metadata.fileSize == null) getString(R.string.no_data) else formatFileSize(context, metadata.fileSize)