MD5 校验值:b359069a22e95e2832438c301625aae5
i.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。
package com.swmansion.rnscreens; import android.app.Activity; import android.content.Context; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.ViewParent; import android.widget.FrameLayout; import androidx.fragment.app.Fragment; import com.facebook.react.bridge.ReactContext; import com.facebook.react.bridge.UiThreadUtil; import com.facebook.react.uimanager.UIManagerModule; import com.swmansion.rnscreens.d; import java.util.ArrayList; import java.util.List; import java.util.Objects; public class i extends Fragment { public static final a f13633p0 = new a(null); public d f13634l0; private final List<f<?>> f13635m0; private boolean f13636n0; private float f13637o0; public static final class a { private a() { } public a(qg.g gVar) { this(); } protected final View a(View view) { qg.l.e(view, "view"); ViewParent parent = view.getParent(); if (parent != null) { ViewGroup viewGroup = (ViewGroup) parent; viewGroup.endViewTransition(view); viewGroup.removeView(view); } view.setVisibility(0); return view; } } public enum b { Appear, WillAppear, Disappear, WillDisappear } public class c { public static final int[] f13643a; static { int[] iArr = new int[b.values().length]; iArr[b.WillAppear.ordinal()] = 1; iArr[b.Appear.ordinal()] = 2; iArr[b.WillDisappear.ordinal()] = 3; iArr[b.Disappear.ordinal()] = 4; f13643a = iArr; } } public i() { this.f13635m0 = new ArrayList(); this.f13637o0 = -1.0f; throw new IllegalStateException("Screen fragments should never be restored. Follow instructions from https://github.com/software-mansion/react-native-screens/issues/17#issuecomment-424704067 to properly configure your main activity."); } public i(d dVar) { qg.l.e(dVar, "screenView"); this.f13635m0 = new ArrayList(); this.f13637o0 = -1.0f; f2(dVar); } private final void O1(b bVar, i iVar) { com.facebook.react.uimanager.events.c fVar; com.facebook.react.uimanager.events.d eventDispatcher; if (iVar instanceof m) { d X1 = iVar.X1(); int i10 = c.f13643a[bVar.ordinal()]; if (i10 == 1) { fVar = new nf.f(X1.getId()); } else if (i10 == 2) { fVar = new nf.b(X1.getId()); } else if (i10 == 3) { fVar = new nf.g(X1.getId()); } else { if (i10 != 4) { throw new hg.k(); } fVar = new nf.c(X1.getId()); } Context context = X1.getContext(); Objects.requireNonNull(context, "null cannot be cast to non-null type com.facebook.react.bridge.ReactContext"); UIManagerModule uIManagerModule = (UIManagerModule) ((ReactContext) context).getNativeModule(UIManagerModule.class); if (uIManagerModule != null && (eventDispatcher = uIManagerModule.getEventDispatcher()) != null) { eventDispatcher.c(fVar); } iVar.P1(bVar); } } private final void P1(b bVar) { d topScreen; i fragment; for (f<?> fVar : this.f13635m0) { if (fVar.getScreenCount() > 0 && (topScreen = fVar.getTopScreen()) != null && (topScreen.getStackAnimation() != d.e.NONE || h0())) { d topScreen2 = fVar.getTopScreen(); if (topScreen2 != null && (fragment = topScreen2.getFragment()) != null) { O1(bVar, fragment); } } } } public static final void a2(i iVar) { qg.l.e(iVar, "this$0"); iVar.R1(); } public static final void c2(i iVar) { qg.l.e(iVar, "this$0"); iVar.T1(); } public static final View d2(View view) { return f13633p0.a(view); } private final void j2() { androidx.fragment.app.e m10 = m(); if (m10 == null) { this.f13636n0 = true; } else { s.f13696a.p(X1(), m10, h2()); } } @Override public void O0() { super.O0(); if (this.f13636n0) { this.f13636n0 = false; s.f13696a.p(X1(), g2(), h2()); } } public final void Q1() { com.facebook.react.uimanager.events.d eventDispatcher; Context context = X1().getContext(); Objects.requireNonNull(context, "null cannot be cast to non-null type com.facebook.react.bridge.ReactContext"); UIManagerModule uIManagerModule = (UIManagerModule) ((ReactContext) context).getNativeModule(UIManagerModule.class); if (uIManagerModule == null || (eventDispatcher = uIManagerModule.getEventDispatcher()) == null) { return; } eventDispatcher.c(new nf.a(X1().getId())); } public final void R1() { O1(b.Appear, this); V1(1.0f, false); } public final void S1() { O1(b.Disappear, this); V1(1.0f, true); } public final void T1() { O1(b.WillAppear, this); V1(0.0f, false); } public final void U1() { O1(b.WillDisappear, this); V1(0.0f, true); } public final void V1(float f10, boolean z10) { com.facebook.react.uimanager.events.d eventDispatcher; if (this instanceof m) { if (this.f13637o0 == f10) { return; } float max = Math.max(0.0f, Math.min(1.0f, f10)); this.f13637o0 = max; if (!(max == 0.0f)) { r1 = (max != 1.0f ? 0 : 1) != 0 ? 2 : 3; } short s10 = (short) r1; f<?> container = X1().getContainer(); boolean goingForward = container instanceof k ? ((k) container).getGoingForward() : false; Context context = X1().getContext(); Objects.requireNonNull(context, "null cannot be cast to non-null type com.facebook.react.bridge.ReactContext"); UIManagerModule uIManagerModule = (UIManagerModule) ((ReactContext) context).getNativeModule(UIManagerModule.class); if (uIManagerModule == null || (eventDispatcher = uIManagerModule.getEventDispatcher()) == null) { return; } eventDispatcher.c(new nf.e(X1().getId(), this.f13637o0, z10, goingForward, s10)); } } public final List<f<?>> W1() { return this.f13635m0; } public final d X1() { d dVar = this.f13634l0; if (dVar != null) { return dVar; } qg.l.p("screen"); return null; } public void Y1() { j2(); } public void Z1() { if (j0()) { UiThreadUtil.runOnUiThread(new Runnable() { @Override public final void run() { i.a2(i.this); } }); } else { S1(); } } public final void b2() { if (j0()) { UiThreadUtil.runOnUiThread(new Runnable() { @Override public final void run() { i.c2(i.this); } }); } else { U1(); } } public final void e2(f<?> fVar) { qg.l.e(fVar, "screenContainer"); this.f13635m0.add(fVar); } public final void f2(d dVar) { qg.l.e(dVar, "<set-?>"); this.f13634l0 = dVar; } public final Activity g2() { i fragment; androidx.fragment.app.e m10; androidx.fragment.app.e m11 = m(); if (m11 != null) { return m11; } Context context = X1().getContext(); if (context instanceof ReactContext) { ReactContext reactContext = (ReactContext) context; if (reactContext.getCurrentActivity() != null) { return reactContext.getCurrentActivity(); } } for (ViewParent container = X1().getContainer(); container != null; container = container.getParent()) { if ((container instanceof d) && (fragment = ((d) container).getFragment()) != null && (m10 = fragment.m()) != null) { return m10; } } return null; } public final ReactContext h2() { if (t() instanceof ReactContext) { Context t10 = t(); Objects.requireNonNull(t10, "null cannot be cast to non-null type com.facebook.react.bridge.ReactContext"); return (ReactContext) t10; } if (X1().getContext() instanceof ReactContext) { Context context = X1().getContext(); Objects.requireNonNull(context, "null cannot be cast to non-null type com.facebook.react.bridge.ReactContext"); return (ReactContext) context; } for (ViewParent container = X1().getContainer(); container != null; container = container.getParent()) { if (container instanceof d) { d dVar = (d) container; if (dVar.getContext() instanceof ReactContext) { Context context2 = dVar.getContext(); Objects.requireNonNull(context2, "null cannot be cast to non-null type com.facebook.react.bridge.ReactContext"); return (ReactContext) context2; } } } return null; } public final void i2(f<?> fVar) { qg.l.e(fVar, "screenContainer"); this.f13635m0.remove(fVar); } @Override public View x0(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { qg.l.e(layoutInflater, "inflater"); Context t10 = t(); FrameLayout frameLayout = t10 == null ? null : new FrameLayout(t10); X1().setLayoutParams(new FrameLayout.LayoutParams(-1, -1)); if (frameLayout != null) { frameLayout.addView(d2(X1())); } return frameLayout; } @Override public void y0() { com.facebook.react.uimanager.events.d eventDispatcher; super.y0(); f<?> container = X1().getContainer(); if ((container == null || !container.j(this)) && (X1().getContext() instanceof ReactContext)) { Context context = X1().getContext(); Objects.requireNonNull(context, "null cannot be cast to non-null type com.facebook.react.bridge.ReactContext"); UIManagerModule uIManagerModule = (UIManagerModule) ((ReactContext) context).getNativeModule(UIManagerModule.class); if (uIManagerModule != null && (eventDispatcher = uIManagerModule.getEventDispatcher()) != null) { eventDispatcher.c(new nf.d(X1().getId())); } } this.f13635m0.clear(); } }