Bump dependencies

This commit is contained in:
arkon
2022-04-07 22:19:31 -04:00
parent 3026ff241b
commit 52911539b8
4 changed files with 17 additions and 14 deletions

View File

@@ -152,16 +152,19 @@ class WebViewActivity : BaseActivity() {
return true
}
override fun onPrepareOptionsMenu(menu: Menu?): Boolean {
val backItem = menu?.findItem(R.id.action_web_back)
val forwardItem = menu?.findItem(R.id.action_web_forward)
backItem?.isEnabled = binding.webview.canGoBack()
forwardItem?.isEnabled = binding.webview.canGoForward()
override fun onPrepareOptionsMenu(menu: Menu): Boolean {
val iconTintColor = getResourceColor(R.attr.colorOnSurface)
val translucentIconTintColor = ColorUtils.setAlphaComponent(iconTintColor, 127)
backItem?.icon?.setTint(if (binding.webview.canGoBack()) iconTintColor else translucentIconTintColor)
forwardItem?.icon?.setTint(if (binding.webview.canGoForward()) iconTintColor else translucentIconTintColor)
menu.findItem(R.id.action_web_back).apply {
isEnabled = binding.webview.canGoBack()
icon.setTint(if (binding.webview.canGoBack()) iconTintColor else translucentIconTintColor)
}
menu.findItem(R.id.action_web_forward).apply {
isEnabled = binding.webview.canGoForward()
icon.setTint(if (binding.webview.canGoForward()) iconTintColor else translucentIconTintColor)
}
return super.onPrepareOptionsMenu(menu)
}