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
|
@Override
|
||||||
public void setTypeface(Typeface tf, int style) {
|
public void setTypeface(Typeface tf, int style) {
|
||||||
super.setTypeface(tf, style);
|
super.setTypeface(tf, style);
|
||||||
|
// might be called from constructor
|
||||||
|
if (textView != null) {
|
||||||
textView.setTypeface(getPaint().getTypeface());
|
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);
|
||||||
|
// might be called from constructor
|
||||||
|
if (textView != null) {
|
||||||
textView.setTextSize(getPaint().getTextSize());
|
textView.setTextSize(getPaint().getTextSize());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@NonNull
|
@NonNull
|
||||||
|
Loading…
Reference in New Issue
Block a user