导航菜单

页面标题

页面副标题

Releam v2.13.2 - WordActivity.java 源代码

正在查看: Releam v2.13.2 应用的 WordActivity.java JAVA 源代码文件

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


package com.solaflashapps.releam.ui.words.learn;

import a0.h;
import android.R;
import android.animation.ValueAnimator;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.ColorStateList;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.LayerDrawable;
import android.os.Bundle;
import android.transition.Fade;
import android.transition.Transition;
import android.util.Log;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.LinearInterpolator;
import android.widget.FrameLayout;
import android.widget.TextView;
import androidx.appcompat.widget.Toolbar;
import androidx.databinding.e;
import androidx.fragment.app.p0;
import androidx.fragment.app.v;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager.widget.ViewPager;
import c8.c;
import com.google.android.gms.internal.measurement.k3;
import com.google.android.material.bottomsheet.BottomSheetBehavior;
import com.google.android.material.tabs.TabLayout;
import com.solaflashapps.releam.ReleamApplication;
import com.solaflashapps.releam.ui.util.CollapseLinearLayoutManager;
import com.solaflashapps.releam.ui.words.learn.WordActivity;
import d9.i;
import f4.j;
import f4.s;
import f8.b;
import f8.f;
import h8.a;
import h8.d0;
import h8.r;
import h8.z;
import i4.d;
import java.io.Serializable;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import javax.xml.XMLConstants;
import o3.p;
import o7.w;
import org.apache.poi.util.CodePageUtil;
import q9.m;
import r8.o;
import t8.j0;
import t8.r0;
import x8.n;
import x8.q;

public final class WordActivity extends f implements b {

    public static long f4013u0 = -1;

    public static final int f4014v0 = 0;

    public i f4015n0;

    public TabLayout f4016o0;

    public View f4017p0;

    public int f4018q0 = -1;

    public long f4019r0;

    public d0 f4020s0;

    public final ValueAnimator f4021t0;

    public WordActivity() {
        ValueAnimator ofInt = ValueAnimator.ofInt(0, CodePageUtil.CP_MAC_ROMAN);
        ofInt.setDuration(5000L);
        ofInt.setInterpolator(new LinearInterpolator());
        ofInt.setRepeatMode(1);
        ofInt.setRepeatCount(-1);
        ofInt.addUpdateListener(new a(this, 3));
        this.f4021t0 = ofInt;
    }

    @Override
    public final e A() {
        e b10 = androidx.databinding.b.b(getLayoutInflater(), 2131492903, null, false);
        s9.a.m(b10, "inflate(...)");
        return b10;
    }

    public final void E(boolean z10) {
        List<v> F = m().F();
        s9.a.m(F, "getFragments(...)");
        for (v vVar : F) {
            if (vVar instanceof q) {
                q qVar = (q) vVar;
                CollapseLinearLayoutManager collapseLinearLayoutManager = qVar.f10752t1;
                if (collapseLinearLayoutManager == null) {
                    qVar.f10754v1 = z10;
                } else {
                    boolean z11 = !z10;
                    View view = collapseLinearLayoutManager.E;
                    if (z11) {
                        ViewGroup.LayoutParams layoutParams = view.getLayoutParams();
                        s9.a.l(layoutParams, "null cannot be cast to non-null type com.google.android.material.appbar.AppBarLayout.LayoutParams");
                        d dVar = (d) layoutParams;
                        if (dVar.f5961a != 5) {
                            dVar.f5961a = 5;
                            view.setLayoutParams(dVar);
                        }
                    } else {
                        ViewGroup.LayoutParams layoutParams2 = view.getLayoutParams();
                        s9.a.l(layoutParams2, "null cannot be cast to non-null type com.google.android.material.appbar.AppBarLayout.LayoutParams");
                        d dVar2 = (d) layoutParams2;
                        if (dVar2.f5961a != 0) {
                            dVar2.f5961a = 0;
                            view.setLayoutParams(dVar2);
                        }
                    }
                }
            }
        }
    }

    public final void F(boolean z10) {
        List<v> F = m().F();
        s9.a.m(F, "getFragments(...)");
        for (v vVar : F) {
            if (vVar instanceof q) {
                ((q) vVar).f10738e1 = z10;
            }
        }
    }

    public final void G(int i10) {
        r0 r0Var;
        List<v> F = m().F();
        s9.a.m(F, "getFragments(...)");
        for (v vVar : F) {
            if (vVar instanceof q) {
                q qVar = (q) vVar;
                int i11 = 1;
                if (i10 == 1 && (r0Var = qVar.T0) != null) {
                    r0Var.B(new j0(r0Var, i11));
                }
                int i12 = 0;
                if (i10 == 2) {
                    r0 r0Var2 = qVar.T0;
                    if (r0Var2 != null) {
                        r0Var2.B(new j0(r0Var2, i12));
                    }
                } else {
                    qVar.getClass();
                }
                RecyclerView recyclerView = qVar.U0;
                if (recyclerView == null) {
                    s9.a.t0("mWordRecyclerView");
                    throw null;
                }
                recyclerView.b0(0);
            }
        }
    }

