Update ControlDirection.java

This commit is contained in:
Tungstend 2024-02-25 17:21:56 +08:00
parent ce5e6719a1
commit dd0cf5525f
1 changed files with 3 additions and 3 deletions

View File

@ -153,6 +153,9 @@ public class ControlDirection extends RelativeLayout implements CustomView {
post(() -> { post(() -> {
notifyData(); notifyData();
if (notifyListener == null || dataChangeListener == null || boundaryListener == null || visibilityListener == null) {
return;
}
if (menu != null) { if (menu != null) {
menu.editModeProperty().addListener(notifyListener); menu.editModeProperty().addListener(notifyListener);
} }
@ -195,9 +198,6 @@ public class ControlDirection extends RelativeLayout implements CustomView {
alphaListener = null; alphaListener = null;
post(() -> { post(() -> {
if (notifyListener == null || dataChangeListener == null || boundaryListener == null || visibilityListener == null) {
return;
}
notifyData(); notifyData();
dataProperty.addListener(dataChangeListener); dataProperty.addListener(dataChangeListener);
getData().addListener(notifyListener); getData().addListener(notifyListener);