fix: NPE in filter tabs view
This commit is contained in:
parent
7a9f6d861f
commit
0c0c717818
@ -327,7 +327,7 @@ public class ActionBar extends FrameLayout {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (NekoConfig.actionBarDecoration.Int() == 3 || !manualStart) {
|
||||
if (NekoConfig.actionBarDecoration.Int() == 3) {
|
||||
if (snowflakesEffect != null) {
|
||||
snowflakesEffect = null;
|
||||
}
|
||||
@ -342,6 +342,13 @@ public class ActionBar extends FrameLayout {
|
||||
if (snowflakesEffect == null) {
|
||||
snowflakesEffect = new SnowflakesEffect(0);
|
||||
}
|
||||
} else if (!manualStart) {
|
||||
if (snowflakesEffect != null) {
|
||||
snowflakesEffect = null;
|
||||
}
|
||||
if (fireworksEffect != null) {
|
||||
fireworksEffect = null;
|
||||
}
|
||||
}
|
||||
if (snowflakesEffect != null) {
|
||||
snowflakesEffect.onDraw(this, canvas);
|
||||
|
@ -415,8 +415,8 @@ public class FilterTabsView extends FrameLayout {
|
||||
android.graphics.Rect bounds = new android.graphics.Rect(0, 0, emoticonSize, emoticonSize);
|
||||
icon = getResources().getDrawable(FolderIconHelper.getTabIcon(currentTab.emoticon)).mutate();
|
||||
icon.setBounds(bounds);
|
||||
icon.setTint(textPaint.getColor());
|
||||
}
|
||||
icon.setTint(textPaint.getColor());
|
||||
iconX = (int) ((getMeasuredWidth() - tabWidth) / 2f);
|
||||
if (animateIconX) {
|
||||
iconX = (int) (iconX * changeProgress + animateFromIconX * (1f - changeProgress));
|
||||
@ -441,7 +441,7 @@ public class FilterTabsView extends FrameLayout {
|
||||
canvas.restore();
|
||||
iconAnimateInDrawable.setAlpha(alpha);
|
||||
}
|
||||
} else {
|
||||
} else if (icon != null) {
|
||||
canvas.save();
|
||||
canvas.translate(iconX, iconY);
|
||||
icon.draw(canvas);
|
||||
|
Loading…
Reference in New Issue
Block a user