1
0
Fork 0
* Fixes #4704. Overrides `setEnabled` for DeleteBrowsingDataItem to change view alpha when disabled and to toggle the checkbox `isEnabled` behavior based on the value provided.

* Updates CHANGELOG.md

* Removes unnecessary disabling of checkbox in DeleteBrowsingDataItem.kt
Updates CHANGELOG.md to reflect the component changed.
master
Suraj Shah 2019-08-19 21:53:12 +05:30 committed by Jeff Boek
parent 645674c9bd
commit 806961094b
2 changed files with 11 additions and 0 deletions

View File

@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Added
- #4704 - Adds ability to show a different alpha when no elements available to be deleted for a delete browsing data item
- #4137 - Adds pagination to the history view
- #3695 - Made search suggestions for other tabs clickable

View File

@ -19,6 +19,11 @@ class DeleteBrowsingDataItem @JvmOverloads constructor(
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr) {
private companion object {
private const val ENABLED_ALPHA = 1f
private const val DISABLED_ALPHA = 0.6f
}
val titleView: TextView
get() = title
@ -61,4 +66,9 @@ class DeleteBrowsingDataItem @JvmOverloads constructor(
subtitle.text = resources.getString(subtitleId)
}
}
override fun setEnabled(enabled: Boolean) {
super.setEnabled(enabled)
alpha = if (enabled) ENABLED_ALPHA else DISABLED_ALPHA
}
}