    public final void H(q qVar) {
        List<v> F = m().F();
        s9.a.m(F, "getFragments(...)");
        for (v vVar : F) {
            if ((vVar instanceof q) && !s9.a.c(vVar, qVar)) {
                ((q) vVar).n0();
            }
        }
    }

    public final void I(String str, boolean z10) {
        List<v> F = m().F();
        s9.a.m(F, "getFragments(...)");
        for (v vVar : F) {
            if (vVar instanceof q) {
                ((q) vVar).m0(str, z10);
            }
        }
    }

    public final void J(i iVar, boolean z10) {
        this.f4015n0 = iVar;
        w y10 = y();
        i iVar2 = this.f4015n0;
        if (iVar2 == null) {
            s9.a.t0("mSection");
            throw null;
        }
        y10.f7781v.setText(iVar2.f4386q);
        q1.a adapter = y().J.getAdapter();
        s9.a.l(adapter, "null cannot be cast to non-null type com.solaflashapps.releam.ui.words.learn.WordActivity.ViewPagerAdapter");
        ((n) adapter).f10725k = -1;
        q1.a adapter2 = y().J.getAdapter();
        if (adapter2 != null) {
            adapter2.h();
        }
        List F = m().F();
        s9.a.m(F, "getFragments(...)");
        ArrayList arrayList = new ArrayList();
        for (Object obj : F) {
            if (obj instanceof q) {
                arrayList.add(obj);
            }
        }
        Iterator it = arrayList.iterator();
        while (it.hasNext()) {
            d((q) it.next());
        }
        if (z10) {
            ViewGroup.LayoutParams layoutParams = y().f7780u.getLayoutParams();
            s9.a.l(layoutParams, "null cannot be cast to non-null type androidx.coordinatorlayout.widget.CoordinatorLayout.LayoutParams");
            y.b bVar = ((y.e) layoutParams).f10805a;
            s9.a.l(bVar, "null cannot be cast to non-null type com.google.android.material.bottomsheet.BottomSheetBehavior<android.view.View>");
            ((BottomSheetBehavior) bVar).z(4);
        }
        List F2 = m().F();
        s9.a.m(F2, "getFragments(...)");
        ArrayList arrayList2 = new ArrayList();
        for (Object obj2 : F2) {
            if (obj2 instanceof o) {
                arrayList2.add(obj2);
            }
        }
        o oVar = (o) m.H(arrayList2);
        if (oVar != null) {
            oVar.g0();
            i iVar3 = this.f4015n0;
            if (iVar3 == null) {
                s9.a.t0("mSection");
                throw null;
            }
            oVar.l0(iVar3);
        }
        int i10 = l7.b.f6619a;
        int i11 = iVar.f4385i;
        SharedPreferences i12 = l7.b.i();
        s9.a.m(i12, "<get-sharedPreferences>(...)");
        SharedPreferences.Editor edit = i12.edit();
        s9.a.m(edit, "editor");
        edit.putInt("com.releam.AppPreferenceManager.LAST_SELECTED_TOPIC", i11);
        edit.apply();
    }

    public final void K(float f10, x8.a aVar, float f11, float f12, Drawable drawable) {
        y().B.setAlpha(f10);
        aVar.f10701c = ((-f10) * 2.0f) + 1.0f;
        aVar.invalidateSelf();
        y().f7782w.setAlpha(1.0f - f10);
        int C = C(f11 * f10);
        y().f7780u.setBackgroundTintList(ColorStateList.valueOf(C));
        y().G.f7600p.setBackgroundColor(C);
        if (drawable != null) {
            drawable.setTint(C);
        }
        getWindow().setStatusBarColor(C);
        if (this.f4017p0 == null) {
            this.f4017p0 = findViewById(2131297109);
        }
        int C2 = C(f10 * f12);
        View view = this.f4017p0;
        if (view != null) {
            view.setBackgroundColor(C2);
        }
        getWindow().setNavigationBarColor(C2);
    }

    public final void L(int i10, int i11) {
        TabLayout tabLayout = this.f4016o0;
        if (tabLayout == null) {
            s9.a.t0("mTabLayout");
            throw null;
        }
        f5.f e10 = tabLayout.e(i10);
        if (e10 == null) {
            return;
        }
        if (e10.f4687e == null) {
            e10.f4687e = LayoutInflater.from(e10.f4689g.getContext()).inflate(2131493070, (ViewGroup) e10.f4689g, false);
            f5.i iVar = e10.f4689g;
            if (iVar != null) {
                iVar.e();
            }
        }
        View view = e10.f4687e;
        View findViewById = view != null ? view.findViewById(2131297134) : null;
        TextView textView = findViewById instanceof TextView ? (TextView) findViewById : null;
        if (textView != null) {
            textView.setText(String.valueOf(i11));
        }
        TabLayout tabLayout2 = this.f4016o0;
        if (tabLayout2 != null) {
            tabLayout2.requestLayout();
        } else {
            s9.a.t0("mTabLayout");
            throw null;
        }
    }

