59 lines
1.5 KiB
Java
59 lines
1.5 KiB
Java
package com.bumptech.glide.manager;
|
|
|
|
import com.bumptech.glide.util.Util;
|
|
import java.util.Collections;
|
|
import java.util.Iterator;
|
|
import java.util.Set;
|
|
import java.util.WeakHashMap;
|
|
|
|
/* loaded from: classes.dex */
|
|
class ActivityFragmentLifecycle implements Lifecycle {
|
|
private final Set<LifecycleListener> a = Collections.newSetFromMap(new WeakHashMap());
|
|
private boolean b;
|
|
private boolean c;
|
|
|
|
ActivityFragmentLifecycle() {
|
|
}
|
|
|
|
@Override // com.bumptech.glide.manager.Lifecycle
|
|
public void a(LifecycleListener lifecycleListener) {
|
|
this.a.add(lifecycleListener);
|
|
if (this.c) {
|
|
lifecycleListener.a();
|
|
} else if (this.b) {
|
|
lifecycleListener.onStart();
|
|
} else {
|
|
lifecycleListener.b();
|
|
}
|
|
}
|
|
|
|
@Override // com.bumptech.glide.manager.Lifecycle
|
|
public void b(LifecycleListener lifecycleListener) {
|
|
this.a.remove(lifecycleListener);
|
|
}
|
|
|
|
void c() {
|
|
this.b = false;
|
|
Iterator it = Util.a(this.a).iterator();
|
|
while (it.hasNext()) {
|
|
((LifecycleListener) it.next()).b();
|
|
}
|
|
}
|
|
|
|
void b() {
|
|
this.b = true;
|
|
Iterator it = Util.a(this.a).iterator();
|
|
while (it.hasNext()) {
|
|
((LifecycleListener) it.next()).onStart();
|
|
}
|
|
}
|
|
|
|
void a() {
|
|
this.c = true;
|
|
Iterator it = Util.a(this.a).iterator();
|
|
while (it.hasNext()) {
|
|
((LifecycleListener) it.next()).a();
|
|
}
|
|
}
|
|
}
|