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