    @Override
    public final void d(v vVar) {
        s9.a.n(vVar, "fragment");
        if (vVar instanceof x8.m) {
            q qVar = (q) ((x8.m) vVar);
            int i10 = qVar.S0;
            r0 r0Var = qVar.T0;
            List J = r0Var != null ? r0.J(r0Var.v()) : q9.o.f8306i;
            if (i10 == 1) {
                L(2, J.size());
            } else if (i10 == 2) {
                L(0, J.size());
            } else if (i10 == 3) {
                L(1, J.size());
            }
            if (i10 == 3) {
                c8.f b10 = c8.a.b(J);
                boolean z10 = b10 instanceof c8.d;
                ValueAnimator valueAnimator = this.f4021t0;
                if (z10) {
                    FrameLayout frameLayout = y().f7785z;
                    s9.a.m(frameLayout, "flIntervalPractice");
                    frameLayout.setVisibility(8);
                    y().I.setText(XMLConstants.DEFAULT_NS_PREFIX);
                    Drawable background = y().f7785z.getBackground();
                    t8.d dVar = background instanceof t8.d ? (t8.d) background : null;
                    if (dVar != null) {
                        dVar.f9461f = false;
                        dVar.invalidateSelf();
                    }
                    valueAnimator.end();
                } else if (b10 instanceof c8.e) {
                    FrameLayout frameLayout2 = y().f7785z;
                    s9.a.m(frameLayout2, "flIntervalPractice");
                    frameLayout2.setVisibility(0);
                    y().I.setText(((c8.e) b10).f2940a);
                    Drawable background2 = y().f7785z.getBackground();
                    t8.d dVar2 = background2 instanceof t8.d ? (t8.d) background2 : null;
                    if (dVar2 != null) {
                        dVar2.f9461f = true;
                        dVar2.invalidateSelf();
                    }
                    valueAnimator.start();
                } else if (b10 instanceof c) {
                    FrameLayout frameLayout3 = y().f7785z;
                    s9.a.m(frameLayout3, "flIntervalPractice");
                    frameLayout3.setVisibility(0);
                    y().I.setText(((c) b10).f2938a);
                    Drawable background3 = y().f7785z.getBackground();
                    t8.d dVar3 = background3 instanceof t8.d ? (t8.d) background3 : null;
                    if (dVar3 != null) {
                        dVar3.f9461f = false;
                        dVar3.invalidateSelf();
                    }
                    valueAnimator.end();
                } else if (b10 instanceof c8.b) {
                    FrameLayout frameLayout4 = y().f7785z;
                    s9.a.m(frameLayout4, "flIntervalPractice");
                    frameLayout4.setVisibility(0);
                    y().I.setText(((c8.b) b10).f2937a);
                    Drawable background4 = y().f7785z.getBackground();
                    t8.d dVar4 = background4 instanceof t8.d ? (t8.d) background4 : null;
                    if (dVar4 != null) {
                        dVar4.f9461f = false;
                        dVar4.invalidateSelf();
                    }
                    valueAnimator.end();
                }
                ViewGroup.LayoutParams layoutParams = y().f7780u.getLayoutParams();
                s9.a.l(layoutParams, "null cannot be cast to non-null type androidx.coordinatorlayout.widget.CoordinatorLayout.LayoutParams");
                y.b bVar = ((y.e) layoutParams).f10805a;
                s9.a.l(bVar, "null cannot be cast to non-null type com.google.android.material.bottomsheet.BottomSheetBehavior<android.view.View>");
                BottomSheetBehavior bottomSheetBehavior = (BottomSheetBehavior) bVar;
                if (m().C("com.solaflashapps.releam.ui.words.learn.wordListFragment.ADD_OR_EDIT_DIALOG") == null && bottomSheetBehavior.F == 4) {
                    d0 d0Var = this.f4020s0;
                    if (d0Var == null) {
                        s9.a.t0("tutorialPopup");
                        throw null;
                    }
                    View view = y().f1012g;
                    s9.a.m(view, "getRoot(...)");
                    d0Var.g(view, r.f5538u);
                }
            }
        }
    }

