mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-14 01:47:17 +01:00
67 lines
2.2 KiB
Java
67 lines
2.2 KiB
Java
package androidx.databinding;
|
|
|
|
import androidx.annotation.NonNull;
|
|
import androidx.databinding.Observable;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
/* loaded from: classes13.dex */
|
|
public class BaseObservable implements Observable {
|
|
private transient PropertyChangeRegistry mCallbacks;
|
|
|
|
@Override // androidx.databinding.Observable
|
|
public void addOnPropertyChangedCallback(@NonNull Observable.OnPropertyChangedCallback onPropertyChangedCallback) {
|
|
synchronized (this) {
|
|
try {
|
|
if (this.mCallbacks == null) {
|
|
this.mCallbacks = new PropertyChangeRegistry();
|
|
}
|
|
} catch (Throwable th) {
|
|
throw th;
|
|
}
|
|
}
|
|
this.mCallbacks.add(onPropertyChangedCallback);
|
|
}
|
|
|
|
public void notifyChange() {
|
|
synchronized (this) {
|
|
try {
|
|
PropertyChangeRegistry propertyChangeRegistry = this.mCallbacks;
|
|
if (propertyChangeRegistry == null) {
|
|
return;
|
|
}
|
|
propertyChangeRegistry.notifyCallbacks(this, 0, null);
|
|
} catch (Throwable th) {
|
|
throw th;
|
|
}
|
|
}
|
|
}
|
|
|
|
public void notifyPropertyChanged(int i) {
|
|
synchronized (this) {
|
|
try {
|
|
PropertyChangeRegistry propertyChangeRegistry = this.mCallbacks;
|
|
if (propertyChangeRegistry == null) {
|
|
return;
|
|
}
|
|
propertyChangeRegistry.notifyCallbacks(this, i, null);
|
|
} catch (Throwable th) {
|
|
throw th;
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // androidx.databinding.Observable
|
|
public void removeOnPropertyChangedCallback(@NonNull Observable.OnPropertyChangedCallback onPropertyChangedCallback) {
|
|
synchronized (this) {
|
|
try {
|
|
PropertyChangeRegistry propertyChangeRegistry = this.mCallbacks;
|
|
if (propertyChangeRegistry == null) {
|
|
return;
|
|
}
|
|
propertyChangeRegistry.remove(onPropertyChangedCallback);
|
|
} catch (Throwable th) {
|
|
throw th;
|
|
}
|
|
}
|
|
}
|
|
}
|