0
0
Fork 0
mirror of https://github.com/YTVanced/VancedManager synced 2024-11-28 22:13:01 +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 appTitle.text = dataModel?.appName
appDescription.text = dataModel?.appDescription appDescription.text = dataModel?.appDescription
dataModel?.appIcon?.let { appIcon.setImageResource(it) } 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 { appClickableLayout.setOnClickListener {
if (isAnimationRunning) return@setOnClickListener if (isAnimationRunning) return@setOnClickListener
val rootHeight = root.measuredHeight val rootHeight = root.measuredHeight
@ -85,6 +75,17 @@ class ExpandableAppListAdapter(
changelog = dataModel?.changelog?.value changelog = dataModel?.changelog?.value
).show(activity.supportFragmentManager, "info") ).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) { dataModel?.isAppInstalled?.observe(activity) {
appUninstall.isVisible = it appUninstall.isVisible = it
appLaunch.isVisible = it appLaunch.isVisible = it