    @Override
    public final void onBackPressed() {
        List F = m().F();
        s9.a.m(F, "getFragments(...)");
        List list = F;
        ArrayList arrayList = new ArrayList();
        for (Object obj : list) {
            if (obj instanceof o) {
                arrayList.add(obj);
            }
        }
        o oVar = (o) m.H(arrayList);
        boolean z10 = false;
        boolean a10 = oVar != null ? oVar.a() : false;
        if (!a10) {
            ViewGroup.LayoutParams layoutParams = y().f7780u.getLayoutParams();
            s9.a.l(layoutParams, "null cannot be cast to non-null type androidx.coordinatorlayout.widget.CoordinatorLayout.LayoutParams");
            y.b bVar = ((y.e) layoutParams).f10805a;
            s9.a.l(bVar, "null cannot be cast to non-null type com.google.android.material.bottomsheet.BottomSheetBehavior<android.view.View>");
            BottomSheetBehavior bottomSheetBehavior = (BottomSheetBehavior) bVar;
            if (bottomSheetBehavior.F == 3) {
                ArrayList arrayList2 = new ArrayList();
                for (Object obj2 : list) {
                    if (obj2 instanceof o) {
                        arrayList2.add(obj2);
                    }
                }
                o oVar2 = (o) m.H(arrayList2);
                if ((oVar2 != null ? oVar2.m1 : null) != null) {
                    i iVar = oVar2.m1;
                    i iVar2 = this.f4015n0;
                    if (iVar2 == null) {
                        s9.a.t0("mSection");
                        throw null;
                    }
                    if (s9.a.c(iVar, iVar2)) {
                        bottomSheetBehavior.z(4);
                    } else {
                        oVar2.l0(null);
                    }
                } else if (oVar2 != null) {
                    i iVar3 = this.f4015n0;
                    if (iVar3 == null) {
                        s9.a.t0("mSection");
                        throw null;
                    }
                    oVar2.l0(iVar3);
                }
                a10 = true;
            }
        }
        if (!a10) {
            ArrayList arrayList3 = new ArrayList();
            for (Object obj3 : list) {
                if (obj3 instanceof f8.c) {
                    arrayList3.add(obj3);
                }
            }
            if (!arrayList3.isEmpty()) {
                Iterator it = arrayList3.iterator();
                while (true) {
                    if (it.hasNext()) {
                        if (((f8.c) it.next()).a()) {
                            z10 = true;
                            break;
                        }
                    } else {
                        break;
                    }
                }
            }
            a10 = z10;
        }
        if (a10) {
            return;
        }
        long currentTimeMillis = System.currentTimeMillis();
        long j10 = this.f4019r0;
        long j11 = currentTimeMillis - j10;
        if (j10 == 0 || j11 > 10000) {
            this.f4019r0 = currentTimeMillis;
        } else {
            finish();
        }
    }

