Remove unncessary attachedToWindow check

It was preventing icons from updating correctly

bug: 168620505
Test: Repro steps in bug no longer repro
Change-Id: I4f32dbd571b48f2e94aaff2a8be5f7e603407dba
This commit is contained in:
Vinit Nayak
2021-02-05 12:00:22 -08:00
parent 8ae80bcaa6
commit e04ccb5260

View File

@@ -51,7 +51,7 @@ public class ContextualButton extends ButtonDispatcher {
* Reload the drawable from resource id, should reapply the previous dark intensity.
*/
public void updateIcon(int lightIconColor, int darkIconColor) {
if (getCurrentView() == null || !getCurrentView().isAttachedToWindow() || mIconResId == 0) {
if (mIconResId == 0) {
return;
}
final KeyButtonDrawable currentDrawable = getImageDrawable();