Fix NPE on Android 4 in DirectionDragButton
This commit is contained in:
parent
14f5230641
commit
b0c5cd0069
@ -55,13 +55,19 @@ public class DirectionDragButton extends DragButton implements DirectionDragView
|
|||||||
@Override
|
@Override
|
||||||
public void setTypeface(Typeface tf, int style) {
|
public void setTypeface(Typeface tf, int style) {
|
||||||
super.setTypeface(tf, style);
|
super.setTypeface(tf, style);
|
||||||
textView.setTypeface(getPaint().getTypeface());
|
// might be called from constructor
|
||||||
|
if (textView != null) {
|
||||||
|
textView.setTypeface(getPaint().getTypeface());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setTextSize(int unit, float size) {
|
public void setTextSize(int unit, float size) {
|
||||||
super.setTextSize(unit, size);
|
super.setTextSize(unit, size);
|
||||||
textView.setTextSize(getPaint().getTextSize());
|
// might be called from constructor
|
||||||
|
if (textView != null) {
|
||||||
|
textView.setTextSize(getPaint().getTextSize());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user