导航菜单

页面标题

页面副标题

Namma Yatri v3.3.7 - u.java 源代码

正在查看: Namma Yatri v3.3.7 应用的 u.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.swmansion.rnscreens;

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.y;
import jd.InterfaceC1012l;
import rc.C1144a;

public final class u extends q implements v {
    private AppBarLayout i;
    private Toolbar j;
    private boolean k;
    private boolean l;
    private View m;
    private C0462c n;
    private InterfaceC1012l o;

    private static final class a extends Animation {
        private final q a;

        public a(q mFragment) {
            kotlin.jvm.internal.m.i(mFragment, "mFragment");
            this.a = mFragment;
        }

        @Override
        protected void applyTransformation(float f, Transformation t) {
            kotlin.jvm.internal.m.i(t, "t");
            super.applyTransformation(f, t);
            this.a.C(f, !r3.isResumed());
        }
    }

    private static final class b extends CoordinatorLayout {
        private final q a;
        private final Animation.AnimationListener b;

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

            @Override
            public void onAnimationEnd(Animation animation) {
                kotlin.jvm.internal.m.i(animation, "animation");
                b.this.a.F();
            }

            @Override
            public void onAnimationRepeat(Animation animation) {
                kotlin.jvm.internal.m.i(animation, "animation");
            }

            @Override
            public void onAnimationStart(Animation animation) {
                kotlin.jvm.internal.m.i(animation, "animation");
                b.this.a.G();
            }
        }

        public b(Context context, q mFragment) {
            super(context);
            kotlin.jvm.internal.m.i(context, "context");
            kotlin.jvm.internal.m.i(mFragment, "mFragment");
            this.a = mFragment;
            this.b = new a();
        }

        public void clearFocus() {
            if (getVisibility() != 4) {
                super/*android.view.View*/.clearFocus();
            }
        }

