mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-28 15:56:49 +00:00
Adding workaround for issue with null drawable
A drawable is null which ought not be null, since it should have been set during inflation. Seems like a platform issue on one device. Adding a workaround to manually set it in code after inflation if necessary. issue 15334203 Change-Id: Ideb80c231300e61f6dfe5336d6d647a3e1b51817
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user