星辰影院解锁vip v1.0.4版本的 MD5 值为:3d99bbcbb0d5d5e568b9f6134424c24e

以下内容为反编译后的 ScreenStackFragment.java 源代码,内容仅作参考


package com.swmansion.rnscreens;

import android.annotation.SuppressLint;
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.view.animation.Animation;
import android.view.animation.AnimationSet;
import androidx.appcompat.widget.Toolbar;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.fragment.app.Fragment;
import com.facebook.react.uimanager.r;
import com.google.android.material.appbar.AppBarLayout;

public class ScreenStackFragment extends ScreenFragment {

    private static final float f10074c = r.c(4.0f);

    private AppBarLayout f10075d;

    private Toolbar f10076e;

    private boolean f10077f;

    private boolean f10078g;

    private static class NotifyingCoordinatorLayout extends CoordinatorLayout {
        private Animation.AnimationListener A;
        private final ScreenFragment z;

        class a implements Animation.AnimationListener {
            a() {
            }

            @Override
            public void onAnimationEnd(Animation animation) {
                NotifyingCoordinatorLayout.this.z.r0();
            }

            @Override
            public void onAnimationRepeat(Animation animation) {
            }

            @Override
            public void onAnimationStart(Animation animation) {
                NotifyingCoordinatorLayout.this.z.s0();
            }
        }

        public NotifyingCoordinatorLayout(Context context, ScreenFragment screenFragment) {
            super(context);
            this.A = new a();
            this.z = screenFragment;
        }

        @Override
        public void startAnimation(Animation animation) {
            AnimationSet animationSet = new AnimationSet(true);
            animationSet.addAnimation(animation);
            animationSet.setAnimationListener(this.A);
            super.startAnimation(animationSet);
        }
    }

    @SuppressLint({"ValidFragment"})
    public ScreenStackFragment(Screen screen) {
        super(screen);
    }

    private void z0() {
        ViewParent parent = getView() != null ? getView().getParent() : null;
        if (parent instanceof ScreenStack) {
            ((ScreenStack) parent).C();
        }
    }

    public void A0() {
        View childAt = this.a.getChildAt(0);
        if (childAt instanceof ScreenStackHeaderConfig) {
            ((ScreenStackHeaderConfig) childAt).g();
        }
    }

    public void B0() {
        Toolbar toolbar;
        if (this.f10075d != null && (toolbar = this.f10076e) != null) {
            ViewParent parent = toolbar.getParent();
            AppBarLayout appBarLayout = this.f10075d;
            if (parent == appBarLayout) {
                appBarLayout.removeView(this.f10076e);
            }
        }
        this.f10076e = null;
    }

    public void C0(Toolbar toolbar) {
        AppBarLayout appBarLayout = this.f10075d;
        if (appBarLayout != null) {
            appBarLayout.addView(toolbar);
        }
        this.f10076e = toolbar;
        AppBarLayout.d dVar = new AppBarLayout.d(-1, -2);
        dVar.d(0);
        this.f10076e.setLayoutParams(dVar);
    }

    public void D0(boolean z) {
        if (this.f10077f != z) {
            this.f10075d.setTargetElevation(z ? 0.0f : f10074c);
            this.f10077f = z;
        }
    }

    public void E0(boolean z) {
        if (this.f10078g != z) {
            ((CoordinatorLayout.f) this.a.getLayoutParams()).o(z ? null : new AppBarLayout.ScrollingViewBehavior());
            this.f10078g = z;
        }
    }

    @Override
    public Animation onCreateAnimation(int i2, boolean z, int i3) {
        if (i2 != 0 || isHidden()) {
            return null;
        }
        ScreenContainer container = q0().getContainer();
        boolean z2 = container != null && container.l();
        if (z) {
            if (z2) {
                return null;
            }
            o0();
            m0();
            return null;
        }
        if (!z2) {
            p0();
            n0();
        }
        z0();
        return null;
    }

    @Override
    public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        NotifyingCoordinatorLayout notifyingCoordinatorLayout = new NotifyingCoordinatorLayout(getContext(), this);
        CoordinatorLayout.f fVar = new CoordinatorLayout.f(-1, -1);
        fVar.o(this.f10078g ? null : new AppBarLayout.ScrollingViewBehavior());
        this.a.setLayoutParams(fVar);
        notifyingCoordinatorLayout.addView(ScreenFragment.t0(this.a));
        AppBarLayout appBarLayout = new AppBarLayout(getContext());
        this.f10075d = appBarLayout;
        appBarLayout.setBackgroundColor(0);
        this.f10075d.setLayoutParams(new AppBarLayout.d(-1, -2));
        notifyingCoordinatorLayout.addView(this.f10075d);
        if (this.f10077f) {
            this.f10075d.setTargetElevation(0.0f);
        }
        Toolbar toolbar = this.f10076e;
        if (toolbar != null) {
            this.f10075d.addView(ScreenFragment.t0(toolbar));
        }
        return notifyingCoordinatorLayout;
    }

    @Override
    public void r0() {
        super.r0();
        z0();
    }

    public boolean w0() {
        ScreenContainer container = this.a.getContainer();
        if (container instanceof ScreenStack) {
            if (((ScreenStack) container).getRootScreen() != q0()) {
                return true;
            }
            Fragment parentFragment = getParentFragment();
            if (parentFragment instanceof ScreenStackFragment) {
                return ((ScreenStackFragment) parentFragment).w0();
            }
            return false;
        }
        throw new IllegalStateException("ScreenStackFragment added into a non-stack container");
    }

    public void x0() {
        ScreenContainer container = this.a.getContainer();
        if (container instanceof ScreenStack) {
            ((ScreenStack) container).A(this);
            return;
        }
        throw new IllegalStateException("ScreenStackFragment added into a non-stack container");
    }

    public boolean y0() {
        return this.a.c();
    }

    public ScreenStackFragment() {
        throw new IllegalStateException("ScreenStack 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.");
    }
}