        public void startAnimation(Animation animation) {
            kotlin.jvm.internal.m.i(animation, "animation");
            a aVar = new a(this.a);
            aVar.setDuration(animation.getDuration());
            if ((animation instanceof AnimationSet) && !this.a.isRemoving()) {
                AnimationSet animationSet = (AnimationSet) animation;
                animationSet.addAnimation(aVar);
                animationSet.setAnimationListener(this.b);
                super/*android.view.View*/.startAnimation(animationSet);
                return;
            }
            AnimationSet animationSet2 = new AnimationSet(true);
            animationSet2.addAnimation(animation);
            animationSet2.addAnimation(aVar);
            animationSet2.setAnimationListener(this.b);
            super/*android.view.View*/.startAnimation(animationSet2);
        }
    }

    public u(C0471l screenView) {
        super(screenView);
        kotlin.jvm.internal.m.i(screenView, "screenView");
    }

    private final View M() {
        View d = d();
        while (d != null) {
            if (d.isFocused()) {
                return d;
            }
            d = d instanceof ViewGroup ? ((ViewGroup) d).getFocusedChild() : null;
        }
        return null;
    }

    private final void O() {
        View view = getView();
        ViewParent parent = view != null ? view.getParent() : null;
        if (parent instanceof t) {
            ((t) parent).I();
        }
    }

    private final boolean U() {
        x headerConfig = d().getHeaderConfig();
        int configSubviewsCount = headerConfig != null ? headerConfig.getConfigSubviewsCount() : 0;
        if (headerConfig != null && configSubviewsCount > 0) {
            for (int i = 0; i < configSubviewsCount; i++) {
                if (headerConfig.e(i).getType() == y.a.e) {
                    return true;
                }
            }
        }
        return false;
    }

    private final void V(Menu menu) {
        menu.clear();
        if (U()) {
            Context context = getContext();
            if (this.n == null && context != null) {
                C0462c c0462c = new C0462c(context, this);
                this.n = c0462c;
                InterfaceC1012l interfaceC1012l = this.o;
                if (interfaceC1012l != null) {
                    interfaceC1012l.invoke(c0462c);
                }
            }
            MenuItem add = menu.add("");
            add.setShowAsAction(2);
            add.setActionView((View) this.n);
        }
    }

    @Override
    public void F() {
        super.F();
        O();
    }

    public boolean K() {
        n container = d().getContainer();
        if (!(container instanceof t)) {
            throw new IllegalStateException("ScreenStackFragment added into a non-stack container".toString());
        }
        if (!kotlin.jvm.internal.m.d(((t) container).getRootScreen(), d())) {
            return true;
        }
        Fragment parentFragment = getParentFragment();
        if (parentFragment instanceof u) {
            return ((u) parentFragment).K();
        }
        return false;
    }

    public void L() {
        n container = d().getContainer();
        if (!(container instanceof t)) {
            throw new IllegalStateException("ScreenStackFragment added into a non-stack container".toString());
        }
        ((t) container).D(this);
    }

    public final C0462c N() {
        return this.n;
    }

    public void P() {
        Toolbar toolbar;
        AppBarLayout appBarLayout = this.i;
        if (appBarLayout != null && (toolbar = this.j) != null && toolbar.getParent() == appBarLayout) {
            appBarLayout.removeView(toolbar);
        }
        this.j = null;
    }

    public final void Q(InterfaceC1012l interfaceC1012l) {
        this.o = interfaceC1012l;
    }

    public void R(Toolbar toolbar) {
        kotlin.jvm.internal.m.i(toolbar, "toolbar");
        AppBarLayout appBarLayout = this.i;
        if (appBarLayout != null) {
            appBarLayout.addView(toolbar);
        }
        AppBarLayout.d dVar = new AppBarLayout.d(-1, -2);
        dVar.g(0);
        toolbar.setLayoutParams(dVar);
        this.j = toolbar;
    }

    public void S(boolean z) {
        if (this.k != z) {
            AppBarLayout appBarLayout = this.i;
            if (appBarLayout != null) {
                appBarLayout.setElevation(z ? 0.0f : com.facebook.react.uimanager.F.d(4.0f));
            }
            AppBarLayout appBarLayout2 = this.i;
            if (appBarLayout2 != null) {
                appBarLayout2.setStateListAnimator(null);
            }
            this.k = z;
        }
    }

    public void T(boolean z) {
        if (this.l != z) {
            CoordinatorLayout.LayoutParams layoutParams = d().getLayoutParams();
            kotlin.jvm.internal.m.g(layoutParams, "null cannot be cast to non-null type androidx.coordinatorlayout.widget.CoordinatorLayout.LayoutParams");
            layoutParams.setBehavior(z ? null : new AppBarLayout.ScrollingViewBehavior());
            this.l = z;
        }
    }

    @Override
    public void i() {
        super.i();
        x headerConfig = d().getHeaderConfig();
        if (headerConfig != null) {
            headerConfig.i();
        }
    }

    public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
        kotlin.jvm.internal.m.i(menu, "menu");
        kotlin.jvm.internal.m.i(inflater, "inflater");
        V(menu);
        super.onCreateOptionsMenu(menu, inflater);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup viewGroup, Bundle bundle) {
        View view;
        AppBarLayout appBarLayout;
        kotlin.jvm.internal.m.i(inflater, "inflater");
        Context context = getContext();
        CoordinatorLayout bVar = context != null ? new b(context, this) : null;
        C0471l d = d();
        CoordinatorLayout.LayoutParams layoutParams = new CoordinatorLayout.LayoutParams(-1, -1);
        layoutParams.setBehavior(this.l ? null : new AppBarLayout.ScrollingViewBehavior());
        d.setLayoutParams(layoutParams);
        if (bVar != null) {
            bVar.addView(q.H(d()));
        }
        Context context2 = getContext();
        if (context2 != null) {
            view = new AppBarLayout(context2);
            view.setBackgroundColor(0);
            view.setLayoutParams(new AppBarLayout.d(-1, -2));
        } else {
            view = null;
        }
        this.i = view;
        if (bVar != null) {
            bVar.addView(view);
        }
        if (this.k) {
            AppBarLayout appBarLayout2 = this.i;
            if (appBarLayout2 != null) {
                appBarLayout2.setElevation(0.0f);
            }
            AppBarLayout appBarLayout3 = this.i;
            if (appBarLayout3 != null) {
                appBarLayout3.setStateListAnimator(null);
            }
        }
        Toolbar toolbar = this.j;
        if (toolbar != null && (appBarLayout = this.i) != null) {
            appBarLayout.addView(q.H(toolbar));
        }
        setHasOptionsMenu(true);
        return bVar;
    }

    public void onPrepareOptionsMenu(Menu menu) {
        kotlin.jvm.internal.m.i(menu, "menu");
        V(menu);
        super.onPrepareOptionsMenu(menu);
    }

    public void onStart() {
        View view = this.m;
        if (view != null) {
            view.requestFocus();
        }
        super.onStart();
    }

    public void onStop() {
        if (C1144a.a.a(getContext())) {
            this.m = M();
        }
        super.onStop();
    }

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