    @Override
    public final void onCreate(Bundle bundle) {
        s sVar;
        super.onCreate(bundle);
        a2.f.Q(getWindow());
        this.f4020s0 = new d0(this);
        i iVar = (i) (bundle != null ? bundle.getSerializable("com.solaflashapps.releam.ui.awords.learn.wordListActivity.putSection") : null);
        if (iVar == null) {
            Serializable serializableExtra = getIntent().getSerializableExtra("com.solaflashapps.releam.ui.words.learn.wordListActivity.section_id");
            s9.a.l(serializableExtra, "null cannot be cast to non-null type com.solaflashapps.releam.vo.Section");
            iVar = (i) serializableExtra;
        }
        this.f4015n0 = iVar;
        Toolbar toolbar = y().E.f7654p;
        s9.a.m(toolbar, "toolbarWord");
        toolbar.setTitle(XMLConstants.DEFAULT_NS_PREFIX);
        q(toolbar);
        List F = m().F();
        s9.a.m(F, "getFragments(...)");
        ArrayList arrayList = new ArrayList();
        for (Object obj : F) {
            if (obj instanceof o) {
                arrayList.add(obj);
            }
        }
        final int i10 = 1;
        final int i11 = 0;
        if (((v) m.H(arrayList)) == null) {
            p0 m10 = m();
            m10.getClass();
            androidx.fragment.app.a aVar = new androidx.fragment.app.a(m10);
            aVar.e(2131296506, 1, new o(), "com.solaflashapps.releam.ui.sections.SectionListFragment");
            if (aVar.f1078g) {
                throw new IllegalStateException("This transaction is already being added to the back stack");
            }
            aVar.f1079h = false;
            aVar.f1088q.y(aVar, false);
        }
        Toolbar toolbar2 = y().G.f7600p;
        s9.a.m(toolbar2, "toolbar");
        toolbar2.setTitle(XMLConstants.DEFAULT_NS_PREFIX);
        toolbar2.k(2131558406);
        int i12 = 4;
        toolbar2.post(new androidx.emoji2.text.m(this, toolbar2, bundle, i12));
        y().H.f7631q.k(2131558405);
        y().F.f7568p.k(2131558400);
        y().F.f7568p.setNavigationIcon(2131230978);
        y().f7777q.setOnClickListener(new View.OnClickListener(this) {

            public final WordActivity f10717q;

            {
                this.f10717q = this;
            }

            @Override
            public final void onClick(View view) {
                int i13;
                Object obj2;
                int i14 = i11;
                WordActivity wordActivity = this.f10717q;
                switch (i14) {
                    case 0:
                        int i15 = WordActivity.f4014v0;
                        s9.a.n(wordActivity, "this$0");
                        List F2 = wordActivity.m().F();
                        s9.a.m(F2, "getFragments(...)");
                        ArrayList arrayList2 = new ArrayList();
                        for (Object obj3 : F2) {
                            if (obj3 instanceof r8.o) {
                                arrayList2.add(obj3);
                            }
                        }
                        r8.o oVar = (r8.o) q9.m.H(arrayList2);
                        if (oVar != null) {
                            oVar.h0();
                            break;
                        }
                        break;
                    default:
                        int i16 = WordActivity.f4014v0;
                        s9.a.n(wordActivity, "this$0");
                        List F3 = wordActivity.m().F();
                        s9.a.m(F3, "getFragments(...)");
                        Iterator it = F3.iterator();
                        while (true) {
                            i13 = 0;
                            if (it.hasNext()) {
                                obj2 = it.next();
                                androidx.fragment.app.v vVar = (androidx.fragment.app.v) obj2;
                                if ((vVar instanceof q) && ((q) vVar).S0 == 3) {
                                }
                            } else {
                                obj2 = null;
                            }
                        }
                        q qVar = (q) obj2;
                        if (qVar != null) {
                            List list = c8.a.f2936a;
                            r0 r0Var = qVar.T0;
                            c8.f b10 = c8.a.b(r0Var != null ? r0.J(r0Var.v()) : q9.o.f8306i);
                            if (b10 instanceof c8.e) {
                                qVar.h0(c8.g.f2943q);
                                u3.a.G(m7.a.Y0, null);
                                break;
                            } else if (b10 instanceof c8.c) {
                                h8.g gVar = new h8.g(wordActivity);
                                gVar.c(2131820844);
                                gVar.d(2131820611, new r8.h(13));
                                gVar.f(2131820658, new l(qVar, i13));
                                gVar.f5507u = true;
                                gVar.b();
                                break;
                            }
                        }
                        break;
                }
            }
        });
        ViewGroup.LayoutParams layoutParams = y().f7780u.getLayoutParams();
        s9.a.l(layoutParams, "null cannot be cast to non-null type androidx.coordinatorlayout.widget.CoordinatorLayout.LayoutParams");
        y.b bVar = ((y.e) layoutParams).f10805a;
        s9.a.l(bVar, "null cannot be cast to non-null type com.google.android.material.bottomsheet.BottomSheetBehavior<android.view.View>");
        final BottomSheetBehavior bottomSheetBehavior = (BottomSheetBehavior) bVar;
        Intent intent = getIntent();
        if (intent != null ? intent.getBooleanExtra("com.solaflashapps.releam.ui.words.learn.wordListActivity.EXTRA_START_WITH_TOPICS", false) : false) {
            bottomSheetBehavior.z(3);
        } else {
            bottomSheetBehavior.z(4);
        }
        TextView textView = y().f7781v;
        i iVar2 = this.f4015n0;
        if (iVar2 == null) {
            s9.a.t0("mSection");
            throw null;
        }
        textView.setText(iVar2.f4386q);
        final x8.a aVar2 = new x8.a(this);
        aVar2.setTint(y().f7781v.getCurrentTextColor());
        y().f7781v.setCompoundDrawablesWithIntrinsicBounds((Drawable) null, (Drawable) null, aVar2, (Drawable) null);
        Drawable background = y().f7782w.getBackground();
        s9.a.l(background, "null cannot be cast to non-null type android.graphics.drawable.LayerDrawable");
        Drawable findDrawableByLayerId = ((LayerDrawable) background).findDrawableByLayerId(2131296392);
        s9.a.l(findDrawableByLayerId, "null cannot be cast to non-null type android.graphics.drawable.GradientDrawable");
        int C = C(getResources().getInteger(2131361836) / 100.0f);
        TypedValue typedValue = new TypedValue();
        getTheme().resolveAttribute(2130968819, typedValue, true);
        int i13 = typedValue.data;
        ((GradientDrawable) findDrawableByLayerId).setColors(new int[]{C, i13, i13});
        final float integer = getResources().getInteger(2131361798) / 100.0f;
        final float integer2 = getResources().getInteger(2131361835) / 100.0f;
        Drawable background2 = y().f7782w.getBackground();
        s9.a.l(background2, "null cannot be cast to non-null type android.graphics.drawable.LayerDrawable");
        final Drawable findDrawableByLayerId2 = ((LayerDrawable) background2).findDrawableByLayerId(2131297045);
        x8.o oVar = new x8.o(this, aVar2, integer, integer2, findDrawableByLayerId2);
        ArrayList arrayList2 = bottomSheetBehavior.P;
        if (!arrayList2.contains(oVar)) {
            arrayList2.add(oVar);
        }
        y().f7780u.post(new Runnable() {
            @Override
            public final void run() {
                float f10 = integer;
                float f11 = integer2;
                Drawable drawable = findDrawableByLayerId2;
                int i14 = WordActivity.f4014v0;
                BottomSheetBehavior bottomSheetBehavior2 = BottomSheetBehavior.this;
                s9.a.n(bottomSheetBehavior2, "$bottomSheetBehavior");
                WordActivity wordActivity = this;
                s9.a.n(wordActivity, "this$0");
                a aVar3 = aVar2;
                s9.a.n(aVar3, "$arrowUpAnim");
                wordActivity.K(bottomSheetBehavior2.F == 3 ? 1.0f : 0.0f, aVar3, f10, f11, drawable);
            }
        });
        y().f7783x.setOnClickListener(new z(bottomSheetBehavior, 10));
        final ViewPager viewPager = y().J;
        s9.a.m(viewPager, "viewPager");
        int i14 = 2;
        viewPager.setOffscreenPageLimit(2);
        p0 m11 = m();
        s9.a.m(m11, "getSupportFragmentManager(...)");
        viewPager.setAdapter(new n(this, m11));
        TabLayout tabLayout = y().C;
        s9.a.m(tabLayout, "tabLayout");
        this.f4016o0 = tabLayout;
        tabLayout.setupWithViewPager(viewPager);
        Toolbar toolbar3 = y().D.f7631q;
        s9.a.m(toolbar3, "searchToolbar");
        toolbar3.k(2131558405);
        Fade fade = new Fade();
        fade.excludeTarget(R.id.statusBarBackground, true);
        fade.excludeTarget(2131296364, true);
        getWindow().setEnterTransition(fade);
        getWindow().setExitTransition(fade);
        if (bundle != null) {
            this.f4018q0 = bundle.getInt("com.solaflashapps.releam.ui.words.learn.wordListActivity.mSharedElementsMapHandlerId");
        }
        y().f7778r.setTransitionName("com.solaflashapps.releam.ui.words.learn.APP_BAR_TRANSITION_NAME");
        Transition exitTransition = getWindow().getExitTransition();
        if (exitTransition != null) {
            exitTransition.excludeTarget(R.id.statusBarBackground, true);
            exitTransition.excludeTarget(R.id.navigationBarBackground, true);
        }
        Transition reenterTransition = getWindow().getReenterTransition();
        if (reenterTransition != null) {
            reenterTransition.excludeTarget(R.id.statusBarBackground, true);
            reenterTransition.excludeTarget(R.id.navigationBarBackground, true);
        }
        setExitSharedElementCallback(new h(this, i14));
        View view = y().f1012g;
        s9.a.m(view, "getRoot(...)");
        d7.f.p(view, new e1.a(bottomSheetBehavior, this, i12));
        if (((Boolean) e8.a.f4584c.a()).booleanValue() && !e8.a.f4585d) {
            WeakReference weakReference = new WeakReference(this);
            e8.a.f4585d = true;
            SharedPreferences i15 = l7.b.i();
            s9.a.m(i15, "<get-sharedPreferences>(...)");
            SharedPreferences.Editor edit = i15.edit();
            s9.a.m(edit, "editor");
            edit.putInt("com.releam.AppPreferenceManager.APP_LAUNCHES_SINCE_REVIEW_REQUEST", 0);
            edit.apply();
            String format = e8.a.f4582a.format(new Date());
            s9.a.m(format, "format(...)");
            SharedPreferences i16 = l7.b.i();
            s9.a.m(i16, "<get-sharedPreferences>(...)");
            SharedPreferences.Editor edit2 = i16.edit();
            s9.a.m(edit2, "editor");
            edit2.putString("com.releam.AppPreferenceManager.LAST_REVIEW_REQUEST_DATE", format);
            edit2.apply();
            float f10 = ReleamApplication.f3896i;
            Context f11 = e7.c.f();
            Context applicationContext = f11.getApplicationContext();
            if (applicationContext != null) {
                f11 = applicationContext;
            }
            a2.c cVar = new a2.c(new k5.f(f11));
            k5.f fVar = (k5.f) cVar.f80i;
            p pVar = k5.f.f6287c;
            pVar.a("requestInAppReview (%s)", fVar.f6289b);
            int i17 = 6;
            if (fVar.f6288a == null) {
                Object[] objArr = new Object[0];
                if (Log.isLoggable("PlayCore", 6)) {
                    Log.e("PlayCore", p.b(pVar.f7316b, "Play Store app is either not installed or not the official version", objArr));
                }
                k5.a aVar3 = new k5.a();
                sVar = new s();
                sVar.g(aVar3);
            } else {
                j jVar = new j();
                l5.j jVar2 = fVar.f6288a;
                l5.h hVar = new l5.h(fVar, jVar, jVar, i14);
                synchronized (jVar2.f6581f) {
                    jVar2.f6580e.add(jVar);
                    jVar.f4656a.f(new k3(jVar2, jVar, 9));
                }
                synchronized (jVar2.f6581f) {
                    if (jVar2.f6586k.getAndIncrement() > 0) {
                        p pVar2 = jVar2.f6577b;
                        Object[] objArr2 = new Object[0];
                        pVar2.getClass();
                        if (Log.isLoggable("PlayCore", 3)) {
                            Log.d("PlayCore", p.b(pVar2.f7316b, "Already connected to the service.", objArr2));
                        }
                    }
                }
                jVar2.a().post(new l5.h(jVar2, jVar, hVar, i11));
                sVar = jVar.f4656a;
            }
            sVar.f(new b3.i(weakReference, cVar, i17));
        }
        y().f7776p.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view2) {
                int i18 = i11;
                ViewPager viewPager2 = viewPager;
                switch (i18) {
                    case 0:
                        int i19 = WordActivity.f4014v0;
                        s9.a.n(viewPager2, "$viewPager");
                        q1.a adapter = viewPager2.getAdapter();
                        s9.a.l(adapter, "null cannot be cast to non-null type com.solaflashapps.releam.ui.words.learn.WordActivity.ViewPagerAdapter");
                        q qVar = ((n) adapter).f10724j;
                        if (qVar != null) {
                            d9.i iVar3 = qVar.R0;
                            if (iVar3 == null) {
                                s9.a.t0("mSection");
                                throw null;
                            }
                            Bundle bundle2 = new Bundle();
                            bundle2.putSerializable("com.solaflashapps.releam.ui.words.editWordsFragment.words", null);
                            bundle2.putSerializable("com.solaflashapps.releam.ui.words.editWordsFragment.section", iVar3);
                            u8.f fVar2 = new u8.f();
                            fVar2.a0(bundle2);
                            fVar2.d0(0, qVar);
                            fVar2.j0(qVar.U().m(), "com.solaflashapps.releam.ui.words.learn.wordListFragment.ADD_OR_EDIT_DIALOG");
                            return;
                        }
                        return;
                    default:
                        int i20 = WordActivity.f4014v0;
                        s9.a.n(viewPager2, "$viewPager");
                        q1.a adapter2 = viewPager2.getAdapter();
                        s9.a.l(adapter2, "null cannot be cast to non-null type com.solaflashapps.releam.ui.words.learn.WordActivity.ViewPagerAdapter");
                        q qVar2 = ((n) adapter2).f10724j;
                        if (qVar2 != null) {
                            qVar2.h0(c8.g.f2942i);
                            return;
                        }
                        return;
                }
            }
        });
        y().A.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view2) {
                int i18 = i10;
                ViewPager viewPager2 = viewPager;
                switch (i18) {
                    case 0:
                        int i19 = WordActivity.f4014v0;
                        s9.a.n(viewPager2, "$viewPager");
                        q1.a adapter = viewPager2.getAdapter();
                        s9.a.l(adapter, "null cannot be cast to non-null type com.solaflashapps.releam.ui.words.learn.WordActivity.ViewPagerAdapter");
                        q qVar = ((n) adapter).f10724j;
                        if (qVar != null) {
                            d9.i iVar3 = qVar.R0;
                            if (iVar3 == null) {
                                s9.a.t0("mSection");
                                throw null;
                            }
                            Bundle bundle2 = new Bundle();
                            bundle2.putSerializable("com.solaflashapps.releam.ui.words.editWordsFragment.words", null);
                            bundle2.putSerializable("com.solaflashapps.releam.ui.words.editWordsFragment.section", iVar3);
                            u8.f fVar2 = new u8.f();
                            fVar2.a0(bundle2);
                            fVar2.d0(0, qVar);
                            fVar2.j0(qVar.U().m(), "com.solaflashapps.releam.ui.words.learn.wordListFragment.ADD_OR_EDIT_DIALOG");
                            return;
                        }
                        return;
                    default:
                        int i20 = WordActivity.f4014v0;
                        s9.a.n(viewPager2, "$viewPager");
                        q1.a adapter2 = viewPager2.getAdapter();
                        s9.a.l(adapter2, "null cannot be cast to non-null type com.solaflashapps.releam.ui.words.learn.WordActivity.ViewPagerAdapter");
                        q qVar2 = ((n) adapter2).f10724j;
                        if (qVar2 != null) {
                            qVar2.h0(c8.g.f2942i);
                            return;
                        }
                        return;
                }
            }
        });
        FrameLayout frameLayout = y().f7785z;
        Object obj2 = a0.i.f12a;
        frameLayout.setBackground(new t8.d(b0.d.a(this, 2131099874), b0.d.a(this, 2131099873), b0.d.a(this, 2131099879)));
        y().f7785z.setOnClickListener(new View.OnClickListener(this) {

            public final WordActivity f10717q;

            {
                this.f10717q = this;
            }

            @Override
            public final void onClick(View view2) {
                int i132;
                Object obj22;
                int i142 = i10;
                WordActivity wordActivity = this.f10717q;
                switch (i142) {
                    case 0:
                        int i152 = WordActivity.f4014v0;
                        s9.a.n(wordActivity, "this$0");
                        List F2 = wordActivity.m().F();
                        s9.a.m(F2, "getFragments(...)");
                        ArrayList arrayList22 = new ArrayList();
                        for (Object obj3 : F2) {
                            if (obj3 instanceof r8.o) {
                                arrayList22.add(obj3);
                            }
                        }
                        r8.o oVar2 = (r8.o) q9.m.H(arrayList22);
                        if (oVar2 != null) {
                            oVar2.h0();
                            break;
                        }
                        break;
                    default:
                        int i162 = WordActivity.f4014v0;
                        s9.a.n(wordActivity, "this$0");
                        List F3 = wordActivity.m().F();
                        s9.a.m(F3, "getFragments(...)");
                        Iterator it = F3.iterator();
                        while (true) {
                            i132 = 0;
                            if (it.hasNext()) {
                                obj22 = it.next();
                                androidx.fragment.app.v vVar = (androidx.fragment.app.v) obj22;
                                if ((vVar instanceof q) && ((q) vVar).S0 == 3) {
                                }
                            } else {
                                obj22 = null;
                            }
                        }
                        q qVar = (q) obj22;
                        if (qVar != null) {
                            List list = c8.a.f2936a;
                            r0 r0Var = qVar.T0;
                            c8.f b10 = c8.a.b(r0Var != null ? r0.J(r0Var.v()) : q9.o.f8306i);
                            if (b10 instanceof c8.e) {
                                qVar.h0(c8.g.f2943q);
                                u3.a.G(m7.a.Y0, null);
                                break;
                            } else if (b10 instanceof c8.c) {
                                h8.g gVar = new h8.g(wordActivity);
                                gVar.c(2131820844);
                                gVar.d(2131820611, new r8.h(13));
                                gVar.f(2131820658, new l(qVar, i132));
                                gVar.f5507u = true;
                                gVar.b();
                                break;
                            }
                        }
                        break;
                }
            }
        });
        int i18 = l7.b.f6619a;
        i iVar3 = this.f4015n0;
        if (iVar3 == null) {
            s9.a.t0("mSection");
            throw null;
        }
        int i19 = iVar3.f4385i;
        SharedPreferences i20 = l7.b.i();
        s9.a.m(i20, "<get-sharedPreferences>(...)");
        SharedPreferences.Editor edit3 = i20.edit();
        s9.a.m(edit3, "editor");
        edit3.putInt("com.releam.AppPreferenceManager.LAST_SELECTED_TOPIC", i19);
        edit3.apply();
    }

    @Override
    public final void onDestroy() {
        super.onDestroy();
        ValueAnimator valueAnimator = this.f4021t0;
        valueAnimator.removeAllUpdateListeners();
        valueAnimator.removeAllListeners();
        valueAnimator.cancel();
    }

    @Override
    public final void onNewIntent(Intent intent) {
        s9.a.n(intent, "intent");
        super.onNewIntent(intent);
        Serializable serializableExtra = intent.getSerializableExtra("com.solaflashapps.releam.ui.words.learn.wordListActivity.section_id");
        s9.a.l(serializableExtra, "null cannot be cast to non-null type com.solaflashapps.releam.vo.Section");
        J((i) serializableExtra, false);
        boolean booleanExtra = intent.getBooleanExtra("com.solaflashapps.releam.ui.words.learn.wordListActivity.EXTRA_START_WITH_TOPICS", false);
        ViewGroup.LayoutParams layoutParams = y().f7780u.getLayoutParams();
        s9.a.l(layoutParams, "null cannot be cast to non-null type androidx.coordinatorlayout.widget.CoordinatorLayout.LayoutParams");
        y.b bVar = ((y.e) layoutParams).f10805a;
        s9.a.l(bVar, "null cannot be cast to non-null type com.google.android.material.bottomsheet.BottomSheetBehavior<android.view.View>");
        BottomSheetBehavior bottomSheetBehavior = (BottomSheetBehavior) bVar;
        if (booleanExtra) {
            bottomSheetBehavior.z(3);
        } else {
            bottomSheetBehavior.z(4);
        }
    }

    @Override
    public final void onSaveInstanceState(Bundle bundle) {
        s9.a.n(bundle, "outState");
        i iVar = this.f4015n0;
        if (iVar == null) {
            s9.a.t0("mSection");
            throw null;
        }
        bundle.putSerializable("com.solaflashapps.releam.ui.awords.learn.wordListActivity.putSection", iVar);
        bundle.putInt("com.solaflashapps.releam.ui.words.learn.wordListActivity.mSharedElementsMapHandlerId", this.f4018q0);
        super.onSaveInstanceState(bundle);
    }

    @Override
    public final void onStop() {
        super.onStop();
        this.f4019r0 = 0L;
    }
}