58 lines
1.8 KiB
Java
58 lines
1.8 KiB
Java
package c.a.p;
|
|
|
|
import android.graphics.Rect;
|
|
import android.view.View;
|
|
import androidx.annotation.UiThread;
|
|
import d0.t.u;
|
|
import java.lang.ref.WeakReference;
|
|
import java.util.LinkedHashMap;
|
|
import java.util.LinkedHashSet;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Set;
|
|
/* compiled from: PanelsChildGestureRegionObserver.kt */
|
|
public final class b implements View.OnLayoutChangeListener {
|
|
public Map<Integer, Rect> i = new LinkedHashMap();
|
|
public Set<a> j = new LinkedHashSet();
|
|
|
|
/* compiled from: PanelsChildGestureRegionObserver.kt */
|
|
public interface a {
|
|
void onGestureRegionsUpdate(List<Rect> list);
|
|
}
|
|
|
|
/* compiled from: PanelsChildGestureRegionObserver.kt */
|
|
/* renamed from: c.a.p.b$b reason: collision with other inner class name */
|
|
public static final class C0033b {
|
|
public static WeakReference<b> a = new WeakReference<>(null);
|
|
|
|
@UiThread
|
|
public static final b a() {
|
|
b bVar = a.get();
|
|
if (bVar != null) {
|
|
return bVar;
|
|
}
|
|
b bVar2 = new b();
|
|
a = new WeakReference<>(bVar2);
|
|
return bVar2;
|
|
}
|
|
}
|
|
|
|
public final void a() {
|
|
List<Rect> list = u.toList(this.i.values());
|
|
for (a aVar : this.j) {
|
|
aVar.onGestureRegionsUpdate(list);
|
|
}
|
|
}
|
|
|
|
@Override // android.view.View.OnLayoutChangeListener
|
|
public void onLayoutChange(View view, int i, int i2, int i3, int i4, int i5, int i6, int i7, int i8) {
|
|
if (view != null) {
|
|
int[] iArr = {0, 0};
|
|
view.getLocationOnScreen(iArr);
|
|
int i9 = iArr[0];
|
|
int i10 = iArr[1];
|
|
this.i.put(Integer.valueOf(view.getId()), new Rect(i + i9, i2 + i10, i9 + i3, i10 + i4));
|
|
a();
|
|
}
|
|
}
|
|
}
|