mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-21 20:47:03 -05:00
Minor edits
This commit is contained in:
parent
548dbf4b78
commit
6a3cd0054b
1 changed files with 3 additions and 3 deletions
|
@ -115,14 +115,14 @@ class WebViewActivity : BaseActivity<WebviewActivityBinding>() {
|
|||
}
|
||||
|
||||
override fun onPrepareOptionsMenu(menu: Menu?): Boolean {
|
||||
val backItem = binding.toolbar.menu.findItem(R.id.action_web_back)
|
||||
val forwardItem = binding.toolbar.menu.findItem(R.id.action_web_forward)
|
||||
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()
|
||||
|
||||
val iconTintColor = getResourceColor(R.attr.colorOnPrimary)
|
||||
val translucentIconTintColor = ColorUtils.setAlphaComponent(iconTintColor, 127)
|
||||
backItem.icon?.setTint(if (binding.webview.canGoBack()) iconTintColor else translucentIconTintColor)
|
||||
backItem?.icon?.setTint(if (binding.webview.canGoBack()) iconTintColor else translucentIconTintColor)
|
||||
forwardItem?.icon?.setTint(if (binding.webview.canGoForward()) iconTintColor else translucentIconTintColor)
|
||||
|
||||
return super.onPrepareOptionsMenu(menu)
|
||||
|
|
Loading…
Reference in a new issue