0
0
Fork 0
mirror of https://github.com/YTVanced/VancedManager synced 2024-11-25 04:35:12 +00:00

fixed buttontag getter

This commit is contained in:
X1nto 2021-04-17 13:28:36 +04:00
parent c1770e2217
commit 4fee34b661

View file

@ -43,16 +43,6 @@ class ExpandableAppListAdapter(
appTitle.text = dataModel?.appName
appDescription.text = dataModel?.appDescription
dataModel?.appIcon?.let { appIcon.setImageResource(it) }
appDownload.apply {
val buttonTag = dataModel?.buttonTag?.value
setOnClickListener { viewModel.openInstallDialog(buttonTag, apps[position]) }
contentDescription = activity.getString(
if (buttonTag == ButtonTag.UPDATE)
R.string.accessibility_update
else
R.string.accessibility_download
)
}
appClickableLayout.setOnClickListener {
if (isAnimationRunning) return@setOnClickListener
val rootHeight = root.measuredHeight
@ -85,6 +75,17 @@ class ExpandableAppListAdapter(
changelog = dataModel?.changelog?.value
).show(activity.supportFragmentManager, "info")
}
dataModel?.buttonTag?.observe(activity) { buttonTag ->
appDownload.apply {
setOnClickListener { viewModel.openInstallDialog(buttonTag, apps[position]) }
contentDescription = activity.getString(
if (buttonTag == ButtonTag.UPDATE)
R.string.accessibility_update
else
R.string.accessibility_download
)
}
}
dataModel?.isAppInstalled?.observe(activity) {
appUninstall.isVisible = it
appLaunch.isVisible = it