am 18bbc6a0: Adding workaround for issue with null drawable

* commit '18bbc6a013e10b1fe384b7d3798622e087c813d2':
  Adding workaround for issue with null drawable
This commit is contained in:
Adam Cohen
2014-06-04 05:09:37 +00:00
committed by Android Git Automerger
@@ -49,6 +49,13 @@ public class InfoDropTarget extends ButtonDropTarget {
Resources r = getResources();
mHoverColor = r.getColor(R.color.info_target_hover_tint);
mDrawable = (TransitionDrawable) getCurrentDrawable();
if (mDrawable == null) {
// TODO: investigate why this is ever happening. Presently only on one known device.
mDrawable = r.getDrawable(R.drawable.info_target_selector);
setCompoundDrawablesRelativeWithIntrinsicBounds(mDrawable, null, null, null);
}
if (null != mDrawable) {
mDrawable.setCrossFadeEnabled(true);
}