APK反编译源代码展示 - 南明离火平台提供

应用版本信息
应用名称:My Hobby App
版本号:1.3.0
包名称:com.wargame

MD5 校验值:5f1b84d1c0d0613c76d15f8d65fbde50

反编译源代码说明

q.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。


package com.swmansion.rnscreens;

import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.view.animation.Animation;
import android.view.animation.AnimationSet;
import android.view.animation.Transformation;
import androidx.appcompat.widget.Toolbar;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.fragment.app.Fragment;
import com.google.android.material.appbar.AppBarLayout;
import com.swmansion.rnscreens.t;
import java.util.Objects;

public final class q extends n {

    private AppBarLayout f9697u0;

    private Toolbar f9698v0;

    private boolean f9699w0;

    private boolean f9700x0;

    private c f9701y0;

    private da.l<? super c, v9.q> f9702z0;

    private static final class a extends Animation {

        private final n f9703l;

        public a(n nVar) {
            ea.k.e(nVar, "mFragment");
            this.f9703l = nVar;
        }

        @Override
        protected void applyTransformation(float f10, Transformation transformation) {
            ea.k.e(transformation, "t");
            super.applyTransformation(f10, transformation);
            this.f9703l.S1(f10, !r3.h0());
        }
    }

    private static final class b extends CoordinatorLayout {
        private final n K;
        private final Animation.AnimationListener L;

        public static final class a implements Animation.AnimationListener {
            a() {
            }

            @Override
            public void onAnimationEnd(Animation animation) {
                ea.k.e(animation, "animation");
                b.this.K.Y1();
            }

            @Override
            public void onAnimationRepeat(Animation animation) {
                ea.k.e(animation, "animation");
            }

            @Override
            public void onAnimationStart(Animation animation) {
                ea.k.e(animation, "animation");
                b.this.K.Z1();
            }
        }

        public b(Context context, n nVar) {
            super(context);
            ea.k.e(context, "context");
            ea.k.e(nVar, "mFragment");
            this.K = nVar;
            this.L = new a();
        }

        @Override
        public void clearFocus() {
            if (getVisibility() != 4) {
                super.clearFocus();
            }
        }

        @Override
        public void startAnimation(Animation animation) {
            ea.k.e(animation, "animation");
            a aVar = new a(this.K);
            aVar.setDuration(animation.getDuration());
            if ((animation instanceof AnimationSet) && !this.K.f0()) {
                AnimationSet animationSet = (AnimationSet) animation;
                animationSet.addAnimation(aVar);
                animationSet.setAnimationListener(this.L);
                super.startAnimation(animationSet);
                return;
            }
            AnimationSet animationSet2 = new AnimationSet(true);
            animationSet2.addAnimation(animation);
            animationSet2.addAnimation(aVar);
            animationSet2.setAnimationListener(this.L);
            super.startAnimation(animationSet2);
        }
    }

    public q() {
        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.");
    }

    @SuppressLint({"ValidFragment"})
    public q(j jVar) {
        super(jVar);
        ea.k.e(jVar, "screenView");
    }

    private final void l2() {
        View U = U();
        ViewParent parent = U != null ? U.getParent() : null;
        if (parent instanceof p) {
            ((p) parent).E();
        }
    }

    private final boolean r2() {
        s headerConfig = W1().getHeaderConfig();
        int configSubviewsCount = headerConfig != null ? headerConfig.getConfigSubviewsCount() : 0;
        if (headerConfig != null && configSubviewsCount > 0) {
            for (int i10 = 0; i10 < configSubviewsCount; i10++) {
                if (headerConfig.d(i10).getType() == t.a.SEARCH_BAR) {
                    return true;
                }
            }
        }
        return false;
    }

    private final void s2(Menu menu) {
        menu.clear();
        if (r2()) {
            Context t10 = t();
            if (this.f9701y0 == null && t10 != null) {
                c cVar = new c(t10, this);
                this.f9701y0 = cVar;
                da.l<? super c, v9.q> lVar = this.f9702z0;
                if (lVar != null) {
                    lVar.c(cVar);
                }
            }
            MenuItem add = menu.add("");
            add.setShowAsAction(2);
            add.setActionView(this.f9701y0);
        }
    }

    @Override
    public void I0(Menu menu) {
        ea.k.e(menu, "menu");
        s2(menu);
        super.I0(menu);
    }

    @Override
    public void X1() {
        s headerConfig = W1().getHeaderConfig();
        if (headerConfig != null) {
            headerConfig.g();
        }
    }

    @Override
    public void Y1() {
        super.Y1();
        l2();
    }

    public final boolean i2() {
        l<?> container = W1().getContainer();
        if (!(container instanceof p)) {
            throw new IllegalStateException("ScreenStackFragment added into a non-stack container".toString());
        }
        if (!ea.k.a(((p) container).getRootScreen(), W1())) {
            return true;
        }
        Fragment F = F();
        if (F instanceof q) {
            return ((q) F).i2();
        }
        return false;
    }

    public final void j2() {
        l<?> container = W1().getContainer();
        if (!(container instanceof p)) {
            throw new IllegalStateException("ScreenStackFragment added into a non-stack container".toString());
        }
        ((p) container).z(this);
    }

    public final c k2() {
        return this.f9701y0;
    }

    public final void m2() {
        Toolbar toolbar;
        AppBarLayout appBarLayout = this.f9697u0;
        if (appBarLayout != null && (toolbar = this.f9698v0) != null && toolbar.getParent() == appBarLayout) {
            appBarLayout.removeView(toolbar);
        }
        this.f9698v0 = null;
    }

    public final void n2(da.l<? super c, v9.q> lVar) {
        this.f9702z0 = lVar;
    }

    public final void o2(Toolbar toolbar) {
        ea.k.e(toolbar, "toolbar");
        AppBarLayout appBarLayout = this.f9697u0;
        if (appBarLayout != null) {
            appBarLayout.addView(toolbar);
        }
        AppBarLayout.d dVar = new AppBarLayout.d(-1, -2);
        dVar.d(0);
        toolbar.setLayoutParams(dVar);
        this.f9698v0 = toolbar;
    }

    public final void p2(boolean z10) {
        if (this.f9699w0 != z10) {
            AppBarLayout appBarLayout = this.f9697u0;
            if (appBarLayout != null) {
                appBarLayout.setTargetElevation(z10 ? 0.0f : com.facebook.react.uimanager.s.d(4.0f));
            }
            this.f9699w0 = z10;
        }
    }

    public final void q2(boolean z10) {
        if (this.f9700x0 != z10) {
            ViewGroup.LayoutParams layoutParams = W1().getLayoutParams();
            Objects.requireNonNull(layoutParams, "null cannot be cast to non-null type androidx.coordinatorlayout.widget.CoordinatorLayout.LayoutParams");
            ((CoordinatorLayout.f) layoutParams).o(z10 ? null : new AppBarLayout.ScrollingViewBehavior());
            this.f9700x0 = z10;
        }
    }

    @Override
    public void t0(Menu menu, MenuInflater menuInflater) {
        ea.k.e(menu, "menu");
        ea.k.e(menuInflater, "inflater");
        s2(menu);
        super.t0(menu, menuInflater);
    }

    @Override
    public View u0(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        AppBarLayout appBarLayout;
        AppBarLayout appBarLayout2;
        ea.k.e(layoutInflater, "inflater");
        Context t10 = t();
        AppBarLayout appBarLayout3 = null;
        b bVar = t10 != null ? new b(t10, this) : null;
        j W1 = W1();
        CoordinatorLayout.f fVar = new CoordinatorLayout.f(-1, -1);
        fVar.o(this.f9700x0 ? null : new AppBarLayout.ScrollingViewBehavior());
        W1.setLayoutParams(fVar);
        if (bVar != null) {
            bVar.addView(n.a2(W1()));
        }
        Context t11 = t();
        if (t11 != null) {
            appBarLayout3 = new AppBarLayout(t11);
            appBarLayout3.setBackgroundColor(0);
            appBarLayout3.setLayoutParams(new AppBarLayout.d(-1, -2));
        }
        this.f9697u0 = appBarLayout3;
        if (bVar != null) {
            bVar.addView(appBarLayout3);
        }
        if (this.f9699w0 && (appBarLayout2 = this.f9697u0) != null) {
            appBarLayout2.setTargetElevation(0.0f);
        }
        Toolbar toolbar = this.f9698v0;
        if (toolbar != null && (appBarLayout = this.f9697u0) != null) {
            appBarLayout.addView(n.a2(toolbar));
        }
        A1(true);
        return bVar;
    }
}