导航菜单

页面标题

页面副标题

MX Player v1.97.8 - ActivityScreen.java 源代码

正在查看: MX Player v1.97.8 应用的 ActivityScreen.java JAVA 源代码文件

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


package com.mxtech.videoplayer;

import android.R;
import android.animation.ValueAnimator;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.AppOpsManager;
import android.app.Dialog;
import android.app.PendingIntent;
import android.app.PictureInPictureParams;
import android.content.BroadcastReceiver;
import android.content.ClipData;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.content.res.TypedArray;
import android.database.DataSetObserver;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteException;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.Point;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.Icon;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.os.Message;
import android.os.Parcelable;
import android.os.SystemClock;
import android.text.Html;
import android.text.Layout;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.text.format.DateUtils;
import android.text.style.ImageSpan;
import android.text.style.RelativeSizeSpan;
import android.util.AttributeSet;
import android.util.Log;
import android.util.Rational;
import android.view.Display;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.OrientationEventListener;
import android.view.SubMenu;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.view.ViewStub;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.LinearInterpolator;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.PopupWindow;
import android.widget.RelativeLayout;
import android.widget.SeekBar;
import android.widget.TableLayout;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.ZoomButton;
import androidx.annotation.NonNull;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AlertController;
import androidx.appcompat.app.d;
import androidx.appcompat.widget.AppCompatTextView;
import androidx.appcompat.widget.Toolbar;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.content.FileProvider;
import androidx.core.widget.ContentLoadingProgressBar;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.ddx.axx.axx.axx.BH;
import com.google.android.gms.analytics.Tracker;
import com.google.android.gms.cast.framework.CastButtonFactory;
import com.google.android.gms.cast.framework.CastContext;
import com.google.android.gms.cast.framework.CastSession;
import com.microsoft.identity.common.java.AuthenticationConstants;
import com.microsoft.identity.common.java.WarningType;
import com.microsoft.identity.common.java.telemetry.TelemetryEventStrings;
import com.mxtech.SkinViewInflater;
import com.mxtech.app.Apps;
import com.mxtech.bean.TranslateInfo;
import com.mxtech.cast.CastActivity;
import com.mxtech.io.Files;
import com.mxtech.media.FFPlayer;
import com.mxtech.media.MediaExtensions;
import com.mxtech.media.directory.MediaFile;
import com.mxtech.music.view.SwitchToNewPlayerView;
import com.mxtech.privatefolder.setup.PrivateVerifyActivity;
import com.mxtech.subtitle.SubStationAlphaMedia;
import com.mxtech.subtitle.service.f;
import com.mxtech.subtitle.service.f.e;
import com.mxtech.subtitle.service.f.h;
import com.mxtech.videoplayer.L;
import com.mxtech.videoplayer.ad.ActivityPipScreen;
import com.mxtech.videoplayer.bottompromotion.BottomPromotionControllerLayout;
import com.mxtech.videoplayer.bottompromotion.view.BottomBasePromotionView;
import com.mxtech.videoplayer.e;
import com.mxtech.videoplayer.m;
import com.mxtech.videoplayer.menu.EnhanceEffectView;
import com.mxtech.videoplayer.menu.EnhanceMenuActionProvider;
import com.mxtech.videoplayer.menu.MoreMenuActionProvider;
import com.mxtech.videoplayer.menu.widget.BookmarkSeekBar;
import com.mxtech.videoplayer.n;
import com.mxtech.videoplayer.o;
import com.mxtech.videoplayer.preference.ActivityPreferences;
import com.mxtech.videoplayer.preference.b;
import com.mxtech.videoplayer.service.PlayService;
import com.mxtech.videoplayer.subtitle.SubView;
import com.mxtech.videoplayer.subtitle.SubtitleOverlay;
import com.mxtech.videoplayer.subtitle.SubtitlePanel;
import com.mxtech.videoplayer.widget.BatteryClockActionView;
import com.mxtech.videoplayer.widget.BrightnessBar;
import com.mxtech.videoplayer.widget.ContentLoadingTextView;
import com.mxtech.videoplayer.widget.PlaybackController;
import com.mxtech.videoplayer.widget.ScreenToolbar;
import com.mxtech.videoplayer.widget.ScreenVerticalBar;
import com.mxtech.videoplayer.widget.SoundBar;
import com.mxtech.videoplayer.widget.TapSeekLayout;
import com.mxtech.widget.StrokeView;
import cpa.c;
import cpa.d;
import defpackage.a7d;
import defpackage.ah;
import defpackage.akg;
import defpackage.am8;
import defpackage.aud;
import defpackage.b3b;
import defpackage.b3d;
import defpackage.bn4;
import defpackage.bpa;
import defpackage.c78;
import defpackage.ce4;
import defpackage.ceh;
import defpackage.ch;
import defpackage.cmh;
import defpackage.cpa;
import defpackage.d0c;
import defpackage.d1j;
import defpackage.d89;
import defpackage.da2;
import defpackage.e5b;
import defpackage.ea2;
import defpackage.ed;
import defpackage.eh;
import defpackage.f7f;
import defpackage.fab;
import defpackage.fh;
import defpackage.fh8;
import defpackage.ga2;
import defpackage.gfh;
import defpackage.gh;
import defpackage.gh8;
import defpackage.gl0;
import defpackage.gr6;
import defpackage.h7f;
import defpackage.hh;
import defpackage.ho4;
import defpackage.ifd;
import defpackage.j1b;
import defpackage.jh;
import defpackage.jn5;
import defpackage.jnc;
import defpackage.juh;
import defpackage.kkb;
import defpackage.ku5;
import defpackage.leb;
import defpackage.mdg;
import defpackage.mfg;
import defpackage.mh8;
import defpackage.mu8;
import defpackage.nqd;
import defpackage.o0i;
import defpackage.oc8;
import defpackage.opd;
import defpackage.oug;
import defpackage.ov0;
import defpackage.pg3;
import defpackage.pl0;
import defpackage.q7h;
import defpackage.qod;
import defpackage.rae;
import defpackage.rg;
import defpackage.rh0;
import defpackage.rod;
import defpackage.s0b;
import defpackage.sh;
import defpackage.sod;
import defpackage.tj5;
import defpackage.tjg;
import defpackage.tl8;
import defpackage.tya;
import defpackage.u76;
import defpackage.uh;
import defpackage.vb;
import defpackage.vih;
import defpackage.vj8;
import defpackage.w0;
import defpackage.w82;
import defpackage.wb;
import defpackage.wbe;
import defpackage.weh;
import defpackage.wfc;
import defpackage.wg;
import defpackage.x0;
import defpackage.x24;
import defpackage.xb;
import defpackage.xk4;
import defpackage.xwh;
import defpackage.y82;
import defpackage.yg;
import defpackage.yki;
import defpackage.z4i;
import defpackage.z6h;
import defpackage.zg;
import defpackage.zm3;
import java.io.File;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.InetAddress;
import java.net.URLDecoder;
import java.nio.charset.UnsupportedCharsetException;
import java.text.DateFormat;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import java.util.Locale;
import java.util.Map;
import kotlin.jvm.JvmClassMappingKt;
import kotlin.text.StringsKt;
import org.greenrobot.eventbus.ThreadMode;

@TargetApi(14)
public class ActivityScreen extends com.mxtech.videoplayer.e implements SubView.a, mh8, SurfaceHolder.Callback, View.OnTouchListener, SeekBar.OnSeekBarChangeListener, PlaybackController.b, PlayService.f, b.a, n.c, ActionBar.a, Handler.Callback, bn4.a, b3d.a, o.a, f.c, a, View.OnSystemUiVisibilityChangeListener, w4g, da2, uih, vj8, m.c, BookmarkSeekBar.a {
    public static final String p4 = DateUtils.formatElapsedTime(L.w, 0);
    public static final RelativeSizeSpan q4 = new RelativeSizeSpan(0.65f);
    public static final int[] r4 = {2};
    public static HashMap s4;
    public static HashMap t4;
    public static final IntentFilter u4;
    public static final IntentFilter v4;
    public ntf A0;
    public MenuItem A1;
    public ImageView A2;
    public boolean A3;
    public ntf B0;
    public boolean B1;
    public MenuItem B2;
    public v B3;
    public ntf C0;
    public String C1;
    public BatteryClockActionView C2;
    public boolean C3;
    public ntf D0;
    public z1j D1;
    public boolean D2;
    public int D3;
    public ntf E0;
    public bpb E1;
    public boolean E2;
    public int E3;
    public View F0;
    public int F1;
    public int F2;
    public SoundBar F3;
    public View G0;
    public int G1;
    public byte G2;
    public BrightnessBar G3;
    public ImageView H0;
    public int H1;
    public int H2;
    public Toast H3;
    public TextView I0;
    public boolean I1;
    public int I2;
    public int I3;
    public SurfaceView J0;
    public ArrayList<l91> J2;
    public int J3;
    public byte K0;
    public int K1;
    public CastContext K2;
    public int K3;
    public SurfaceHolder L0;
    public Animation L1;
    public zg L2;
    public int L3;
    public SubtitleOverlay M0;
    public final h M2;
    public int M3;
    public SubtitlePanel N0;
    public int N1;
    public final e0 N2;
    public int N3;
    public com.mxtech.subtitle.service.f O0;
    public int O1;
    public final i O2;
    public long O3;
    public BookmarkSeekBar P0;
    public Uri P1;
    public final j P2;
    public ScreenVerticalBar P3;
    public LayoutInflater Q;
    public SubView Q0;
    public int Q1;
    public boolean Q2;
    public double Q3;
    public xjg R0;
    public boolean R1;
    public DateFormat R2;
    public int R3;
    public TopLayout S;
    public vih S0;
    public boolean S1;
    public boolean S2;
    public int S3;
    public UILayout T;
    public ContentLoadingProgressBar T0;
    public boolean T1;
    public boolean T2;
    public int T3;
    public View U;
    public ContentLoadingTextView U0;
    public boolean U1;
    public final k U2;
    public int U3;
    public com.mxtech.videoplayer.n V;
    public cpa V0;
    public boolean V1;
    public n V2;
    public final int[] V3;
    public Tracker W;
    public int W0;
    public boolean W1;
    public boolean W2;
    public final int[] W3;
    public int X;
    public int X0;
    public boolean X1;
    public a X2;
    public boolean X3;
    public boolean Y;
    public boolean Y0;
    public int Y1;
    public fab Y2;
    public int Y3;
    public boolean Z;
    public boolean Z0;
    public boolean Z2;
    public float Z3;
    public boolean a0;
    public boolean a1;
    public int a2;
    public eo0<Uri, f.b> a3;
    public float a4;
    public int b0;
    public boolean b1;
    public int b2;
    public int b3;
    public Drawable b4;
    public float c0;
    public SwitchToNewPlayerView c1;
    public int c3;
    public Drawable c4;
    public boolean d0;
    public View d1;
    public Toast d3;
    public Drawable d4;
    public boolean e0;
    public BottomPromotionControllerLayout e1;
    public long e3;
    public boolean e4;
    public boolean f0;
    public q f1;
    public nqd f2;
    public bz9 f3;
    public final b f4;
    public boolean g0;
    public TextView g1;
    public oug g2;
    public bz9 g3;
    public File g4;
    public int h0;
    public View h1;
    public int h2;
    public bz9 h3;
    public boolean h4;
    public boolean i0;
    public View i1;
    public klh i2;
    public bz9 i3;
    public boolean i4;
    public String j0;
    public ZoomButton j1;
    public Uri[] j2;
    public bz9 j3;
    public long j4;
    public RelativeLayout k0;
    public ZoomButton k1;
    public Uri k2;
    public bz9 k3;
    public long k4;
    public PlaybackController l0;
    public TextView l1;
    public dia l2;
    public bz9 l3;
    public aud l4;
    public RecyclerView m0;
    public TextView m1;
    public a0 m2;
    public bz9 m3;
    public final f7f m4;
    public ArrayList n0;
    public TextView n1;
    public boolean n2;
    public int n3;
    public TapSeekLayout n4;
    public qtf o0;
    public TextView o1;
    public boolean o2;
    public int o3;
    public View o4;
    public ImageButton p1;
    public Object p2;
    public int p3;
    public ntf q0;
    public ZoomButton q1;
    public d q2;
    public int q3;
    public ntf r0;
    public ZoomButton r1;
    public boolean r2;
    public int r3;
    public ntf s0;
    public ZoomButton s1;
    public boolean s3;
    public ntf t0;
    public ImageButton t1;
    public fob t2;
    public ImageView t3;
    public ntf u0;
    public MenuItem u1;
    public MenuItem u2;
    public Bitmap u3;
    public ntf v0;
    public MenuItem v1;
    public int v3;
    public ntf w0;
    public MenuItem w1;
    public vpd w2;
    public int w3;
    public ntf x0;
    public MenuItem x1;
    public double x2;
    public boolean x3;
    public ntf y0;
    public MenuItem y1;
    public View y2;
    public boolean y3;
    public ntf z0;
    public MenuItem z1;
    public TextView z2;
    public boolean z3;
    public final Handler O = new Handler(this);
    public final c78 P = new c78();
    public int R = 0;
    public boolean p0 = true;
    public String J1 = p4;
    public int M1 = -1;
    public Handler Z1 = null;
    public boolean c2 = false;
    public boolean d2 = false;
    public final ArrayList<df8> e2 = new ArrayList<>();
    public boolean s2 = true;
    public boolean v2 = false;

    public static class TopLayout extends RelativeLayout implements Runnable {
        public ActivityScreen b;

        public TopLayout(Context context) {
            super(context);
        }

        @Override
        public final void onSizeChanged(int i, int i2, int i3, int i4) {
            super.onSizeChanged(i, i2, i3, i4);
            if (this.b != null) {
                post(this);
            }
        }

        @Override
        public final void run() {
            throw new UnsupportedOperationException("Method not decompiled: com.mxtech.videoplayer.ActivityScreen.TopLayout.run():void");
        }

        public TopLayout(Context context, AttributeSet attributeSet) {
            super(context, attributeSet);
        }

        public TopLayout(Context context, AttributeSet attributeSet, int i) {
            super(context, attributeSet, i);
        }
    }

    public static class UILayout extends RelativeLayout {
        public PlaybackController b;
        public ActivityScreen c;

        public UILayout(Context context) {
            super(context);
        }

        @Override
        public final boolean dispatchTouchEvent(MotionEvent motionEvent) {
            int action = motionEvent.getAction();
            if (action == 0) {
                this.b.d();
            } else if (action == 1 || action == 3) {
                this.b.h();
            }
            return super.dispatchTouchEvent(motionEvent);
        }

        @Override
        public final void onSizeChanged(int i, int i2, int i3, int i4) {
            super.onSizeChanged(i, i2, i3, i4);
            ActivityScreen activityScreen = this.c;
            if (activityScreen != null) {
                String str = ActivityScreen.p4;
                activityScreen.getClass();
            }
        }

        public void setController(PlaybackController playbackController) {
            this.b = playbackController;
        }

        public UILayout(Context context, AttributeSet attributeSet) {
            super(context, attributeSet);
        }

        public UILayout(Context context, AttributeSet attributeSet, int i) {
            super(context, attributeSet, i);
        }
    }

    public class a extends OrientationEventListener {
        public a(ActivityScreen activityScreen) {
            super(activityScreen);
        }

        @Override
        public final void onOrientationChanged(int i) {
            String str = ActivityScreen.p4;
            ActivityScreen.this.Cb();
        }
    }

    public class a0 extends BroadcastReceiver {
        public a0() {
        }

        @Override
        public final void onReceive(Context context, Intent intent) {
            ArrayList arrayList = (ArrayList) intent.getSerializableExtra("playNext");
            ActivityScreen activityScreen = ActivityScreen.this;
            if (activityScreen.V != null) {
                Iterator it = arrayList.iterator();
                while (it.hasNext()) {
                    MediaFile mediaFile = (MediaFile) it.next();
                    com.mxtech.videoplayer.n nVar = activityScreen.V;
                    Uri k = mediaFile.k();
                    wfc wfcVar = nVar.m;
                    if (wfcVar != null) {
                        Uri uri = nVar.o;
                        wfcVar.k++;
                        LinkedList<Uri> linkedList = wfcVar.e;
                        linkedList.add(linkedList.indexOf(uri) + 1, k);
                    }
                }
            }
        }
    }

    public class b implements Runnable {
        public b() {
        }

        @Override
        public final void run() {
            int i = s6d.Z;
            ActivityScreen activityScreen = ActivityScreen.this;
            if (i == 1) {
                int i2 = activityScreen.I3;
                if (activityScreen.V8(activityScreen.J3)) {
                    activityScreen.O3();
                    return;
                } else {
                    activityScreen.V.Q0(true);
                    return;
                }
            }
            if (i == 2) {
                if (activityScreen.M8()) {
                    activityScreen.w8(2);
                    return;
                } else {
                    activityScreen.O3();
                    return;
                }
            }
            if (i != 3) {
                if (activityScreen.M8()) {
                    activityScreen.V.Q0(true);
                    return;
                } else {
                    activityScreen.O3();
                    return;
                }
            }
            int i3 = activityScreen.I3;
            if (activityScreen.V8(activityScreen.J3)) {
                activityScreen.O3();
                return;
            }
            com.mxtech.videoplayer.n nVar = activityScreen.V;
            if (nVar.f0) {
                nVar.p0(0);
            } else {
                nVar.O0();
                activityScreen.w8(2);
            }
        }
    }

    public class b0 implements View.OnClickListener, View.OnLongClickListener {
        public b0() {
        }

        @Override
        public final void onClick(View view) {
            ActivityScreen.this.V.Q0(false);
        }

        @Override
        public final boolean onLongClick(View view) {
            ActivityScreen activityScreen = ActivityScreen.this;
            if (activityScreen.V.f0) {
                return false;
            }
            activityScreen.z3 = true;
            activityScreen.Db(false);
            activityScreen.V.O0();
            return true;
        }
    }

    public class c implements PopupWindow.OnDismissListener {
        public c() {
        }

        @Override
        public final void onDismiss() {
            PlaybackController playbackController = ActivityScreen.this.l0;
            if (playbackController != null) {
                playbackController.h();
            }
        }
    }

    public class c0 implements View.OnClickListener {
        public c0() {
        }

        @Override
        public final void onClick(View view) {
            ActivityScreen activityScreen = ActivityScreen.this;
            activityScreen.ab();
            Uri D6 = ActivityScreen.D6(activityScreen);
            activityScreen.B9(D6);
            activityScreen.k2 = D6;
            if (D6 != null) {
                nqd nqdVar = new nqd();
                activityScreen.f2 = nqdVar;
                nqdVar.h = true;
                nqdVar.i = true;
            }
        }
    }

    public class d extends BroadcastReceiver {
        public d() {
        }

        @Override
        public final void onReceive(Context context, Intent intent) {
            if (intent == null || !"media_control".equals(intent.getAction())) {
                return;
            }
            boolean z = tya.o.b.getBoolean("custom_pip_control", true);
            int intExtra = intent.getIntExtra("control_type", 0);
            ActivityScreen activityScreen = ActivityScreen.this;
            if (intExtra == 1 || intExtra == 2) {
                activityScreen.V.Q0(false);
            } else if (intExtra != 3) {
                if (intExtra == 4) {
                    if (z) {
                        String str = ActivityScreen.p4;
                        activityScreen.w9();
                    } else {
                        activityScreen.V.z0(activityScreen.V.L() + 10000, 6000);
                    }
                }
            } else if (z) {
                ActivityScreen.D6(activityScreen);
            } else {
                activityScreen.V.z0(activityScreen.V.L() - 10000, 6000);
            }
            String str2 = ActivityScreen.p4;
            activityScreen.qb();
        }
    }

    @SuppressLint({WarningType.NewApi})
    public final class d0 implements DialogInterface.OnClickListener, DialogInterface.OnDismissListener, DialogInterface.OnShowListener, CompoundButton.OnCheckedChangeListener {
        public final View b;
        public final CheckBox c;
        public int d;

        @SuppressLint({"InflateParams"})
        public d0() {
            if (ActivityScreen.this.isFinishing()) {
                return;
            }
            d.a aVar = new d.a(ActivityScreen.this);
            String str = ActivityScreen.p4;
            String trim = ActivityScreen.this.getTitle().toString().trim();
            AlertController.b bVar = aVar.b;
            bVar.d = trim;
            aVar.g(2131889935, this);
            aVar.d(2131890472, this);
            bVar.m = true;
            androidx.appcompat.app.d a = aVar.a();
            View inflate = a.getLayoutInflater().inflate(2131558595, (ViewGroup) null);
            View findViewById = inflate.findViewById(2131363837);
            this.b = findViewById;
            CheckBox checkBox = (CheckBox) inflate.findViewById(2131367433);
            this.c = checkBox;
            checkBox.setOnCheckedChangeListener(this);
            TextView textView = (TextView) findViewById;
            StringBuilder sb = L.w;
            sb.setLength(0);
            try {
                L.u(tya.w().getString(2131888208), sb);
            } catch (IOException unused) {
            }
            textView.setText(sb.toString());
            a.g(inflate);
            a.setOnShowListener(this);
            try {
                if (y82.f()) {
                    return;
                }
                ActivityScreen.this.c4(a, this);
                ActivityScreen.this.I2++;
            } catch (WindowManager.BadTokenException e) {
                Log.e("MX.Screen", "", e);
                ActivityScreen.this.p.k(a);
            }
        }

        @Override
        public final void onCheckedChanged(CompoundButton compoundButton, boolean z) {
            this.b.setVisibility(z ? 0 : 8);
        }

        @Override
        public final void onClick(DialogInterface dialogInterface, int i) {
            this.d = i;
        }

        @Override
        public final void onDismiss(DialogInterface dialogInterface) {
            zjb zjbVar;
            ?? r0 = ActivityScreen.this;
            r0.I2--;
            r0.p.k(dialogInterface);
            int i = this.d;
            if (i != -2) {
                if (i != -1) {
                    r0.finish();
                    r0.ja(0, null);
                    return;
                }
                r0.n9();
            } else if (!s6d.Y || (zjbVar = r0.V.Z) == null) {
                com.mxtech.videoplayer.n nVar = r0.V;
                Uri uri = nVar.o;
                if (uri != null) {
                    nVar.h(519);
                    try {
                        oab r = oab.r();
                        try {
                            SQLiteDatabase sQLiteDatabase = r.b;
                            r.b(uri);
                        } catch (Throwable th) {
                            r.getClass();
                            throw th;
                        }
                    } catch (SQLiteException e) {
                        Log.e("MX.Screen", "", e);
                        if (!r0.isFinishing()) {
                            ho4.a(2131887584, r0);
                        }
                    }
                    r0.m9(uri, r0.F2, r0.G2, r0.H2);
                    r0.V.O0();
                }
            } else {
                zjbVar.a();
                r0.n9();
            }
            if (this.c.isChecked()) {
                SharedPreferences.Editor edit = tya.o.b.edit();
                edit.putString("resume_last", jn5.b(this.d == -1 ? 3 : 2));
                edit.apply();
            }
        }

        @Override
        public final void onShow(DialogInterface dialogInterface) {
            Button c = ((androidx.appcompat.app.d) dialogInterface).c(-1);
            if (c != null) {
                c.requestFocus();
            }
        }
    }

    public class e implements f7f.c {
        public e() {
        }

        @Override
        public final void a() {
            ActivityScreen.this.C();
        }
    }

    public final class e0 implements Runnable {
        public int b;

        public e0() {
        }

        @Override
        public final void run() {
            ntf ntfVar;
            ?? r0 = ActivityScreen.this;
            LinearLayoutManager layoutManager = r0.m0.getLayoutManager();
            if (layoutManager != null) {
                int c1 = layoutManager.c1();
                boolean z = s6d.g1;
                if (z && c1 == 0 && (ntfVar = r0.z0) != null && ntfVar.h) {
                    if (z) {
                        s6d.g1 = false;
                        SharedPreferences.Editor edit = tya.o.b.edit();
                        edit.putBoolean("shortcut_expand_new", s6d.g1);
                        edit.apply();
                    }
                    ntf ntfVar2 = r0.z0;
                    if (ntfVar2 != null) {
                        ntfVar2.h = s6d.g1;
                        r0.ub(ntfVar2, false, true);
                    }
                }
                a f0 = r0.m0.f0(r0.n0.indexOf(r0.z0));
                if (f0 != null) {
                    int size = r0.n0.size() - c1;
                    int i = this.b;
                    if (i < 0 && size >= 7) {
                        if (((RecyclerView.z) f0).itemView.getVisibility() == 0) {
                            ((RecyclerView.z) f0).itemView.setVisibility(4);
                        }
                        qtf qtfVar = r0.o0;
                        if (qtfVar != null && !qtfVar.l) {
                            qtfVar.l = true;
                            qtfVar.notifyDataSetChanged();
                        }
                        ViewGroup.LayoutParams layoutParams = r0.m0.getLayoutParams();
                        layoutParams.height = h7f.a.b(2131166222, r0);
                        r0.m0.setLayoutParams(layoutParams);
                        return;
                    }
                    if (i <= 0 || size > 7 || c1 != layoutManager.f1()) {
                        return;
                    }
                    f0.r0();
                    qtf qtfVar2 = r0.o0;
                    if (qtfVar2 != null && qtfVar2.l) {
                        qtfVar2.l = false;
                        qtfVar2.notifyDataSetChanged();
                    }
                    ViewGroup.LayoutParams layoutParams2 = r0.m0.getLayoutParams();
                    layoutParams2.height = h7f.a.b(2131166163, r0);
                    r0.m0.setLayoutParams(layoutParams2);
                }
            }
        }
    }

    public class f implements View.OnClickListener {
        public f() {
        }

        @Override
        public final void onClick(View view) {
            ActivityScreen activityScreen = ActivityScreen.this;
            activityScreen.Q1 |= 8;
            activityScreen.xa(!activityScreen.U1);
            activityScreen.la();
        }
    }

    public class g implements RecyclerView.p {
        public boolean a;

        public g() {
        }

        public final void a(RecyclerView recyclerView, MotionEvent motionEvent) {
            if (!this.a || recyclerView == null || motionEvent == null) {
                return;
            }
            Object parent = recyclerView.getParent();
            if (parent instanceof View) {
                ActivityScreen activityScreen = ActivityScreen.this;
                activityScreen.p8((View) parent, activityScreen.b0, motionEvent);
            }
        }

        public final boolean c(RecyclerView recyclerView, MotionEvent motionEvent) {
            View a0;
            this.a = false;
            if (recyclerView != null && motionEvent != null && (a0 = recyclerView.a0(motionEvent.getX(), motionEvent.getY())) != null) {
                View b0 = recyclerView.b0(a0);
                RecyclerView.z l0 = b0 == null ? null : recyclerView.l0(b0);
                if (l0 != null && l0.getItemViewType() == 12) {
                    this.a = true;
                    Object parent = recyclerView.getParent();
                    if (parent instanceof View) {
                        ActivityScreen activityScreen = ActivityScreen.this;
                        activityScreen.p8((View) parent, activityScreen.b0, motionEvent);
                    }
                }
            }
            return this.a;
        }

        public final void e(boolean z) {
            this.a = !z;
        }
    }

    public static class g0 {
        public final int a;
        public int b;

        public g0(int i) {
            this.a = i;
            this.b = i;
        }
    }

    public class h extends RecyclerView.q {
        public h() {
        }

        public final void onScrolled(RecyclerView recyclerView, int i, int i2) {
            ActivityScreen activityScreen = ActivityScreen.this;
            recyclerView.removeCallbacks(activityScreen.N2);
            e0 e0Var = activityScreen.N2;
            e0Var.b = i;
            recyclerView.post(e0Var);
        }
    }

    public class h0 extends d.a implements DialogInterface.OnDismissListener {
        public h0(byte b) {
            super(ActivityScreen.this);
            int i;
            String string;
            ov0 ov0Var = L.a;
            if (b == 1) {
                i = 2131887214;
            } else if (b == 2) {
                i = 2131887219;
            } else {
                if (b != 4) {
                    string = "";
                    ((d.a) this).b.f = mfg.o(2131887215, string);
                    g(R.string.ok, (DialogInterface.OnClickListener) null);
                    ActivityScreen.this.c4(a(), this);
                }
                i = 2131887216;
            }
            string = ActivityScreen.this.getString(i);
            ((d.a) this).b.f = mfg.o(2131887215, string);
            g(R.string.ok, (DialogInterface.OnClickListener) null);
            ActivityScreen.this.c4(a(), this);
        }

        @Override
        public final void onDismiss(DialogInterface dialogInterface) {
            ynb ynbVar;
            b bVar;
            ?? r0 = ActivityScreen.this;
            r0.p.k(dialogInterface);
            bpb bpbVar = r0.E1;
            if (bpbVar != null) {
                ynb D = bpbVar.m.getSupportFragmentManager().D(2131362799);
                if ((D instanceof ynb) && !z4i.e(D) && (bVar = (ynbVar = D).l) != null) {
                    com.mxtech.videoplayer.n nVar = ynbVar.n;
                    bVar.j = nVar != null ? nVar.F : (byte) 1;
                    bVar.notifyDataSetChanged();
                }
            }
            if (r0.isFinishing()) {
                return;
            }
            r0.n9();
        }
    }

    public class i extends BroadcastReceiver {
        public i() {
        }

        @Override
        public final void onReceive(Context context, Intent intent) {
            char c;
            int i = 2;
            String action = intent.getAction();
            action.getClass();
            ActivityScreen activityScreen = ActivityScreen.this;
            switch (action.hashCode()) {
                case -1676458352:
                    if (action.equals("android.intent.action.HEADSET_PLUG")) {
                        c = 0;
                        break;
                    }
                    c = 65535;
                    break;
                case -1538406691:
                    if (action.equals("android.intent.action.BATTERY_CHANGED")) {
                        c = 1;
                        break;
                    }
                    c = 65535;
                    break;
                case -1513032534:
                    if (action.equals("android.intent.action.TIME_TICK")) {
                        c = 2;
                        break;
                    }
                    c = 65535;
                    break;
                case -549244379:
                    if (action.equals("android.media.AUDIO_BECOMING_NOISY")) {
                        c = 3;
                        break;
                    }
                    c = 65535;
                    break;
                case -469300177:
                    if (action.equals("android.media.action.HDMI_AUDIO_PLUG")) {
                        c = 4;
                        break;
                    }
                    c = 65535;
                    break;
                case 505380757:
                    if (action.equals("android.intent.action.TIME_SET")) {
                        c = 5;
                        break;
                    }
                    c = 65535;
                    break;
                default:
                    c = 65535;
                    break;
            }
            switch (c) {
                case 0:
                    activityScreen.b1 = intent.getIntExtra("state", 0) == 1;
                    activityScreen.Cb();
                    break;
                case 1:
                    int intExtra = intent.getIntExtra("level", -1);
                    int intExtra2 = intent.getIntExtra("scale", -1);
                    int intExtra3 = intent.getIntExtra("plugged", 0);
                    if (intExtra2 > 0) {
                        int i2 = (intExtra * 100) / intExtra2;
                        if (i2 != activityScreen.M1 || activityScreen.N1 != intExtra3) {
                            activityScreen.M1 = i2;
                            activityScreen.N1 = intExtra3;
                            activityScreen.eb();
                            break;
                        }
                    }
                    break;
                case 2:
                case 5:
                    String str = ActivityScreen.p4;
                    activityScreen.eb();
                    break;
                case 3:
                    if (tya.o.b.getBoolean("pause_on_headset_disconnected", true)) {
                        activityScreen.V.p0(0);
                        break;
                    }
                    break;
                case 4:
                    int[] iArr = ActivityScreen.r4;
                    if (intent.getIntExtra("android.media.extra.AUDIO_PLUG_STATE", 0) == 1) {
                        iArr = intent.getIntArrayExtra("android.media.extra.ENCODINGS");
                        i = intent.getIntExtra("android.media.extra.MAX_CHANNEL_COUNT", 0);
                    } else {
                        r1 = false;
                    }
                    com.mxtech.videoplayer.n nVar = activityScreen.V;
                    if (nVar != null) {
                        nVar.p0 = r1;
                        FFPlayer.updateAudioCapabilities(iArr, i);
                        break;
                    }
                    break;
            }
        }
    }

    public class j extends BroadcastReceiver {
        public j() {
        }

        @Override
        public final void onReceive(Context context, Intent intent) {
            char c;
            String action = intent.getAction();
            action.getClass();
            ActivityScreen activityScreen = ActivityScreen.this;
            switch (action.hashCode()) {
                case -1538406691:
                    if (action.equals("android.intent.action.BATTERY_CHANGED")) {
                        c = 0;
                        break;
                    }
                    c = 65535;
                    break;
                case -1513032534:
                    if (action.equals("android.intent.action.TIME_TICK")) {
                        c = 1;
                        break;
                    }
                    c = 65535;
                    break;
                case 505380757:
                    if (action.equals("android.intent.action.TIME_SET")) {
                        c = 2;
                        break;
                    }
                    c = 65535;
                    break;
                default:
                    c = 65535;
                    break;
            }
            switch (c) {
                case 0:
                    int intExtra = intent.getIntExtra("level", -1);
                    int intExtra2 = intent.getIntExtra("scale", -1);
                    int intExtra3 = intent.getIntExtra("plugged", 0);
                    if (intExtra2 > 0) {
                        int i = (intExtra * 100) / intExtra2;
                        if (i != activityScreen.M1 || activityScreen.N1 != intExtra3) {
                            activityScreen.M1 = i;
                            activityScreen.N1 = intExtra3;
                            activityScreen.eb();
                            break;
                        }
                    }
                    break;
                case 1:
                case 2:
                    String str = ActivityScreen.p4;
                    activityScreen.eb();
                    break;
            }
        }
    }

    public class l implements DialogInterface.OnDismissListener {
        public l() {
        }

        @Override
        public final void onDismiss(DialogInterface dialogInterface) {
            Uri uri;
            File l;
            ActivityScreen activityScreen = ActivityScreen.this;
            activityScreen.p.k(dialogInterface);
            if ((dialogInterface instanceof z46) && activityScreen.V.b0() && (uri = ((z46) dialogInterface).n) != null && Files.v(uri) && (l = Files.l(uri)) != null) {
                activityScreen.V.f0(l);
                activityScreen.supportInvalidateOptionsMenu();
            }
        }
    }

    public class m {
        public m() {
        }
    }

    public class n implements DialogInterface.OnClickListener, DialogInterface.OnDismissListener {
        public n(String str, String str2) {
            if (ActivityScreen.this.isFinishing()) {
                return;
            }
            StringBuilder sb = L.w;
            sb.setLength(0);
            sb.append(mfg.o(2131890993, str, str2));
            sb.append(' ');
            StringBuilder sb2 = new StringBuilder("<i>");
            L.a i = L.i();
            sb.append(ActivityScreen.this.getString(2131886361, z31.h(sb2, i != null ? i.b : "Unknown", "</i>")));
            d.a aVar = new d.a(ActivityScreen.this);
            String str3 = ActivityScreen.p4;
            String trim = ActivityScreen.this.getTitle().toString().trim();
            AlertController.b bVar = aVar.b;
            bVar.d = trim;
            bVar.f = Html.fromHtml(sb.toString());
            aVar.d(R.string.no, (DialogInterface.OnClickListener) null);
            aVar.g(R.string.yes, this);
            ActivityScreen.this.B5(aVar.a());
            ActivityScreen.this.V2 = this;
        }

        @Override
        public final void onClick(DialogInterface dialogInterface, int i) {
            try {
                ActivityScreen.this.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(mfg.o(2131887362, "codecs", L.p()))));
            } catch (Exception e) {
                Log.e("MX.Screen", "", e);
            }
        }

        @Override
        public final void onDismiss(DialogInterface dialogInterface) {
            ActivityScreen activityScreen = ActivityScreen.this;
            activityScreen.p.k(dialogInterface);
            activityScreen.V2 = null;
        }
    }

    public class p extends BaseAdapter implements DialogInterface.OnClickListener, DialogInterface.OnDismissListener {
        public final o[] b;
        public final int c;
        public final int d;
        public final CheckBox f;
        public boolean g;

        @SuppressLint({"InflateParams"})
        public p(ArrayList arrayList, int i) {
            this.b = (o[]) arrayList.toArray(new o[arrayList.size()]);
            this.d = i;
            d.a aVar = new d.a(ActivityScreen.this);
            aVar.l(2131890189);
            aVar.j(this, i, this);
            androidx.appcompat.app.d a = aVar.a();
            View inflate = a.getLayoutInflater().inflate(2131558572, (ViewGroup) null);
            CheckBox checkBox = (CheckBox) inflate.findViewById(2131363567);
            this.f = checkBox;
            checkBox.setText(2131891023);
            checkBox.setChecked(ActivityScreen.this.V.H);
            a.g(inflate);
            TypedArray obtainStyledAttributes = ActivityScreen.this.obtainStyledAttributes(null, rae.c, 2130968691, 0);
            this.c = obtainStyledAttributes.getResourceId(7, R.layout.select_dialog_singlechoice);
            obtainStyledAttributes.recycle();
            ActivityScreen.this.c4(a, this);
        }

        public final void a(int r7) {
            throw new UnsupportedOperationException("Method not decompiled: com.mxtech.videoplayer.ActivityScreen.p.a(int):void");
        }

        @Override
        public final int getCount() {
            return this.b.length;
        }

        @Override
        public final Object getItem(int i) {
            return Integer.valueOf(i);
        }

        @Override
        public final long getItemId(int i) {
            return i;
        }

        @Override
        public final View getView(int i, View view, ViewGroup viewGroup) {
            if (view == null) {
                view = ActivityScreen.this.Q.inflate(this.c, viewGroup, false);
            }
            ((TextView) view.findViewById(R.id.text1)).setText(this.b[i].a);
            return view;
        }

        @Override
        public final void onClick(DialogInterface dialogInterface, int i) {
            dialogInterface.dismiss();
            a(i);
        }

        @Override
        public final void onDismiss(DialogInterface dialogInterface) {
            a(this.d);
            ActivityScreen.this.p.k(dialogInterface);
        }
    }

    public class r implements DialogInterface.OnMultiChoiceClickListener {
        public final am8[] b;

        public r() {
            int subtitleCount = ActivityScreen.this.Q0.getSubtitleCount();
            this.b = ActivityScreen.this.Q0.getAllSubtitles();
            CharSequence[] charSequenceArr = new CharSequence[subtitleCount];
            boolean[] zArr = new boolean[subtitleCount];
            for (int i = 0; i < subtitleCount; i++) {
                charSequenceArr[i] = akg.f(((SubView.b) ActivityScreen.this.Q0.d.get(i)).a, this.b);
                zArr[i] = ((SubView.b) ActivityScreen.this.Q0.d.get(i)).b;
            }
            d.a aVar = new d.a(ActivityScreen.this);
            aVar.l(2131890534);
            AlertController.b bVar = aVar.b;
            bVar.p = charSequenceArr;
            bVar.y = this;
            bVar.u = zArr;
            bVar.v = true;
            ActivityScreen.this.B5(aVar.a());
        }

        @Override
        public final void onClick(DialogInterface dialogInterface, int i, boolean z) {
            ?? r4 = ActivityScreen.this;
            if (i >= r4.Q0.getSubtitleCount()) {
                return;
            }
            if (z) {
                am8 am8Var = ((SubView.b) r4.Q0.d.get(i)).a;
                if (!am8Var.isSupported()) {
                    z6h.d(r4, mfg.o(2131889331, akg.f(am8Var, this.b).toString()), false);
                    return;
                }
            }
            r4.Q0.i(i, z);
            s6d.a0(r4.Q0.getEnabledSubtitleCount() > 0);
            SubtitlePanel subtitlePanel = r4.N0;
            if (subtitlePanel != null) {
                subtitlePanel.b();
            }
        }
    }

    public class s extends BaseAdapter implements View.OnClickListener, DialogInterface.OnClickListener {
        public final int[] b;
        public final int c;
        public final int d;
        public int f;
        public LayoutInflater g;
        public int h;
        public final boolean i;

        public s() {
            com.mxtech.media.b bVar;
            FFPlayer u;
            if (!s6d.U()) {
                this.b = new int[]{2131887214, 2131887219};
                this.c = 0;
                this.d = 1;
                return;
            }
            this.b = new int[]{2131887214, 2131887216, 2131887219};
            this.c = 1;
            this.d = 2;
            if (!ActivityScreen.this.V.X() || (bVar = ActivityScreen.this.V.I) == null || (u = bVar.u()) == null || u.canSwitchToOMXDecoder()) {
                return;
            }
            this.i = true;
        }

        public final void a() {
            ?? r0 = ActivityScreen.this;
            if (r0.isFinishing() || !r0.V.a0() || r0.p.j() > 0) {
                return;
            }
            byte b = r0.V.F;
            if (b == 1) {
                this.f = 0;
            } else if (b == 2) {
                this.f = this.d;
            } else if (b == 4) {
                this.f = this.c;
            }
            d.a aVar = new d.a((Context) r0);
            aVar.l(2131887217);
            aVar.j(this, this.f, this);
            androidx.appcompat.app.d a = aVar.a();
            TypedArray obtainStyledAttributes = r0.obtainStyledAttributes(null, rae.c, 2130968691, 0);
            this.h = obtainStyledAttributes.getResourceId(7, R.layout.select_dialog_singlechoice);
            obtainStyledAttributes.recycle();
            this.g = a.getLayoutInflater();
            r0.B5(a);
        }

        @Override
        public final boolean areAllItemsEnabled() {
            return !this.i;
        }

        @Override
        public final int getCount() {
            return this.b.length;
        }

        @Override
        public final Object getItem(int i) {
            return Integer.valueOf(i);
        }

        @Override
        public final long getItemId(int i) {
            return i;
        }

        @Override
        public final View getView(int i, View view, ViewGroup viewGroup) {
            if (view == null) {
                view = this.g.inflate(this.h, viewGroup, false);
            }
            TextView textView = (TextView) view.findViewById(R.id.text1);
            textView.setEnabled(isEnabled(i));
            textView.setText(this.b[i]);
            return view;
        }

        @Override
        public final boolean isEnabled(int i) {
            return (this.i && i == this.c) ? false : true;
        }

        @Override
        public final void onClick(View view) {
            a();
        }

        @Override
        public final void onClick(DialogInterface dialogInterface, int i) {
            byte b;
            String str;
            dialogInterface.dismiss();
            ?? r4 = ActivityScreen.this;
            if (r4.isFinishing() || !r4.V.a0() || i == this.f || !isEnabled(i)) {
                return;
            }
            r4.V.y0();
            if (i == 0) {
                b = 1;
                str = "HW";
            } else if (i == this.c) {
                b = 4;
                str = "HW+";
            } else {
                b = 2;
                str = "SW";
            }
            do2.P(str, "screen", r4.j0);
            r4.a7(b);
        }
    }

    public class t implements DialogInterface.OnDismissListener {
        public t() {
        }

        @Override
        public final void onDismiss(DialogInterface dialogInterface) {
            ActivityScreen activityScreen = ActivityScreen.this;
            activityScreen.p.k(dialogInterface);
            String str = ActivityScreen.p4;
            if (activityScreen.V.N0()) {
                return;
            }
            cpa cpaVar = activityScreen.V0;
            if (cpaVar == null || !cpaVar.a()) {
                activityScreen.ja(1, null);
                activityScreen.finish();
            }
        }
    }

    public class u extends rh0 {
    }

    public class w implements DialogInterface.OnClickListener, DialogInterface.OnDismissListener, e.g {
        public final File b;
        public final HashSet<File> c;
        public boolean d;
        public int f;
        public Uri g;

        @SuppressLint({"InflateParams"})
        public w() {
            androidx.appcompat.app.d dVar;
            HashSet<File> hashSet = new HashSet<>();
            this.c = hashSet;
            File file = ActivityScreen.this.V.q;
            this.b = file;
            if (file == null) {
                return;
            }
            String g = sgj.l(file.getPath()) ? sgj.g(file.getName()) : file.getName();
            if (s6d.o) {
                hashSet.addAll(Arrays.asList(akg.k(g, file.getParent())));
            }
            File b = mu8.b(file);
            if (b != null) {
                hashSet.add(b);
            }
            StringBuilder sb = L.w;
            sb.setLength(0);
            sb.append(g);
            ArrayList<String> arrayList = new ArrayList<>();
            arrayList.add(g);
            Iterator<File> it = hashSet.iterator();
            while (it.hasNext()) {
                String name = it.next().getName();
                StringBuilder sb2 = L.w;
                sb2.append(", ");
                sb2.append(name);
                arrayList.add(name);
            }
            if (xk4.g) {
                d.a aVar = new d.a(ActivityScreen.this);
                aVar.l(2131888797);
                aVar.g(R.string.ok, this);
                aVar.d(R.string.cancel, (DialogInterface.OnClickListener) null);
                dVar = aVar.a();
                View inflate = dVar.getLayoutInflater().inflate(2131558732, (ViewGroup) null);
                ((TextView) inflate.findViewById(2131364858)).setText(((j1b) ActivityScreen.this.getResources()).b.getQuantityString(2131755037, this.c.size() + 1));
                ((TextView) inflate.findViewById(2131362817)).setText(L.w.toString());
                dVar.g(inflate);
            } else {
                String quantityString = ((j1b) ActivityScreen.this.getResources()).b.getQuantityString(2131755037, this.c.size() + 1);
                ce4 ce4Var = new ce4(ActivityScreen.this, true, 2131952639);
                ActivityScreen.this.getLifecycle().a(ce4Var);
                ce4Var.f = this;
                ce4Var.h = arrayList;
                ce4Var.g = quantityString;
                dVar = ce4Var;
            }
            ActivityScreen.this.B5(dVar);
        }

        @Override
        public final void e() {
            ActivityScreen.this.getClass();
        }

        @Override
        public final void f(int i, int i2) {
            a aVar = ActivityScreen.this;
            if (aVar.isFinishing()) {
                return;
            }
            aVar.c4(L.f(aVar, com.mxtech.videoplayer.f.J(i, i2)), this);
        }

        @Override
        public final void onClick(DialogInterface dialogInterface, int i) {
            oab r;
            MediaExtensions q;
            File file;
            wfc wfcVar;
            StringBuilder sb = new StringBuilder("Deleting 1 + ");
            HashSet<File> hashSet = this.c;
            sb.append(hashSet.size());
            sb.append(" files & updating database.");
            Log.v("MX.Screen", sb.toString());
            ?? r10 = ActivityScreen.this;
            if (r10.isFinishing()) {
                return;
            }
            com.mxtech.videoplayer.n nVar = r10.V;
            Uri uri = nVar.o;
            nVar.y0();
            r10.V.h(7);
            try {
                r = oab.r();
                try {
                    r.e();
                    try {
                        q = MediaExtensions.q();
                        file = this.b;
                        try {
                        } finally {
                            q.close();
                        }
                    } finally {
                        r.k();
                    }
                } catch (Throwable th) {
                    r.getClass();
                    throw th;
                }
            } catch (SQLiteException e) {
                Log.e("MX.Screen", "", e);
            }
            if (!kkb.c(r, file, q, Boolean.TRUE)) {
                Log.v("MX.Screen", file.getPath() + " was NOT deleted. (exists:" + file.exists() + " canRead:" + file.canRead() + " canWrite:" + file.canWrite() + ")");
                r10.x6(1, 1, this);
                r10.m9(uri, 7, (byte) 0, 0);
                return;
            }
            q.close();
            if (!r10.V.L0() && (wfcVar = r10.V.m) != null) {
                int i2 = !s6d.G0 ? 1 : 0;
                this.f = i2;
                this.g = wfcVar.c(uri, i2, s6d.H0 == 9 ? 1 : 0);
                wfcVar.k(uri);
            }
            Iterator<File> it = hashSet.iterator();
            while (it.hasNext()) {
                File next = it.next();
                if (Files.b(com.mxtech.videoplayer.f.z, next)) {
                    L.n().n(0, next.getPath(), null);
                    Log.v("MX.Screen", next.getPath() + " was deleted.");
                } else {
                    Log.v("MX.Screen", next.getPath() + " was NOT deleted.");
                }
            }
            this.d = true;
            r.K();
            if (TextUtils.equals(r10.j0, "mediamanager")) {
                tj5.c(new leb(0, true));
            }
            tj5.c(new qz4());
            Uri uri2 = this.g;
            if (uri2 != null) {
                r10.V.h0(uri2, this.f);
            } else {
                r10.finish();
            }
        }

        @Override
        public final void onDismiss(DialogInterface dialogInterface) {
            ActivityScreen activityScreen = ActivityScreen.this;
            activityScreen.p.k(dialogInterface);
            if (this.d) {
                Uri uri = this.g;
                if (uri != null) {
                    activityScreen.V.h0(uri, this.f);
                } else {
                    activityScreen.finish();
                }
            }
        }
    }

    public class x implements DialogInterface.OnClickListener {
        public final Uri b;
        public final File c;
        public final String d;

        public x() {
            com.mxtech.videoplayer.n nVar = ActivityScreen.this.V;
            File file = nVar.q;
            this.c = file;
            if (file == null) {
                return;
            }
            this.b = nVar.o;
            String name = file.getName();
            this.d = name;
            ho4.e(ActivityScreen.this, Files.J(name), this);
        }

        @Override
        public final void onClick(DialogInterface dialogInterface, int i) {
            String u = mfg.u(((TextView) ((Dialog) dialogInterface).findViewById(R.id.edit)).getText().toString().trim());
            File file = this.c;
            Files.e F = Files.F(file.getPath());
            if (F.b.equals(u)) {
                return;
            }
            F.b = u;
            File a = F.a();
            ActivityScreen activityScreen = ActivityScreen.this;
            activityScreen.V.y0();
            activityScreen.V.h(519);
            boolean m = kkb.m(activityScreen, file, a, akg.k(this.d, file.getParent()), mu8.b(file));
            Uri uri = this.b;
            if (m) {
                jpe jpeVar = (jpe) sac.c.a(jpe.class);
                if (jpeVar != null) {
                    jpeVar.d(file, a);
                }
                fbi.b(a.getPath(), file.getPath());
                Uri fromFile = Uri.fromFile(a);
                wfc wfcVar = activityScreen.V.m;
                if (wfcVar != null) {
                    LinkedList<Uri> linkedList = wfcVar.e;
                    int indexOf = linkedList.indexOf(uri);
                    if (indexOf != -1) {
                        linkedList.set(indexOf, fromFile);
                    }
                    ListIterator<Uri> listIterator = wfcVar.f.listIterator();
                    while (true) {
                        if (!listIterator.hasNext()) {
                            break;
                        } else if (listIterator.next().equals(uri)) {
                            listIterator.set(fromFile);
                            break;
                        }
                    }
                    HashSet hashSet = wfcVar.g;
                    if (hashSet != null && hashSet.remove(uri)) {
                        wfcVar.g.add(fromFile);
                    }
                }
                if (TextUtils.equals(activityScreen.j0, "mediamanager")) {
                    tj5.c(new leb(1, true));
                }
                uri = fromFile;
            }
            activityScreen.m9(uri, 7, (byte) 0, 0);
        }
    }

    public class y extends xo4 {
        public y() {
            super(ActivityScreen.this);
        }

        public final void a(Uri uri) {
            ActivityScreen.this.Ua(uri);
        }

        public final boolean b() {
            return vab.a.b();
        }
    }

    static {
        IntentFilter intentFilter = new IntentFilter();
        u4 = intentFilter;
        intentFilter.addAction("android.intent.action.HEADSET_PLUG");
        intentFilter.addAction("android.media.AUDIO_BECOMING_NOISY");
        intentFilter.addAction("android.media.action.HDMI_AUDIO_PLUG");
        IntentFilter intentFilter2 = new IntentFilter();
        v4 = intentFilter2;
        intentFilter2.addAction("android.intent.action.TIME_TICK");
        intentFilter2.addAction("android.intent.action.TIME_SET");
        intentFilter2.addAction("android.intent.action.BATTERY_CHANGED");
    }

    public ActivityScreen() {
        registerForActivityResult(new hg(), new fh());
        this.x2 = 1.0d;
        this.J2 = new ArrayList<>();
        this.M2 = new h();
        this.N2 = new e0();
        this.O2 = new i();
        this.P2 = new j();
        this.T2 = false;
        this.U2 = new k();
        this.b3 = -1;
        this.n3 = 0;
        this.o3 = Integer.MIN_VALUE;
        this.p3 = Integer.MIN_VALUE;
        this.q3 = Integer.MIN_VALUE;
        this.r3 = Integer.MIN_VALUE;
        this.u3 = null;
        this.A3 = true;
        this.E3 = Integer.MIN_VALUE;
        this.M3 = 0;
        this.N3 = 0;
        this.V3 = new int[2];
        this.W3 = new int[2];
        this.f4 = new b();
        this.j4 = 0L;
        this.k4 = 0L;
        this.m4 = new f7f(new e());
        bn4 bn4Var = this.p;
        if (bn4Var.f == null) {
            bn4Var.f = new ArrayList<>();
        }
        if (bn4Var.f.contains(this)) {
            return;
        }
        bn4Var.f.add(this);
    }

    public static boolean C6(ActivityScreen activityScreen, boolean z2) {
        ActionBar supportActionBar;
        if (activityScreen.isFinishing() || activityScreen.V0 != null) {
            return false;
        }
        boolean z3 = tya.o.b.getBoolean("lock_show_interface", false);
        activityScreen.Y0 = z3;
        if (activityScreen.k0 != null && activityScreen.X == 2 && !z3) {
            activityScreen.Ea(true);
        }
        activityScreen.V0 = new cpa();
        activityScreen.W0 = activityScreen.S.getWidth();
        activityScreen.X0 = activityScreen.S.getHeight();
        activityScreen.V0.c = activityScreen;
        activityScreen.y8();
        if (activityScreen.e2.size() > 0) {
            activityScreen.r8();
        }
        int f2 = (!activityScreen.Y0 || (supportActionBar = activityScreen.getSupportActionBar()) == null) ? 0 : supportActionBar.f();
        cpa cpaVar = activityScreen.V0;
        boolean z4 = activityScreen.e0;
        boolean z5 = activityScreen.Y0;
        if (cpaVar.f == null) {
            Log.d("MX.Lock", "LOCK " + cpaVar);
            cpaVar.d = (WindowManager) activityScreen.getSystemService("window");
            if (xk4.i) {
                cpaVar.i = tya.o.b.getInt("lock_mode", 0);
            } else {
                cpaVar.i = 0;
            }
            if (cpaVar.a()) {
                try {
                    cpaVar.f = cpaVar.new c(activityScreen, activityScreen.getResources(), cpaVar.i == 2);
                } catch (Exception unused) {
                    cpaVar.i = 0;
                }
            }
            WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams();
            View decorView = activityScreen.getWindow().getDecorView();
            int i2 = s6d.x0;
            if (i2 >= 11) {
                int i3 = s6d.w1;
                if (i3 == 1) {
                    cpaVar.l = 4611;
                    if (z5) {
                        cpaVar.m = 4610;
                    } else {
                        cpaVar.m = 4611;
                    }
                    if (s6d.n() != 1) {
                        if (z5) {
                            cpaVar.m |= SkinViewInflater.FLAG_BUTTON_TINT;
                        } else {
                            cpaVar.m |= 1028;
                        }
                        cpaVar.l |= 1028;
                    }
                } else if (i3 == 2) {
                    if (i2 >= 16) {
                        if (i2 >= 19) {
                            cpaVar.l = 2051;
                            if (z5) {
                                cpaVar.m = SkinViewInflater.FLAG_ANDROID_FOREGROUND;
                            } else {
                                cpaVar.m = 2051;
                            }
                        } else {
                            if (z5) {
                                cpaVar.m = SkinViewInflater.FLAG_ANDROID_FOREGROUND;
                            } else {
                                cpaVar.m = 513;
                            }
                            cpaVar.l = 3;
                        }
                        if (s6d.n() != 1) {
                            if (z5) {
                                cpaVar.m |= SkinViewInflater.FLAG_BUTTON_TINT;
                            } else {
                                cpaVar.m |= 4;
                            }
                            cpaVar.l |= 4;
                        }
                    } else {
                        cpaVar.m = 1;
                        cpaVar.l = 2;
                    }
                } else if (s6d.y0 && tya.o.b.getBoolean("status_bar_show_always", false)) {
                    cpaVar.l = 0;
                    cpaVar.m = 0;
                } else if (s6d.x0 < 16) {
                    if (s6d.y0 && z5) {
                        cpaVar.m = 0;
                    } else {
                        cpaVar.m = 1;
                    }
                    cpaVar.l = 1;
                } else if (s6d.n() != 1) {
                    if (z5) {
                        cpaVar.m = SkinViewInflater.FLAG_BUTTON_TINT;
                    } else {
                        cpaVar.m = 5;
                    }
                    cpaVar.l = 5;
                } else {
                    if (z5) {
                        cpaVar.m = 0;
                    } else {
                        cpaVar.m = 1;
                    }
                    cpaVar.l = 1;
                }
                layoutParams.systemUiVisibility = cpaVar.m;
            }
            if (s6d.x0 < 16) {
                layoutParams.flags |= SkinViewInflater.FLAG_BUTTON_TINT;
            }
            layoutParams.token = decorView.getWindowToken();
            layoutParams.packageName = activityScreen.getPackageName();
            layoutParams.screenBrightness = activityScreen.getWindow().getAttributes().screenBrightness;
            if (z4) {
                layoutParams.buttonBrightness = 0.0f;
            }
            if (cpaVar.a()) {
                Toast makeText = Toast.makeText(tya.w(), 2131888390, 0);
                cpaVar.j = makeText;
                z6h.a(makeText);
                layoutParams.flags |= 4194304;
            } else {
                cpaVar.f = cpaVar.new d(activityScreen);
                activityScreen.getLayoutInflater().inflate(2131559721, (ViewGroup) cpaVar.f);
                ImageView imageView = (ImageView) ((ViewGroup) cpaVar.f).getChildAt(0);
                cpaVar.g = imageView;
                ((ViewGroup.MarginLayoutParams) imageView.getLayoutParams()).topMargin += f2;
                cpaVar.g.setImageResource(z2 ? 2131234238 : 2131234532);
                cpaVar.g.getDrawable().mutate().setColorFilter(null);
                cpaVar.g.setOnClickListener(cpaVar);
                cpaVar.f.setOnTouchListener(cpaVar);
            }
            cpaVar.k = 2;
            Apps.k(cpaVar.d, cpaVar.f, layoutParams);
            cpaVar.b = Thread.getDefaultUncaughtExceptionHandler();
            Thread.setDefaultUncaughtExceptionHandler(cpaVar);
            int i4 = s6d.x0;
            if (i4 >= 11 && s6d.w1 != 0 && i4 < 19) {
                cpaVar.f.setOnSystemUiVisibilityChangeListener(new bpa(cpaVar, activityScreen));
            }
            cpaVar.d(384);
        }
        activityScreen.w8(2);
        return true;
    }

    public static Uri D6(ActivityScreen activityScreen) {
        boolean z2 = activityScreen.V.b() && s6d.I0 && activityScreen.V.b0() && activityScreen.V.L() >= 3000;
        activityScreen.ea();
        activityScreen.fa();
        activityScreen.ga();
        Uri s0 = activityScreen.V.s0(s6d.I0);
        if (s0 != null || z2) {
            activityScreen.ea();
            activityScreen.fa();
            activityScreen.ga();
        } else {
            z6h.c(activityScreen.getApplicationContext(), 2131889304, true);
        }
        return s0;
    }

    public static void L6(Intent intent, Uri uri) {
        int i2;
        Parcelable[] parcelableArrayExtra = intent.getParcelableArrayExtra("video_list");
        boolean z2 = false;
        if (parcelableArrayExtra != null) {
            i2 = 0;
            while (i2 < parcelableArrayExtra.length) {
                if (parcelableArrayExtra[i2].equals(uri)) {
                    break;
                } else {
                    i2++;
                }
            }
        }
        i2 = -1;
        if (uri != null && uri.equals(intent.getData())) {
            z2 = true;
        }
        if (i2 >= 0) {
            String[] stringArrayExtra = intent.getStringArrayExtra("video_list.name");
            long[] longArrayExtra = intent.getLongArrayExtra("video_list.size");
            String[] stringArrayExtra2 = intent.getStringArrayExtra("video_list.filename");
            String[] stringArrayExtra3 = intent.getStringArrayExtra("video_list.hash.opensubtitles");
            if (stringArrayExtra != null && stringArrayExtra.length == parcelableArrayExtra.length) {
                String str = stringArrayExtra[i2];
                if (str != null) {
                    intent.putExtra("title", str);
                } else if (!z2) {
                    intent.removeExtra("title");
                }
            }
            if (longArrayExtra != null && longArrayExtra.length == parcelableArrayExtra.length) {
                long j2 = longArrayExtra[i2];
                if (j2 != 0) {
                    intent.putExtra("size", j2);
                } else if (!z2) {
                    intent.removeExtra("size");
                }
            }
            if (stringArrayExtra2 != null && stringArrayExtra2.length == parcelableArrayExtra.length) {
                String str2 = stringArrayExtra2[i2];
                if (str2 != null) {
                    intent.putExtra("filename", str2);
                } else if (!z2) {
                    intent.removeExtra("filename");
                }
            }
            if (stringArrayExtra3 != null && stringArrayExtra3.length == parcelableArrayExtra.length) {
                String str3 = stringArrayExtra3[i2];
                if (str3 != null) {
                    intent.putExtra("hash.opensubtitles", str3);
                } else if (!z2) {
                    intent.removeExtra("hash.opensubtitles");
                }
            }
        } else if (!z2) {
            intent.removeExtra("title");
            intent.removeExtra("size");
            intent.removeExtra("filename");
            intent.removeExtra("hash.opensubtitles");
        }
        if (z2) {
            return;
        }
        intent.removeExtra("position");
        intent.removeExtra("subs");
        intent.removeExtra("subs.enable");
        intent.removeExtra("subs.name");
        intent.removeExtra("subs.filename");
    }

    public static String O7(int i2, FFPlayer fFPlayer) {
        String streamProfile;
        String streamCodec = fFPlayer.getStreamCodec(i2, 0);
        return (streamCodec == null || (streamProfile = fFPlayer.getStreamProfile(i2)) == null) ? streamCodec : h7.b(streamCodec, "@", streamProfile);
    }

    public static int P7(float f2, float f3, float f4, float f5, double d2) {
        double d3 = f4 - f2;
        double d4 = f5 - f3;
        if (d3 == 0.0d && d4 == 0.0d) {
            return 0;
        }
        if (Math.sqrt((d4 * d4) + (d3 * d3)) < d2) {
            return 0;
        }
        double atan2 = Math.atan2(d4, d3);
        if (2.6179938779914944d < atan2 || atan2 < -2.6179938779914944d) {
            return 3;
        }
        if (-0.5235987755982988d < atan2 && atan2 < 0.5235987755982988d) {
            return 4;
        }
        if (1.0471975511965976d >= atan2 || atan2 >= 2.0943951023931953d) {
            return (-2.0943951023931953d >= atan2 || atan2 >= -1.0471975511965976d) ? 0 : 1;
        }
        return 2;
    }

    public static boolean X8(double d2) {
        return Math.abs(d2 - ((double) ((int) (0.5d + d2)))) < 0.01d;
    }

    public static boolean a9(int i2, int i3, int i4, int i5) {
        if (i2 == 0 || i3 == 0 || i2 != i3) {
            return false;
        }
        return i2 == i4 || i2 == i5;
    }

    public static String b8(double d2) {
        NumberFormat numberFormat = NumberFormat.getInstance(Locale.getDefault());
        numberFormat.setMinimumFractionDigits(X8(d2) ? 0 : 2);
        return numberFormat.format(d2) + "X";
    }

    public static void h7(ContextWrapper contextWrapper, com.mxtech.media.b bVar) {
        int i2;
        int videoStreamIndex;
        FFPlayer u2 = bVar.u();
        if (u2 == null || !u2.b0()) {
            return;
        }
        if ((bVar.c instanceof FFPlayer) && !u2.isOMXVideoDecoderUsed() && (videoStreamIndex = u2.getVideoStreamIndex()) >= 0 && !u2.isDecoderSupported(videoStreamIndex)) {
            y9(contextWrapper, contextWrapper.getString(2131887321).toLowerCase(Locale.getDefault()), u2.getStreamCodec(videoStreamIndex, 1));
            return;
        }
        com.mxtech.media.a s2 = bVar.s();
        if (s2 instanceof FFPlayer) {
            if (s2.isPrepared()) {
                FFPlayer fFPlayer = (FFPlayer) s2;
                if (fFPlayer.isOMXAudioDecoderUsed() || (i2 = fFPlayer.A) < 0 || fFPlayer.isDecoderSupported(i2)) {
                    return;
                }
                y9(contextWrapper, contextWrapper.getString(2131886366).toLowerCase(Locale.getDefault()), fFPlayer.getStreamCodec(i2, 1));
                return;
            }
            return;
        }
        if (!s6d.B0 || s2.getAudioStream() >= 0 || u2.n() >= 0) {
            return;
        }
        int i3 = 0;
        for (int i4 : u2.getStreamTypes()) {
            if (i4 == 1 && !u2.isDecoderSupported(i3)) {
                y9(contextWrapper, contextWrapper.getString(2131886366).toLowerCase(Locale.getDefault()), u2.getStreamCodec(i3, 1));
                return;
            }
            i3++;
        }
    }

    public static boolean h9() {
        return !xk4.g && s6d.U;
    }

    public static void k9(Context context, @NonNull Uri uri, Uri[] uriArr, HashMap hashMap, HashMap hashMap2, boolean z2, byte b2, String str) {
        try {
            if (y82.f() && y82.g(uri)) {
                CastActivity.d6(context, uriArr, uri, false);
                return;
            }
            if (!(opd.c.a == null)) {
                gfh.c(new RuntimeException("FFPlayer isn't released yet."));
                z6h.d(tya.w(), "Player is busy. please try again later.", false);
                return;
            }
            a7d.a();
            Intent intent = new Intent("android.intent.action.VIEW", uri, context, Apps.b(context, ActivityScreen.class));
            intent.putExtra("self", true);
            intent.putExtra("fromSource", str);
            if (b2 != 0) {
                intent.putExtra("decode_mode", b2);
            }
            if (z2) {
                intent.putExtra("video_list_is_explicit", true);
            }
            if (uriArr != null) {
                if (uriArr.length > 300) {
                    kgc.y(intent, uriArr);
                } else {
                    intent.putExtra("video_list", uriArr);
                }
            }
            s4 = hashMap;
            t4 = hashMap2;
            intent.addFlags(268435456);
            context.startActivity(intent);
        } catch (Exception e2) {
            Log.e("MX.Screen", "", e2);
        }
    }

    public static void l9(Context context, @NonNull Uri uri, Uri[] uriArr, boolean z2, byte b2) {
        k9(context, uri, uriArr, null, null, z2, b2, "");
    }

    public static void y9(android.content.ContextWrapper r6, java.lang.String r7, java.lang.String r8) {
        throw new UnsupportedOperationException("Method not decompiled: com.mxtech.videoplayer.ActivityScreen.y9(android.content.ContextWrapper, java.lang.String, java.lang.String):void");
    }

    @Override
    public final void A2(Uri uri, byte b2, int i2) {
        m9(uri, 0, b2, i2);
    }

    public final void A5(CharSequence charSequence) {
        Ba(charSequence, null, true, true);
    }

    public final int A7(int i2, boolean z2) {
        com.mxtech.videoplayer.n nVar;
        bud budVar;
        aud audVar = this.l4;
        if (audVar != null && (budVar = audVar.g) != null) {
            budVar.dismissAllowingStateLoss();
        }
        if ((this.v3 != 2 && !z2) || this.B1) {
            return 0;
        }
        int i3 = this.w3;
        if (i3 == 1) {
            return B7();
        }
        if (i3 != 2 || !L.r() || (nVar = this.V) == null || !nVar.b0()) {
            return 0;
        }
        if (this.V.B0 != null) {
            this.r2 = true;
            return 0;
        }
        if (this.R != 2) {
            qd6 d2 = qd6.d();
            Context applicationContext = getApplicationContext();
            d2.getClass();
            if (!qd6.b(applicationContext)) {
                if (i2 == 1) {
                    return B7();
                }
                if (i2 != 2) {
                    if (i2 != 4 || s6d.G() != 2) {
                        return 0;
                    }
                    z6h.c(this, 2131887539, true);
                    return 0;
                }
                d.a aVar = new d.a(this);
                aVar.l(2131887543);
                aVar.b(2131887539);
                aVar.g(2131887542, new uh(this));
                aVar.d(R.string.cancel, (DialogInterface.OnClickListener) null);
                B5(aVar.a());
                return 0;
            }
            if (!N6()) {
                return 3;
            }
            Bundle bundle = new Bundle();
            ka(bundle);
            if (Build.MODEL.equals("MiBOX3")) {
                com.mxtech.videoplayer.n nVar2 = this.V;
                if (nVar2.F == 1) {
                    nVar2.p0(0);
                }
            }
            ba();
            this.V.y0();
            SubView subView = this.Q0;
            if (subView != null) {
                subView.d();
            }
            try {
                PlayService playService = PlayService.L0;
                if (playService != null) {
                    playService.x(isFinishing() ? null : this, this.V, getClass(), getIntent(), bundle, Boolean.TRUE);
                    ta();
                }
                this.R = 2;
            } catch (IllegalStateException unused) {
                return 0;
            }
        }
        return 2;
    }

    public final void Aa(float f2) {
        SubtitleOverlay subtitleOverlay = this.M0;
        if (subtitleOverlay != null) {
            subtitleOverlay.setFrameScale(f2);
        }
        SubStationAlphaMedia p2 = this.V.p(1, null);
        if (p2 != null) {
            p2.setFontScale(((j1b) getResources()).a.getConfiguration().fontScale * f2);
            this.Q0.l();
        }
        s6d.x = f2;
    }

    public final void Ab(double d2) {
        ntf ntfVar = this.v0;
        if (ntfVar != null) {
            ntfVar.i = b8(d2);
            this.v0.f = X8(this.V.R()) ? 16.0f : 12.0f;
            ub(this.v0, !(Math.abs(d2 - 1.0d) < 0.01d), true);
        }
    }

    @Override
    public final void B() {
        runOnUiThread(new eh(this, 0));
    }

    @Override
    public void B3() {
        bb(this.V.L(), false);
    }

    @Override
    public final void B4(LinkedList linkedList) {
        this.O.removeMessages(13);
        pa(null);
        if (this.V.b0()) {
            if (!this.V.X()) {
                w7();
            }
            if (!this.i4) {
                if (linkedList != null) {
                    E6(linkedList, this.V.Z, Apps.d(getIntent(), "subs.enable"), s6d.p ? 1 : 0);
                }
            } else {
                if (!this.h4) {
                    this.V.w0(linkedList);
                }
                E6(linkedList, null, null, 5);
                this.h4 = false;
                this.i4 = false;
            }
        }
    }

    public final int B7() {
        PictureInPictureParams build;
        if (Build.VERSION.SDK_INT < 26 || !l7()) {
            return 0;
        }
        if (!Q6()) {
            return 3;
        }
        if (this.p2 == null) {
            this.p2 = wg.a();
        }
        com.mxtech.videoplayer.n nVar = this.V;
        Rational rational = new Rational(nVar.B, nVar.C);
        if (!rational.isFinite() || rational.doubleValue() <= 0.41841d || rational.doubleValue() >= 2.39d) {
            rg.c(this.p2).setAspectRatio(new Rational(1280, 720));
        } else {
            rg.c(this.p2).setAspectRatio(rational);
        }
        try {
            qb();
            build = rg.c(this.p2).build();
            enterPictureInPictureMode(build);
            return 1;
        } catch (IllegalStateException unused) {
            z6h.c(this, 2131889521, false);
            return 0;
        }
    }

    public final void B8() {
        this.F0.setVisibility(8);
        this.H0.setImageDrawable(null);
        this.I0.setText((CharSequence) null);
        if (this.a1) {
            ContentLoadingProgressBar contentLoadingProgressBar = this.T0;
            contentLoadingProgressBar.getClass();
            contentLoadingProgressBar.post(new pg3(contentLoadingProgressBar, 1));
            ContentLoadingTextView contentLoadingTextView = this.U0;
            contentLoadingTextView.getClass();
            contentLoadingTextView.post(new w0(contentLoadingTextView, 3));
        }
    }

    public final void Ba(CharSequence charSequence, Drawable drawable, boolean z2, boolean z3) {
        this.O.removeMessages(4);
        if (charSequence == null) {
            this.I0.setTag(null);
            if (this.F0.getVisibility() == 0) {
                if (!z2) {
                    B8();
                    return;
                } else {
                    this.L1.reset();
                    this.F0.startAnimation(this.L1);
                    return;
                }
            }
            return;
        }
        try {
            this.L1.cancel();
        } catch (Throwable unused) {
        }
        LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) this.H0.getLayoutParams();
        if (z3) {
            this.I0.setTextAppearance(this, 2131953816);
            this.I0.setShadowLayer(2.0f, 0.0f, 0.0f, -16777216);
            layoutParams.width = -2;
            layoutParams.height = -2;
            layoutParams.rightMargin = 0;
            this.H0.setLayoutParams(layoutParams);
            this.F0.setPadding(0, 0, 0, 0);
            this.F0.setBackgroundColor(0);
        } else {
            int dimensionPixelSize = ((j1b) getResources()).a.getDimensionPixelSize(2131166221);
            int dimensionPixelSize2 = ((j1b) getResources()).a.getDimensionPixelSize(2131165698);
            this.I0.setTextAppearance(this, 2131953817);
            this.I0.setShadowLayer(0.0f, 0.0f, 0.0f, 0);
            int i2 = dimensionPixelSize * 2;
            layoutParams.width = i2;
            layoutParams.height = i2;
            layoutParams.rightMargin = dimensionPixelSize;
            this.H0.setLayoutParams(layoutParams);
            this.F0.setPadding(dimensionPixelSize2, dimensionPixelSize, dimensionPixelSize2, dimensionPixelSize);
            this.F0.setBackgroundResource(2131233589);
        }
        this.H0.setImageDrawable(drawable);
        this.I0.setText(charSequence);
        this.I0.setTag(charSequence);
        this.F0.setVisibility(0);
        if (this.a1) {
            ContentLoadingProgressBar contentLoadingProgressBar = this.T0;
            contentLoadingProgressBar.getClass();
            contentLoadingProgressBar.post(new n00(contentLoadingProgressBar, 3));
            ContentLoadingTextView contentLoadingTextView = this.U0;
            contentLoadingTextView.getClass();
            contentLoadingTextView.post(new x0(contentLoadingTextView, 2));
        }
    }

    public final void Bb() {
        boolean M8 = M8();
        if (s6d.e0) {
            if (this.g1 == null) {
                TextView textView = (TextView) this.Q.inflate(2131558905, (ViewGroup) this.S, false);
                this.g1 = textView;
                textView.setTextColor(this.a2);
                va(this.V.b0() ? this.V.L() : 0, M8);
                this.S.addView(this.g1, h8(4));
            }
            ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) this.g1.getLayoutParams();
            marginLayoutParams.setMargins((int) (s6d.f0 * xk4.b), marginLayoutParams.topMargin, marginLayoutParams.rightMargin, marginLayoutParams.bottomMargin);
            this.g1.setLayoutParams(marginLayoutParams);
            this.g1.setVisibility(M8 ? 8 : 0);
        } else {
            TextView textView2 = this.g1;
            if (textView2 != null) {
                this.S.removeView(textView2);
                this.g1 = null;
                this.q3 = Integer.MIN_VALUE;
                this.r3 = Integer.MIN_VALUE;
            }
        }
        if (this.Y) {
            if (this.y2 == null) {
                View inflate = this.Q.inflate(2131560329, (ViewGroup) this.S, false);
                this.y2 = inflate;
                this.z2 = (TextView) inflate.findViewById(2131366123);
                this.A2 = (ImageView) this.y2.findViewById(2131362250);
                TextView textView3 = this.z2;
                if (textView3 != null) {
                    textView3.setTextColor(this.a2);
                }
                ImageView imageView = this.A2;
                if (imageView != null) {
                    imageView.setColorFilter(this.a2, PorterDuff.Mode.SRC_ATOP);
                }
                fb(M8);
                this.S.addView(this.y2, h8(4));
            }
            ViewGroup.MarginLayoutParams marginLayoutParams2 = (ViewGroup.MarginLayoutParams) this.y2.getLayoutParams();
            marginLayoutParams2.setMargins(marginLayoutParams2.leftMargin, marginLayoutParams2.topMargin, (int) (s6d.f0 * xk4.b), marginLayoutParams2.bottomMargin);
            this.y2.setLayoutParams(marginLayoutParams2);
            this.y2.setVisibility(M8 ? 8 : 0);
        } else {
            View view = this.y2;
            if (view != null) {
                this.S.removeView(view);
                this.y2 = null;
                this.z2 = null;
                this.A2 = null;
            }
        }
        pb();
    }

    public void C() {
        StringBuilder sb = new StringBuilder("screen---refreshNotchLayout---------");
        f7f f7fVar = this.m4;
        sb.append(f7fVar.f);
        Log.v("MX.Screen", sb.toString());
        if (f7fVar.d && jnc.b().d(this)) {
            int dimension = (int) ((j1b) getResources()).a.getDimension(2131165727);
            int c2 = jnc.b().c(this);
            int a2 = jnc.b().a(this);
            int c3 = jnc.b().c(this);
            if (Build.VERSION.SDK_INT >= 28) {
                jnc.b().getClass();
                if (!Build.MANUFACTURER.toLowerCase().contains("vivo")) {
                    c3 = 0;
                }
            }
            View findViewById = this.S.findViewById(2131366066);
            View findViewById2 = this.S.findViewById(2131362347);
            ViewGroup.MarginLayoutParams b2 = yki.b(findViewById);
            ViewGroup.MarginLayoutParams b3 = yki.b(findViewById2);
            int i2 = f7fVar.f;
            if (i2 == 0) {
                sa(0, 0);
                if (b2 != null) {
                    b2.leftMargin = dimension;
                }
                if (b3 != null) {
                    b3.rightMargin = dimension;
                }
            } else if (i2 == 1) {
                sa(c3, 0);
                if (b2 != null) {
                    b2.leftMargin = c2 + dimension;
                }
                if (b3 != null) {
                    b3.rightMargin = a2 + dimension;
                }
            } else if (i2 == 3) {
                sa(0, c3);
                if (b2 != null) {
                    b2.leftMargin = a2 + dimension;
                }
                if (b3 != null) {
                    b3.rightMargin = c2 + dimension;
                }
            }
            if (b2 != null) {
                findViewById.setLayoutParams(b2);
            }
            if (b3 != null) {
                findViewById2.setLayoutParams(b3);
            }
            Z9();
            X9();
            W9();
            Y9();
        }
    }

    public final void C8() {
        if (this.d1 == null) {
            this.d1 = ((ViewStub) findViewById(2131364631)).inflate();
        }
        if (this.e1 == null) {
            this.e1 = this.d1.findViewById(2131367635);
        }
        sb();
    }

    public final boolean C9(cpa cpaVar, KeyEvent keyEvent) {
        int action = keyEvent.getAction();
        int keyCode = keyEvent.getKeyCode();
        if (keyCode != 66) {
            switch (keyCode) {
                case 23:
                    break;
                case 24:
                case 25:
                    if (action == 0) {
                        return q8(keyCode);
                    }
                    if (action == 1) {
                        return !xk4.g && s6d.M;
                    }
                    return true;
                default:
                    if (s6d.k0) {
                        if (keyCode != 79 && keyCode != 175 && keyCode != 222) {
                            switch (keyCode) {
                                default:
                                    switch (keyCode) {
                                    }
                                case 85:
                                case 86:
                                case 87:
                                case 88:
                                case 89:
                                case 90:
                                    n8(action, keyEvent, keyCode);
                                    return true;
                            }
                        }
                        n8(action, keyEvent, keyCode);
                        return true;
                    }
                    cpaVar.d(2);
                    return true;
            }
        }
        if (!xk4.i) {
            cpaVar.e(true);
        }
        return true;
    }

    public final void Ca(int i2, int i3) {
        Log.d("MX.Screen", "setSurfaceHolderSize: " + this.J0.getWidth() + " x " + this.J0.getHeight() + " --> " + i2 + " x " + i3);
        SurfaceHolder surfaceHolder = this.L0;
        if (surfaceHolder != null) {
            surfaceHolder.setFixedSize(i2, i3);
        }
    }

    public final void Cb() {
        com.mxtech.videoplayer.n nVar = this.V;
        if (nVar.I != null) {
            int i2 = this.h0;
            if (i2 == 99) {
                boolean z2 = this.b1;
                Display display = getDisplay();
                int i3 = 0;
                if (!z2 && xk4.b(this, display) == 8) {
                    i3 = 2;
                }
                nVar.K0(i3);
                if (this.X2 == null) {
                    a aVar = new a(this);
                    this.X2 = aVar;
                    aVar.enable();
                    return;
                }
                return;
            }
            nVar.K0(i2);
        }
        a aVar2 = this.X2;
        if (aVar2 != null) {
            try {
                aVar2.disable();
            } catch (IllegalArgumentException unused) {
            }
        }
    }

    public void D2(PlaybackController playbackController, int i2, int i3, boolean z2) {
        if (!((this.l0.getVisibleParts() & 5) == 1)) {
            Lb(i2, i3);
            if (t9()) {
                if (!z2) {
                    this.s3 = true;
                }
                Hb(false);
            } else {
                Hb(!z2);
            }
        }
        if ((i2 & 1) != 0 && this.V.b0()) {
            Da(this.V.L(), false);
        }
        if ((i2 & 2) != 0 && this.a0) {
            fb(true);
        }
        if (!M8() && h9() && this.n0 != null && this.m0 != null && s6d.U) {
            Ma();
            this.m0.setVisibility(4);
        }
        Ib();
        Ra(M8());
        View view = this.o4;
        if (view != null) {
            view.setVisibility(M8() ? 0 : 8);
        }
    }

    @Override
    public final void D3(com.mxtech.media.b bVar, int i2) {
        String O7;
        if (i2 >= 0 && i2 < 10000) {
            com.mxtech.media.b bVar2 = this.V.I;
            FFPlayer u2 = bVar2 != null ? bVar2.u() : null;
            if (u2 != null && (O7 = O7(i2, u2)) != null) {
                do2.z(0, tya.o.b.contains("custom_codec_checksum") ? "ACodec_custom" : "ACodec", "codec", O7);
            }
        }
        i30.v(bVar);
        h7(this, bVar);
    }

    public final void D8() {
        if (h9() && this.o0 == null) {
            RecyclerView findViewById = findViewById(2131365825);
            this.m0 = findViewById;
            ((androidx.recyclerview.widget.d0) findViewById.getItemAnimator()).g = false;
            this.m0.setLayoutManager(new LinearLayoutManager(0));
            qtf qtfVar = new qtf();
            this.o0 = qtfVar;
            this.m0.setAdapter(qtfVar);
            this.m0.setItemAnimator((RecyclerView.j) null);
            this.m0.m(this.M2);
            this.m0.l(new g());
        }
    }

    public final void Da(int i2, boolean z2) {
        boolean z3 = true;
        if (!z2 && (this.l0.getVisibleParts() & 1) == 0) {
            z3 = false;
        }
        if (z3) {
            this.P0.setProgress(i2);
        }
        if (z3 || s6d.e0) {
            va(i2, z3);
        }
        com.mxtech.videoplayer.n nVar = this.V;
        if (nVar != null) {
            N9(i2, nVar.w);
        }
    }

    public final void Db(boolean z2) {
        if (this.q0 == null || !this.V.b0()) {
            return;
        }
        if (this.q0.d && i9() && z2) {
            z6h.c(this, 2131891214, false);
        } else if (this.q0.d != i9()) {
            if (i9()) {
                z6h.c(this, 2131886406, false);
            }
            ub(this.q0, i9(), false);
        }
    }

    @Override
    public final void E3(int i2, int i3) {
        StringBuilder d2 = oe.d(i2, i3, "onVideoSizeChanged: ", "x", " (surface holder:");
        d2.append(this.L0);
        d2.append(")");
        Log.d("MX.Screen", d2.toString());
        if (i2 > 0 && i3 > 0) {
            int X7 = X7();
            if (X7 == 99999 && !this.E2) {
                ra(X7);
                if (i2 > i3) {
                    f7f f7fVar = this.m4;
                    if (f7fVar.e == 3) {
                        f7fVar.f = 3;
                    } else {
                        f7fVar.f = 1;
                    }
                    C();
                }
            }
            if (!this.y3) {
                this.y3 = true;
                aa();
                Db(false);
                supportInvalidateOptionsMenu();
            }
            if (this.L0 != null) {
                if (L.l().inKeyguardRestrictedInputMode()) {
                    this.D2 = true;
                } else {
                    yb();
                }
            }
        }
        if (this.M0 != null) {
            if (this.V.X()) {
                this.M0.setVideoSize(i2, i3);
            } else {
                this.M0.setVideoSize(-1, -1);
            }
        }
    }

    public final void E6(java.util.List<defpackage.am8> r10, zjb r11, android.net.Uri[] r12, int r13) {
        throw new UnsupportedOperationException("Method not decompiled: com.mxtech.videoplayer.ActivityScreen.E6(java.util.List, zjb, android.net.Uri[], int):void");
    }

    public final void E7(int i2) {
        if (i2 == 99999) {
            if (!this.V.a0()) {
                return;
            }
            com.mxtech.videoplayer.n nVar = this.V;
            int i3 = nVar.B;
            int i4 = nVar.C;
            i2 = (i3 == 0 || i4 == 0 || i3 == i4) ? 2 : i3 > i4 ? 6 : 7;
            this.E2 = true;
        }
        try {
            setRequestedOrientation(i2);
            this.E3 = i2;
        } catch (Exception e2) {
            Log.w("MX.Screen", "", e2);
        }
    }

    public final void E9(Uri uri, boolean z2, Map<String, String> map) {
        if (uri != null && Files.v(uri)) {
            File l2 = Files.l(uri);
            if (l2 != null) {
                F9(l2, z2);
                return;
            }
            return;
        }
        if (isFinishing() || !this.V.b0()) {
            return;
        }
        this.h4 = z2;
        this.i4 = true;
        this.V.j0(new Uri[]{uri}, null, null, false, map);
    }

    public final void Ea(boolean z2) {
        Log.d("MX.Screen", "Set fullscreen = " + z2);
        getWindow().setFlags(z2 ? 1024 : 0, SkinViewInflater.FLAG_BUTTON_TINT);
    }

    public final void Eb() {
        if (!this.d0 && this.V.X()) {
            q9();
        } else if (this.J0 != null) {
            r9();
        }
    }

    public final boolean F() {
        return this.V0 != null;
    }

    @Override
    public final void F0(zjb zjbVar, List list) {
        zjbVar.h = this.Q0.getSync();
        zjbVar.i = this.Q0.getSpeed();
        if (this.I1) {
            zjbVar.n = (short) 0;
            zjbVar.m = (short) 0;
            zjbVar.p = (short) 0;
            zjbVar.o = (short) 0;
            zjbVar.u = 1.0f;
            zjbVar.v = true;
            zjbVar.w = true;
        } else {
            z1j z1jVar = this.D1;
            zjbVar.m = (short) z1jVar.c;
            zjbVar.n = (short) z1jVar.d;
            zjbVar.o = (short) this.G1;
            zjbVar.p = (short) this.H1;
            zjbVar.u = z1jVar.n;
            zjbVar.v = z1jVar.o;
            zjbVar.w = z1jVar.p;
        }
        if (this.V.d0()) {
            return;
        }
        list.clear();
        am8[] allSubtitles = this.Q0.getAllSubtitles();
        int length = allSubtitles.length;
        if (length > 0) {
            zjbVar.t = new a[length];
            for (int i2 = 0; i2 < length; i2++) {
                am8 am8Var = allSubtitles[i2];
                String str = am8Var instanceof ku5 ? ((ku5) am8Var).b : null;
                xjg xjgVar = this.R0;
                String g2 = (xjgVar == null || am8Var == null) ? "" : xjgVar.g();
                a[] aVarArr = zjbVar.t;
                Uri a2 = am8Var.a();
                String m2 = am8Var.m();
                boolean z2 = ((SubView.b) this.Q0.d.get(i2)).b;
                a aVar = new a();
                aVar.a = a2;
                aVar.b = str;
                aVar.c = m2;
                aVar.d = z2;
                aVar.e = g2;
                aVarArr[i2] = aVar;
                list.add(am8Var);
            }
        }
    }

    public final void F7() {
        boolean z2 = false;
        if (s6d.q0 && this.V.F == 2) {
            z2 = true;
        }
        this.Q0.setSSARenderingMode(z2, this.V);
    }

    public final void F9(File file, boolean z2) {
        if (isFinishing() || !this.V.b0()) {
            return;
        }
        this.g4 = file.getParentFile();
        while (true) {
            int i2 = 2131887593;
            try {
                am8[] b2 = akg.b(file, null, this.V, null);
                if (b2.length > 0) {
                    List<am8> asList = Arrays.asList(b2);
                    if (!z2) {
                        this.V.w0(asList);
                    }
                    E6(asList, null, null, 5);
                    this.V.y0();
                    Kb();
                    return;
                }
            } catch (Throwable th) {
                if (!(th instanceof UnsupportedEncodingException)) {
                    i2 = th instanceof UnsupportedCharsetException ? 2131887592 : 2131887612;
                }
            }
            File file2 = this.g4;
            if (file2 != null && (file = akg.e(file2, file.getName())) == null) {
                ho4.a(i2, this);
                return;
            }
        }
    }

    public final void Fa(ZoomButton zoomButton) {
        z1j z1jVar = this.D1;
        if (z1jVar == null) {
            this.D1 = new z1j(zoomButton, this, z1jVar != null ? z1jVar.b : getIntent().hasExtra("video_zoom") ? getIntent().getIntExtra("video_zoom", 0) : tya.o.b.getInt("video_zoom", 1));
            return;
        }
        z1jVar.q = zoomButton;
        if (zoomButton != null) {
            if (z1jVar.t != null) {
                zoomButton.setOnLongClickListener(z1jVar);
            }
            z1jVar.q.setOnClickListener(z1jVar);
            z1jVar.q.getDrawable().setLevel(z1jVar.c(z1jVar.b));
        }
    }

    public final void Fb() {
        if (this.k0 != null) {
            if (this.Q0.j()) {
                ViewParent parent = this.Q0.getParent();
                TopLayout topLayout = this.S;
                if (parent == topLayout) {
                    topLayout.removeView(this.Q0);
                    this.k0.addView((View) this.Q0, 0);
                    return;
                }
                return;
            }
            ViewParent parent2 = this.Q0.getParent();
            RelativeLayout relativeLayout = this.k0;
            if (parent2 == relativeLayout) {
                relativeLayout.removeView(this.Q0);
                this.S.addView((View) this.Q0, h8(2));
            }
        }
    }

    public final void G6() {
        int i2;
        SubtitleOverlay subtitleOverlay = this.M0;
        if (subtitleOverlay != null && this.d0) {
            RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) subtitleOverlay.getLayoutParams();
            Point g2 = this.D1.g();
            int i3 = g2.x;
            if (i3 <= 0 || (i2 = g2.y) <= 0) {
                return;
            }
            layoutParams.width = i3;
            layoutParams.height = i2;
            int width = this.S.getWidth();
            int height = this.S.getHeight();
            layoutParams.leftMargin = ((width - layoutParams.width) / 2) + this.G1;
            layoutParams.topMargin = ((height - layoutParams.height) / 2) + this.H1;
            this.M0.requestLayout();
        }
    }

    public final void G7() {
        if (this.J0 != null) {
            this.J0.setBackgroundColor(Color.argb(Math.round(Color.alpha(-16777216) * 0.6f), Color.red(-16777216), Color.green(-16777216), Color.blue(-16777216)));
        }
    }

    public final boolean G9() {
        if (!this.e4) {
            Handler handler = this.O;
            if (handler.hasMessages(14)) {
                handler.removeMessages(14);
            }
            return false;
        }
        double R = this.V.R();
        double d2 = this.x2;
        if (R != d2) {
            this.V.I0(d2);
        }
        this.x2 = 1.0d;
        this.l0.d();
        Gb(false);
        this.e4 = false;
        return true;
    }

    public final void Ga(ZoomButton zoomButton, b bVar) {
        ZoomButton zoomButton2;
        z1j z1jVar;
        ZoomButton zoomButton3;
        ZoomButton zoomButton4;
        z1j z1jVar2;
        ZoomButton zoomButton5;
        if (bVar != null) {
            zoomButton.setEnabled(true);
            zoomButton.setImageResource(bVar.b);
            zoomButton.setColorFilter(com.mxtech.videoplayer.o.b().a());
            if (zoomButton.getId() == 2131365419 || zoomButton.getId() == 2131365420) {
                Drawable drawable = qm3.getDrawable(this, 2131233522);
                gl0.a(drawable, com.mxtech.videoplayer.o.b().k);
                zoomButton.setBackground(drawable);
            } else {
                zoomButton.setBackground(null);
            }
        } else {
            zoomButton.setEnabled(false);
            zoomButton.setImageDrawable(null);
            zoomButton.setBackground(null);
        }
        if (bVar == null) {
            zoomButton.setOnClickListener(null);
            zoomButton.setOnLongClickListener(null);
            z1j z1jVar3 = this.D1;
            if (z1jVar3 == null || (zoomButton2 = z1jVar3.q) == null || zoomButton2.getId() != zoomButton.getId() || (zoomButton3 = (z1jVar = this.D1).q) == null) {
                return;
            }
            zoomButton3.setOnClickListener(null);
            z1jVar.q.setOnLongClickListener(null);
            return;
        }
        int i2 = bVar.a;
        if (i2 == 10) {
            Fa(zoomButton);
            return;
        }
        z1j z1jVar4 = this.D1;
        if (z1jVar4 != null && (zoomButton4 = z1jVar4.q) != null && zoomButton4.getId() == zoomButton.getId() && (zoomButton5 = (z1jVar2 = this.D1).q) != null) {
            zoomButton5.setOnClickListener(null);
            z1jVar2.q.setOnLongClickListener(null);
        }
        if (i2 == 13) {
            hb();
        }
        zoomButton.setOnClickListener(new ch(0, this, bVar));
    }

    public final void Gb(boolean z2) {
        if (!z2) {
            this.G0.setVisibility(8);
            return;
        }
        RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) this.G0.getLayoutParams();
        int dimensionPixelSize = ((j1b) getResources()).a.getDimensionPixelSize(2131166209);
        if (this.q == 2) {
            dimensionPixelSize = ((j1b) getResources()).a.getDimensionPixelSize(2131165889);
        }
        layoutParams.topMargin = dimensionPixelSize;
        this.G0.setLayoutParams(layoutParams);
        this.G0.setVisibility(0);
        ((TextView) this.G0.findViewById(2131366312)).setText(getString(2131890461, new DecimalFormat("0.0").format(s6d.p1) + "X"));
    }

    @Override
    public final void H1() {
        if (this.V.b0()) {
            H8();
            xwh<am8> xwhVar = this.V.R;
            if (xwhVar.b.size() > 0) {
                E6(xwhVar, this.V.Z, Apps.d(getIntent(), "subs.enable"), s6d.p ? 1 : 0);
            }
        }
    }

    @Override
    public final void H5() {
        com.mxtech.videoplayer.n nVar = this.V;
        if (nVar != null) {
            boolean z2 = s6d.E;
            nVar.V0(z2 ? s6d.F : 0, z2);
        }
    }

    public final void H6(boolean z2) {
        Ta();
        com.mxtech.videoplayer.n nVar = this.V;
        if (nVar != null) {
            nVar.x0();
        }
        int i2 = s6d.W;
        if (i2 == -1 || i2 == 5 || i2 == 99999 || i2 == 2 || i2 == 3) {
            i2 = this.q == 2 ? 6 : 7;
        }
        ra(i2);
        if (z2) {
            invalidateOptionsMenu();
            Ha();
            z6h.c(this, 2131887523, false);
        }
    }

    public final void H8() {
        String[] strArr;
        com.mxtech.videoplayer.n nVar = this.V;
        if (nVar.W) {
            return;
        }
        nVar.W = true;
        boolean z2 = !nVar.X() && this.V.P == null;
        Intent intent = getIntent();
        Uri[] d2 = Apps.d(intent, "subs");
        if (d2 == null) {
            com.mxtech.videoplayer.n nVar2 = this.V;
            zjb zjbVar = nVar2.Z;
            String scheme = nVar2.o.getScheme();
            if (zjbVar != null && !"smb".equals(scheme)) {
                this.V.e0(z2);
                return;
            }
            HashMap hashMap = s4;
            List list = hashMap != null ? (List) hashMap.get(this.V.o) : null;
            if (list == null || list.isEmpty()) {
                this.V.e0(z2);
                return;
            }
            Uri[] uriArr = (Uri[]) list.toArray(new Uri[0]);
            HashMap hashMap2 = t4;
            this.V.j0(uriArr, null, null, false, hashMap2 != null ? (Map) hashMap2.get(this.V.o) : null);
            return;
        }
        String[] stringArrayExtra = intent.getStringArrayExtra("subs.name");
        String[] stringArrayExtra2 = intent.getStringArrayExtra("subs.filename");
        if (stringArrayExtra != null && stringArrayExtra.length != d2.length) {
            Log.e("MX.Screen", "`subs.name`(" + stringArrayExtra.length + ") has different size with `subs`(" + d2.length + ").");
            stringArrayExtra = null;
        }
        if (stringArrayExtra2 == null || stringArrayExtra2.length == d2.length) {
            strArr = stringArrayExtra2;
        } else {
            Log.e("MX.Screen", "`subs.filename`(" + stringArrayExtra2.length + ") has different size with `subs`(" + d2.length + ").");
            strArr = null;
        }
        this.V.j0(d2, stringArrayExtra, strArr, z2, null);
    }

    public final void H9(int i2, int i3) {
        if (this.a2 != i2) {
            d7(i2);
        }
        if (this.b2 != i3) {
            b7(i3);
        }
    }

    public final void Ha() {
        com.mxtech.videoplayer.n nVar;
        if (jz9.N(this) && this.q1 != null && this.r1 != null) {
            HashMap hashMap = new inb(this).c(this.q).b;
            b bVar = (b) hashMap.get(Integer.valueOf(this.q == 2 ? 4 : 2));
            b bVar2 = (b) hashMap.get(Integer.valueOf(this.q == 2 ? 5 : 3));
            boolean z2 = xk4.g;
            if (z2 && bVar2 != null && bVar2.a == 11) {
                bVar2 = null;
            }
            if (z2 || ((!L.r() && !L.s()) || (s6d.e1 & SkinViewInflater.FLAG_SWITCH_THUMB) == 0 || ((nVar = this.V) != null && !nVar.X()))) {
                if (bVar != null && bVar.a == 11) {
                    bVar = null;
                }
                if (bVar2 != null && bVar2.a == 11) {
                    bVar2 = null;
                }
            }
            if (bVar != null && bVar.a == 13) {
                this.s1 = this.q1;
            } else if (bVar2 == null || bVar2.a != 13) {
                this.s1 = null;
            } else {
                this.s1 = this.r1;
            }
            Ga(this.q1, bVar);
            Ga(this.r1, bVar2);
            if (this.D1 == null) {
                Fa(null);
            }
        }
        View findViewById = findViewById(2131365421);
        if (findViewById == null) {
            return;
        }
        if (this.q == 1) {
            findViewById.setVisibility(8);
        } else {
            findViewById.setVisibility(0);
        }
    }

    @android.annotation.SuppressLint({com.microsoft.identity.common.java.WarningType.NewApi})
    public final void Hb(boolean r11) {
        throw new UnsupportedOperationException("Method not decompiled: com.mxtech.videoplayer.ActivityScreen.Hb(boolean):void");
    }

    @Override
    public final void I2() {
        if (this.V.X() || this.V.d0()) {
            return;
        }
        w7();
    }

    public final boolean I7(boolean z2) {
        if (this.b3 < 0) {
            return false;
        }
        this.b3 = -1;
        if (this.V.b0()) {
            int i2 = this.V.w;
            int progress = this.P0.getProgress();
            if (z2 || (i2 > 0 && progress >= i2 - 1)) {
                com.mxtech.videoplayer.n nVar = this.V;
                nVar.z0(progress, nVar.O());
            }
            this.V.x0();
        }
        return true;
    }

    public void I9() {
        int videoStreamIndex;
        String O7;
        FFPlayer u2;
        int O;
        com.mxtech.videoplayer.n nVar = this.V;
        wfc wfcVar = nVar.m;
        boolean X = nVar.X();
        this.y3 = X;
        if (!X) {
            ba();
            x7();
        }
        int i2 = 0;
        boolean z2 = this.y3 && s6d.D1;
        this.Z0 = z2;
        PlaybackController playbackController = this.l0;
        playbackController.o = z2;
        Handler handler = playbackController.d;
        if (!z2) {
            handler.removeMessages(1);
        } else if (playbackController.f.L == 5) {
            handler.sendEmptyMessageDelayed(1, s6d.r(playbackController));
        }
        if (!this.Z0) {
            O3();
        }
        F7();
        if (wfcVar == null || wfcVar.l == null) {
            H8();
        }
        this.Q0.c();
        zjb zjbVar = this.V.Z;
        if (zjbVar != null) {
            this.Q0.setTranslation(zjbVar.h, zjbVar.i);
            this.V.G0(zjbVar.r, zjbVar.s);
        } else {
            this.Q0.setSync((int) (tya.o.b.getFloat("subtitle_default_sync", 0.0f) * 1000.0f));
            this.V.G0(-1, -1);
        }
        Cb();
        vb();
        xwh<am8> xwhVar = this.V.R;
        if (xwhVar.b.size() > 0) {
            E6(xwhVar, zjbVar, Apps.d(getIntent(), "subs.enable"), s6d.p ? 3 : 0);
        }
        if (tya.o.b.contains("aspect_ratio.h")) {
            this.V.A0(tya.o.b.getFloat("aspect_ratio.h", 0.0f), tya.o.b.getFloat("aspect_ratio.v", 0.0f), false);
        }
        Intent intent = getIntent();
        int intExtra = intent.getIntExtra("position", 0);
        if (intExtra > 0) {
            intent.removeExtra("position");
            com.mxtech.videoplayer.n nVar2 = this.V;
            Iterator it = this.Q0.d.iterator();
            while (true) {
                if (!it.hasNext()) {
                    O = this.V.O();
                    break;
                } else if (((SubView.b) it.next()).b) {
                    O = 6000;
                    break;
                }
            }
            nVar2.z0(intExtra, O);
        }
        this.a1 = false;
        ContentLoadingProgressBar contentLoadingProgressBar = this.T0;
        contentLoadingProgressBar.getClass();
        contentLoadingProgressBar.post(new n00(contentLoadingProgressBar, 3));
        ContentLoadingTextView contentLoadingTextView = this.U0;
        contentLoadingTextView.getClass();
        contentLoadingTextView.post(new x0(contentLoadingTextView, 2));
        SurfaceHolder surfaceHolder = this.L0;
        if (surfaceHolder != null && !this.V.f0) {
            surfaceHolder.setKeepScreenOn(false);
        }
        supportInvalidateOptionsMenu();
        if (!this.y3) {
            if (!this.V.d0()) {
                w7();
            }
            int X7 = X7();
            if (X7 == 99999 && !this.E2) {
                ra(X7);
            }
        }
        com.mxtech.media.b bVar = this.V.I;
        String str = TelemetryEventStrings.Value.UNKNOWN;
        if (bVar != null) {
            try {
                FFPlayer u3 = bVar.u();
                if (u3 != null && (bVar.c instanceof FFPlayer) && !u3.isOMXVideoDecoderUsed() && (videoStreamIndex = u3.getVideoStreamIndex()) >= 0) {
                    String O72 = O7(videoStreamIndex, u3);
                    if (TextUtils.isEmpty(O72)) {
                        O72 = TelemetryEventStrings.Value.UNKNOWN;
                    }
                    if (u3.isDecoderSupported(videoStreamIndex)) {
                        i30.u(0L, "checkVideoCodec", O72);
                    } else {
                        i30.u(1L, "checkVideoCodec", O72);
                    }
                }
            } catch (Exception e2) {
                gfh.c(e2);
            }
        }
        com.mxtech.videoplayer.n nVar3 = this.V;
        if (nVar3.F == 1) {
            h7(this, nVar3.I);
            i30.v(this.V.I);
        }
        com.mxtech.videoplayer.n nVar4 = this.V;
        String str2 = this.j0;
        com.mxtech.media.b bVar2 = nVar4.I;
        if (bVar2 != null && (u2 = bVar2.u()) != null && u2.b0()) {
            com.mxtech.media.a s2 = bVar2.s();
            String str3 = "";
            if (s2 instanceof FFPlayer) {
                FFPlayer fFPlayer = (FFPlayer) s2;
                int i3 = fFPlayer.A;
                if (i3 >= 0) {
                    try {
                        str3 = O7(i3, u2);
                    } catch (IndexOutOfBoundsException unused) {
                    }
                    if (!TextUtils.isEmpty(str3)) {
                        str = str3;
                    }
                    if (fFPlayer.isDecoderSupported(i3)) {
                        i30.c(0L, str, str2, nVar4.F);
                    } else {
                        i30.c(1L, str, str2, nVar4.F);
                    }
                }
            } else {
                int[] streamTypes = u2.getStreamTypes();
                int length = streamTypes.length;
                int i4 = 0;
                while (true) {
                    if (i4 >= length) {
                        break;
                    }
                    if (streamTypes[i4] == 1) {
                        try {
                            str3 = O7(i2, u2);
                        } catch (IndexOutOfBoundsException unused2) {
                        }
                        if (!TextUtils.isEmpty(str3)) {
                            str = str3;
                        }
                        if (u2.isDecoderSupported(i2) || s2.getAudioStream() > 0 || u2.getAudioStream() > 0) {
                            i30.c(0L, str, str2, nVar4.F);
                        } else {
                            i30.c(1L, str, str2, nVar4.F);
                        }
                    } else {
                        i2++;
                        i4++;
                    }
                }
            }
        }
        com.mxtech.media.b bVar3 = this.V.I;
        FFPlayer u5 = bVar3 != null ? bVar3.u() : null;
        if (u5 != null) {
            String format = u5.getFormat(0);
            if (format != null) {
                do2.z(0, tya.o.b.contains("custom_codec_checksum") ? "Format_custom" : "Format", "formatName", format);
            }
            int videoStreamIndex2 = u5.getVideoStreamIndex();
            if (videoStreamIndex2 >= 0 && (O7 = O7(videoStreamIndex2, u5)) != null) {
                do2.z(this.V.F, tya.o.b.contains("custom_codec_checksum") ? "VCodec_custom" : "VCodec", "codec", O7);
            }
        }
        V9();
    }

    public void Ia() {
        throw new UnsupportedOperationException("Method not decompiled: com.mxtech.videoplayer.ActivityScreen.Ia():void");
    }

    public final void Ib() {
        View view = this.d1;
        if (view != null) {
            boolean L8 = L8();
            int i2 = this.q;
            if (view == null) {
                return;
            }
            int c2 = i2 == 2 ? juh.c(2131166178, view.getContext()) : juh.c(2131165727, view.getContext());
            ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) view.getLayoutParams();
            Context context = view.getContext();
            marginLayoutParams.setMargins(c2, marginLayoutParams.topMargin, marginLayoutParams.rightMargin, L8 ? i2 == 2 ? juh.c(2131165643, context) : juh.c(2131165699, context) : i2 == 2 ? juh.c(2131165784, context) : juh.c(2131166040, context));
            view.setLayoutParams(marginLayoutParams);
        }
    }

    public final void J1(SubtitleOverlay subtitleOverlay) {
        this.S.removeView(subtitleOverlay);
        this.M0 = null;
    }

    public final void J6(android.content.Intent r12, android.net.Uri r13, android.os.Bundle r14) {
        throw new UnsupportedOperationException("Method not decompiled: com.mxtech.videoplayer.ActivityScreen.J6(android.content.Intent, android.net.Uri, android.os.Bundle):void");
    }

    public void J7() {
        startActivity(new Intent(getApplicationContext(), (Class<?>) ActivityPreferences.class));
    }

    public final void J8(boolean r14) {
        throw new UnsupportedOperationException("Method not decompiled: com.mxtech.videoplayer.ActivityScreen.J8(boolean):void");
    }

    public final void J9(boolean z2) {
        this.k1.setVisibility(z2 ? 0 : 8);
        this.j1.setVisibility(z2 ? 0 : 8);
        this.m1.setVisibility(z2 ? 0 : 8);
        this.l1.setVisibility(z2 ? 0 : 8);
        ZoomButton zoomButton = this.q1;
        if (zoomButton == null || this.F1 != 0) {
            return;
        }
        zoomButton.setVisibility((!z2 || this.q == 2) ? 0 : 8);
    }

    public final void Ja() {
        throw new UnsupportedOperationException("Method not decompiled: com.mxtech.videoplayer.ActivityScreen.Ja():void");
    }

    public final void Jb(StringBuilder sb) {
        String V7 = V7(sb);
        b1g b1gVar = L.t;
        if (b1gVar != null && !b1gVar.d) {
            Configuration configuration = ((j1b) getResources()).a.getConfiguration();
            Drawable drawable = ((j1b) getResources()).a.getDrawable((configuration.orientation != 2 || (configuration.screenLayout & 15) >= 3) ? 2131234320 : 2131234319);
            drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
            drawable.mutate().setAlpha(153);
            drawable.setColorFilter(com.mxtech.videoplayer.o.b().a());
            ImageSpan imageSpan = new ImageSpan(drawable, 1);
            int length = V7.length();
            SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(V7);
            spannableStringBuilder.append((CharSequence) "  ");
            spannableStringBuilder.setSpan(imageSpan, length + 1, length + 2, 33);
            V7 = spannableStringBuilder;
        }
        setTitle(V7);
    }

    @Override
    public final void K2(int i2) {
        StringBuilder sb = L.w;
        int i3 = i2 / TranslateInfo.MX_MAX_LENGTH;
        this.J1 = DateUtils.formatElapsedTime(sb, i3);
        this.K1 = i3;
        this.P0.setMax(i2);
        if (this.U1) {
            rb();
        } else {
            this.o1.setText(this.J1);
        }
        int dimensionPixelSize = this.J1.length() <= 5 ? ((j1b) getResources()).a.getDimensionPixelSize(2131166040) : this.J1.length() <= 7 ? ((j1b) getResources()).a.getDimensionPixelSize(2131166169) : ((j1b) getResources()).a.getDimensionPixelSize(2131166178);
        this.n1.getLayoutParams().width = dimensionPixelSize;
        this.n1.invalidate();
        this.o1.getLayoutParams().width = dimensionPixelSize;
        this.o1.invalidate();
    }

    public final void K4(CharSequence charSequence, Drawable drawable) {
        Ba(charSequence, drawable, false, true);
    }

    public final bz9 K7(int i2) {
        if (i2 == 21) {
            if (this.g3 == null) {
                this.g3 = new bz9(this, -1);
            }
            return this.g3;
        }
        if (i2 == 22) {
            if (this.f3 == null) {
                this.f3 = new bz9(this, 1);
            }
            return this.f3;
        }
        if (i2 == 89) {
            if (this.m3 == null) {
                this.m3 = new bz9(this, -1);
            }
            return this.m3;
        }
        if (i2 == 90) {
            if (this.l3 == null) {
                this.l3 = new bz9(this, 1);
            }
            return this.l3;
        }
        if (i2 == 102) {
            if (this.k3 == null) {
                this.k3 = new bz9(this, -3);
            }
            return this.k3;
        }
        if (i2 == 103) {
            if (this.j3 == null) {
                this.j3 = new bz9(this, 3);
            }
            return this.j3;
        }
        if (i2 == 106) {
            if (this.i3 == null) {
                this.i3 = new bz9(this, -1);
            }
            return this.i3;
        }
        if (i2 != 107) {
            return null;
        }
        if (this.h3 == null) {
            this.h3 = new bz9(this, 1);
        }
        return this.h3;
    }

    public final void K8(boolean z2) {
        if (isFinishing() || this.p.j() > 0 || !this.V.b0()) {
            return;
        }
        if (this.Q0.getSubtitleCount() > 0 && xk4.g) {
            new r();
        }
        if (xk4.g || this.E1 == null || this.Q0 == null || this.V == null) {
            return;
        }
        com.mxtech.videoplayer.menu.e eVar = new com.mxtech.videoplayer.menu.e();
        eVar.u = this.Q0;
        this.E1.c(eVar, z2);
    }

    public final void K9(boolean z2) {
        this.h1.setVisibility(z2 ? 0 : 8);
        this.i1.setVisibility(z2 ? 0 : 8);
    }

    public final void Ka(String str) {
        if (this.p.j() > 0 || !this.V.b0() || this.V == null) {
            return;
        }
        if (!xk4.g) {
            if (this.E1 != null) {
                bnb bnbVar = new bnb();
                bnbVar.h = this.V;
                bnbVar.i = str;
                this.E1.c(bnbVar, false);
                return;
            }
            return;
        }
        try {
            klh klhVar = new klh();
            this.i2 = klhVar;
            klhVar.b = this.V;
            klhVar.c = str;
            klhVar.show(getSupportFragmentManager(), "Equalizer");
        } catch (Exception e2) {
            gfh.c(e2);
            z6h.e("Equalizer error.", false);
        }
    }

    public final void Kb() {
        Lb(this.l0.getVisibleParts(), 0);
    }

    @Override
    public final boolean L0() {
        Fragment D;
        klh klhVar;
        boolean z2 = false;
        if (this.b3 >= 0) {
            return false;
        }
        if (i9()) {
            return true;
        }
        if (this.W1 || L.l().inKeyguardRestrictedInputMode()) {
            return false;
        }
        if (this.p.j() > 0 && ((klhVar = this.i2) == null || !klhVar.isResumed())) {
            return false;
        }
        bpb bpbVar = this.E1;
        if (bpbVar != null && (D = bpbVar.m.getSupportFragmentManager().D(2131362799)) != null && (D instanceof anb) && bpbVar.e()) {
            z2 = true;
        }
        return !z2;
    }

    @Override
    public final void L2(bn4 bn4Var) {
        if (bn4Var.j() == 0) {
            this.V.x0();
        }
        this.i2 = null;
        A9(bn4Var.j() != 0);
    }

    public final void L7() {
        throw new UnsupportedOperationException("Method not decompiled: com.mxtech.videoplayer.ActivityScreen.L7():void");
    }

    public final boolean L8() {
        return this.l0.getVisibleParts() != 0;
    }

    public final void La(a aVar, sm1 sm1Var) {
        C8();
        BottomPromotionControllerLayout bottomPromotionControllerLayout = this.e1;
        BottomBasePromotionView f2 = aVar.f(bottomPromotionControllerLayout.getContext(), sm1Var);
        int viewKey = f2.getViewKey();
        HashMap hashMap = bottomPromotionControllerLayout.b;
        if (!hashMap.containsKey(Integer.valueOf(viewKey))) {
            hashMap.put(Integer.valueOf(viewKey), f2);
            f2.setHideAction(new b8(bottomPromotionControllerLayout, 2));
            bottomPromotionControllerLayout.addView(f2);
            bottomPromotionControllerLayout.a();
        }
        Ib();
    }

    public final void Lb(int i2, int i3) {
        int i4;
        int i5;
        boolean z2 = true;
        if ((i2 & 2) != 0) {
            n6(i3 == 2);
        } else {
            f6(i3 == 2);
        }
        Bb();
        boolean j2 = this.Q0.j();
        boolean M8 = M8();
        SubtitlePanel subtitlePanel = this.N0;
        if (subtitlePanel != null) {
            SubtitlePanel.Bar bar = subtitlePanel.j;
            i4 = bar != null ? bar.getHeight() : 0;
            i5 = i4;
            if (!j2) {
                i4 = 0;
            }
        } else {
            i4 = 0;
            i5 = 0;
        }
        if (j2) {
            if (M8) {
                i4 += this.l0.getDefaultHeight();
            }
            i4 -= this.Q0.getPaddingBottom();
            if (i4 < 0) {
                i4 = 0;
            }
        }
        ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) this.l0.getLayoutParams();
        if (marginLayoutParams.bottomMargin != i5) {
            marginLayoutParams.bottomMargin = i5;
            this.l0.requestLayout();
        }
        ViewGroup.MarginLayoutParams marginLayoutParams2 = (ViewGroup.MarginLayoutParams) this.Q0.getLayoutParams();
        if (marginLayoutParams2.bottomMargin != i4) {
            marginLayoutParams2.bottomMargin = i4;
            this.Q0.requestLayout();
        }
        int i6 = M8 ? 2131362852 : this.N0 != null ? 2131362230 : 0;
        Iterator<df8> it = this.e2.iterator();
        int i7 = i6;
        int i8 = 0;
        while (it.hasNext()) {
            ViewGroup layout = it.next().getLayout();
            int[] rules = ((RelativeLayout.LayoutParams) layout.getLayoutParams()).getRules();
            if (i7 != 0) {
                rules[2] = i7;
                rules[12] = 0;
            } else {
                rules[2] = 0;
                rules[12] = -1;
            }
            if (z2) {
                rules[11] = -1;
                i8++;
                if (i8 == 2) {
                    i7 = i6;
                    z2 = false;
                } else {
                    i7 = layout.getId();
                }
            } else {
                rules[11] = 0;
                i7 = layout.getId();
            }
            layout.requestLayout();
        }
    }

    public final void M(boolean z2) {
        if (z2) {
            this.l0.d();
        } else {
            this.l0.h();
        }
    }

    public final boolean M6() {
        if (!this.V.b0()) {
            return false;
        }
        if (this.b3 >= 0) {
            return true;
        }
        this.b3 = this.V.L();
        this.c3 = -999999;
        return true;
    }

    public final BrightnessBar M7() {
        BrightnessBar findViewById = this.S.findViewById(2131362347);
        if (findViewById != null) {
            return findViewById;
        }
        View view = this.G3;
        if (view != null) {
            this.S.addView(view);
            return this.G3.findViewById(2131362347);
        }
        BrightnessBar findViewById2 = this.Q.inflate(2131558619, this.S).findViewById(2131362347);
        this.G3 = findViewById2;
        findViewById2.setScreen(this);
        return findViewById2;
    }

    public final boolean M8() {
        return (this.l0.getVisibleParts() & 5) == 5;
    }

    public final void Ma() {
        ArrayList arrayList = this.n0;
        if (arrayList == null || this.m0 == null) {
            return;
        }
        a f02 = this.m0.f0(arrayList.indexOf(this.z0));
        if (f02 instanceof a) {
            f02.r0();
            qtf qtfVar = this.o0;
            if (qtfVar == null || !qtfVar.l) {
                return;
            }
            qtfVar.l = false;
            qtfVar.notifyDataSetChanged();
        }
    }

    public final void Mb() {
        if (u9(s6d.T)) {
            if (this.L0 == null || !this.V.a0()) {
                return;
            }
            try {
                this.V.C0(this.L0, getDisplay(), 0);
                return;
            } catch (IllegalArgumentException e2) {
                Log.e("MX.Screen", "", e2);
                return;
            }
        }
        byte b2 = this.K0;
        if (b2 != 1 && b2 != 4) {
            this.V.C0(null, null, 8);
        } else {
            ba();
            x7();
        }
    }

    @Override
    public final void N2() {
        this.Q0.c();
        MenuItem menuItem = this.x1;
        if (menuItem != null) {
            menuItem.setVisible(false);
            this.x1.setEnabled(false);
        }
        SubtitlePanel subtitlePanel = this.N0;
        if (subtitlePanel != null) {
            subtitlePanel.b();
        }
        this.a3 = null;
    }

    public boolean N6() {
        if (!this.V.b0() || !this.V.X()) {
            return false;
        }
        if (!this.o2) {
            return !R6() && s6d.G() == 2;
        }
        this.o2 = false;
        return true;
    }

    public final void Na(int i2, boolean z2) {
        df8 S7 = S7(i2);
        ArrayList<df8> arrayList = this.e2;
        if (S7 != null) {
            if (z2) {
                S7.getLayout().requestFocus();
                return;
            } else {
                ViewGroup layout = S7.getLayout();
                ((ViewGroup) layout.getParent()).removeView(layout);
                arrayList.remove(S7);
            }
        } else {
            if (!z2) {
                return;
            }
            df8 v9 = v9(i2);
            arrayList.add(v9);
            v9.getLayout().requestFocus();
        }
        Kb();
        X9();
    }

    public final void Nb() {
        Ta();
        if (this.V.b0()) {
            com.mxtech.subtitle.service.f c8 = c8();
            c8.e();
            e u7 = u7();
            int i2 = ((rwf) u7.b).d;
            if (i2 > 0) {
                f.b[] bVarArr = (f.b[]) u7.toArray(new f.b[i2]);
                boolean z2 = this.Q0.getSync() != 0;
                androidx.appcompat.app.d dVar = c8.i;
                if (dVar != null) {
                    dVar.dismiss();
                    c8.i = null;
                }
                c8.new h(com.mxtech.subtitle.service.f.f(bVarArr), z2);
            }
        }
    }

    @Override
    public final void O1(KeyEvent keyEvent) {
        n8(keyEvent.getAction(), keyEvent, keyEvent.getKeyCode());
    }

    public void O3() {
        bpb bpbVar;
        if (!M8() && !T8() && ((bpbVar = this.E1) == null || !bpbVar.p)) {
            PlaybackController playbackController = this.l0;
            playbackController.setVisibleParts(-1, 2);
            playbackController.c();
            ImageButton imageButton = this.t1;
            if (imageButton != null) {
                imageButton.requestFocus();
            }
            if (h9()) {
                ArrayList arrayList = this.n0;
                if (arrayList != null && this.o0 != null && this.p0) {
                    Collections.sort(arrayList, new a());
                    this.o0.notifyDataSetChanged();
                }
                RecyclerView recyclerView = this.m0;
                if (recyclerView != null && this.o0 != null && s6d.U) {
                    LinearLayoutManager layoutManager = recyclerView.getLayoutManager();
                    if (layoutManager != null) {
                        layoutManager.w1(this.o0.i.size() - this.o0.d(), 0);
                    }
                    this.m0.setVisibility(0);
                }
            }
        }
        Ra(true);
    }

    public final void O9(int i2, int i3, int i4, String str, rlh rlhVar, a aVar) {
        if (this.E1 != null) {
            qmb qmbVar = new qmb();
            qmbVar.y = i4;
            qmbVar.z = new int[]{i2, 0};
            qmbVar.A = new int[]{i3, 0};
            qmbVar.B = str;
            qmbVar.h = aVar;
            qmbVar.C = rlhVar;
            bpb bpbVar = this.E1;
            bpbVar.d(qmbVar, ((j1b) bpbVar.m.getResources()).a.getDimensionPixelSize(2131166137), true);
        }
    }

    public final void Oa(double d2) {
        this.V.I0(d2);
        double R = this.V.R();
        kod S7 = S7(2131365390);
        if (S7 != null) {
            kod kodVar = S7;
            kodVar.d.setText(kodVar.f.format(100.0d * R));
        }
        if (this.d4 == null) {
            this.d4 = ((j1b) getResources()).a.getDrawable(2131235871);
        }
        StringBuilder sb = L.w;
        sb.setLength(0);
        sb.append(String.format("%.2f", Double.valueOf(R)));
        sb.append('x');
        A5(sb.toString());
    }

    public final void P1(am8 am8Var) {
        FFPlayer N = this.V.N();
        if (N != null) {
            N.V(am8Var);
        }
    }

    @Override
    public void P4(int r24, int r25, int r26) {
        throw new UnsupportedOperationException("Method not decompiled: com.mxtech.videoplayer.ActivityScreen.P4(int, int, int):void");
    }

    @Override
    public final void P6() {
        pa(getString(2131890536));
    }

    public final boolean P8() {
        return M8() || this.N0 != null || this.e2.size() > 0;
    }

    public final void P9() {
        if (!this.V.b0() || !this.V.X() || isFinishing() || this.E1 == null) {
            return;
        }
        rmb rmbVar = new rmb();
        com.mxtech.videoplayer.n nVar = this.V;
        z1j z1jVar = this.D1;
        rmbVar.h = nVar;
        rmbVar.i = z1jVar;
        this.E1.c(rmbVar, true);
    }

    public final void Pa() {
        Uri uri = this.V.o;
        if (uri != null && sgj.l(uri.toString())) {
            uri = null;
        }
        new ckg(this, this.p, uri, this.Q0.getSubtitleCount() > 0, this);
    }

    public boolean Q6() {
        if (!this.V.b0() || !this.V.X()) {
            return false;
        }
        if (!this.o2) {
            return !R6() && L.s() && s6d.G() == 2;
        }
        this.o2 = false;
        return true;
    }

    @Override
    public final void Q7(b3d b3dVar, String str) {
        char c2;
        boolean z2;
        boolean z3;
        SubStationAlphaMedia p2;
        if (str == null) {
        }
        switch (str.hashCode()) {
            case -2134478533:
                if (str.equals("display_seeking_position")) {
                    c2 = 0;
                    break;
                }
                c2 = 65535;
                break;
            case -2130845108:
                if (str.equals("interface_auto_hide")) {
                    c2 = 1;
                    break;
                }
                c2 = 65535;
                break;
            case -2085891459:
                if (str.equals("screen_orientation")) {
                    c2 = 2;
                    break;
                }
                c2 = 65535;
                break;
            case -2062656836:
                if (str.equals("navi_show_move_buttons")) {
                    c2 = 3;
                    break;
                }
                c2 = 65535;
                break;
            case -2026756383:
                if (str.equals("default_playback_speed")) {
                    c2 = 4;
                    break;
                }
                c2 = 65535;
                break;
            case -2002887168:
                if (str.equals("sticky_audio")) {
                    c2 = 5;
                    break;
                }
                c2 = 65535;
                break;
            case -1983850843:
                if (str.equals("sticky_video")) {
                    c2 = 6;
                    break;
                }
                c2 = 65535;
                break;
            case -1926120873:
                if (str.equals("subtitle_border_color")) {
                    c2 = 7;
                    break;
                }
                c2 = 65535;
                break;
            case -1774608526:
                if (str.equals("button_backlight_off")) {
                    c2 = '\b';
                    break;
                }
                c2 = 65535;
                break;
            case -1661509926:
                if (str.equals("playback_touch_action")) {
                    c2 = '\t';
                    break;
                }
                c2 = 65535;
                break;
            case -1648671133:
                if (str.equals("subtitle_scale")) {
                    c2 = '\n';
                    break;
                }
                c2 = 65535;
                break;
            case -1625193145:
                if (str.equals("improve_ssa_rendering")) {
                    c2 = 11;
                    break;
                }
                c2 = 65535;
                break;
            case -1617666793:
                if (str.equals("video_zoom")) {
                    c2 = '\f';
                    break;
                }
                c2 = 65535;
                break;
            case -1501707373:
                if (str.equals("subtitle_bkcolor")) {
                    c2 = '\r';
                    break;
                }
                c2 = 65535;
                break;
            case -1399387045:
                if (str.equals("video_zoom_delay")) {
                    c2 = 14;
                    break;
                }
                c2 = 65535;
                break;
            case -1363594690:
                if (str.equals("volume_boost")) {
                    c2 = 15;
                    break;
                }
                c2 = 65535;
                break;
            case -1171355494:
                if (str.equals("navi_move_interval")) {
                    c2 = 16;
                    break;
                }
                c2 = 65535;
                break;
            case -1154108890:
                if (str.equals("media_buttons")) {
                    c2 = 17;
                    break;
                }
                c2 = 65535;
                break;
            case -1069594120:
                if (str.equals("pause_if_obscured")) {
                    c2 = 18;
                    break;
                }
                c2 = 65535;
                break;
            case -954424000:
                if (str.equals("tv_mode")) {
                    c2 = 19;
                    break;
                }
                c2 = 65535;
                break;
            case -949907189:
                if (str.equals("italic_tag")) {
                    c2 = 20;
                    break;
                }
                c2 = 65535;
                break;
            case -905241840:
                if (str.equals("subtitle_typeface_style")) {
                    c2 = 21;
                    break;
                }
                c2 = 65535;
                break;
            case -724961813:
                if (str.equals("use_custom_popwindow")) {
                    c2 = 22;
                    break;
                }
                c2 = 65535;
                break;
            case -693423350:
                if (str.equals("screen_brightness_auto")) {
                    c2 = 23;
                    break;
                }
                c2 = 65535;
                break;
            case -693044695:
                if (str.equals("subtitle_shadow_enabled")) {
                    c2 = 24;
                    break;
                }
                c2 = 65535;
                break;
            case -667694992:
                if (str.equals("osd_text_color")) {
                    c2 = 25;
                    break;
                }
                c2 = 65535;
                break;
            case -664269157:
                if (str.equals("audio_effects_enabled")) {
                    c2 = 26;
                    break;
                }
                c2 = 65535;
                break;
            case -570462981:
                if (str.equals("subtitle_fit_overlay_to_video")) {
                    c2 = 27;
                    break;
                }
                c2 = 65535;
                break;
            case -529189437:
                if (str.equals("shortcuts_flag.3")) {
                    c2 = 28;
                    break;
                }
                c2 = 65535;
                break;
            case -438284523:
                if (str.equals("battery_clock_in_title_bar")) {
                    c2 = 29;
                    break;
                }
                c2 = 65535;
                break;
            case -295951080:
                if (str.equals("status_bar_show_always")) {
                    c2 = 30;
                    break;
                }
                c2 = 65535;
                break;
            case -268858280:
                if (str.equals("subtitle_text_color")) {
                    c2 = 31;
                    break;
                }
                c2 = 65535;
                break;
            case -151612022:
                if (str.equals("stereo_mode")) {
                    c2 = ' ';
                    break;
                }
                c2 = 65535;
                break;
            case -146320061:
                if (str.equals("show_left_time")) {
                    c2 = '!';
                    break;
                }
                c2 = 65535;
                break;
            case -127445846:
                if (str.equals("osd_back_color")) {
                    c2 = '\"';
                    break;
                }
                c2 = 65535;
                break;
            case -55336465:
                if (str.equals("shortcuts_enabled")) {
                    c2 = '#';
                    break;
                }
                c2 = 65535;
                break;
            case -36018744:
                if (str.equals("subtitle_bottom_padding.2")) {
                    c2 = '$';
                    break;
                }
                c2 = 65535;
                break;
            case 26323580:
                if (str.equals("subtitle_alignment")) {
                    c2 = '%';
                    break;
                }
                c2 = 65535;
                break;
            case 110066619:
                if (str.equals("fullscreen")) {
                    c2 = '&';
                    break;
                }
                c2 = 65535;
                break;
            case 115448781:
                if (str.equals("osd_background")) {
                    c2 = '\'';
                    break;
                }
                c2 = 65535;
                break;
            case 479586408:
                if (str.equals("subtitle_border_thickness")) {
                    c2 = '(';
                    break;
                }
                c2 = 65535;
                break;
            case 568373612:
                if (str.equals("http_user_agent.2")) {
                    c2 = ')';
                    break;
                }
                c2 = 65535;
                break;
            case 708258608:
                if (str.equals("subtitle_text_size.2")) {
                    c2 = '*';
                    break;
                }
                c2 = 65535;
                break;
            case 756440255:
                if (str.equals("correct_hw_aspect_ratio")) {
                    c2 = '+';
                    break;
                }
                c2 = 65535;
                break;
            case 949378860:
                if (str.equals("improve_stroke_rendering")) {
                    c2 = ',';
                    break;
                }
                c2 = 65535;
                break;
            case 1061519079:
                if (str.equals("custom_pip_control")) {
                    c2 = '-';
                    break;
                }
                c2 = 65535;
                break;
            case 1164026052:
                if (str.equals("status_show_always")) {
                    c2 = '.';
                    break;
                }
                c2 = 65535;
                break;
            case 1240838805:
                if (str.equals("subtitle_bkcolor_enabled")) {
                    c2 = '/';
                    break;
                }
                c2 = 65535;
                break;
            case 1497303360:
                if (str.equals("screen_rotation_button")) {
                    c2 = '0';
                    break;
                }
                c2 = 65535;
                break;
            case 1564413528:
                if (str.equals("keep_screen_on")) {
                    c2 = '1';
                    break;
                }
                c2 = 65535;
                break;
            case 1565066941:
                if (str.equals("show_prev_next")) {
                    c2 = '2';
                    break;
                }
                c2 = 65535;
                break;
            case 1615331941:
                if (str.equals("omxdecoder.alt")) {
                    c2 = '3';
                    break;
                }
                c2 = 65535;
                break;
            case 1679844069:
                if (str.equals("quick_zoom")) {
                    c2 = '4';
                    break;
                }
                c2 = 65535;
                break;
            case 1680545707:
                if (str.equals("drag_seek_speed")) {
                    c2 = '5';
                    break;
                }
                c2 = 65535;
                break;
            case 1735689732:
                if (str.equals("screen_brightness")) {
                    c2 = '6';
                    break;
                }
                c2 = 65535;
                break;
            case 1762644523:
                if (str.equals("subtitle_fadeout")) {
                    c2 = '7';
                    break;
                }
                c2 = 65535;
                break;
            case 1770588234:
                if (str.equals("osd_bottom")) {
                    c2 = '8';
                    break;
                }
                c2 = 65535;
                break;
            case 1864575285:
                if (str.equals("subtitle_border_enabled")) {
                    c2 = '9';
                    break;
                }
                c2 = 65535;
                break;
            case 1873242756:
                if (str.equals("ssa_font_ignore")) {
                    c2 = ':';
                    break;
                }
                c2 = 65535;
                break;
            case 1897077247:
                if (str.equals("subtitle_text_background_color_enabled")) {
                    c2 = ';';
                    break;
                }
                c2 = 65535;
                break;
            case 1920544902:
                if (str.equals("sync_system_volume")) {
                    c2 = '<';
                    break;
                }
                c2 = 65535;
                break;
            case 1967475786:
                if (str.equals("gestures")) {
                    c2 = '=';
                    break;
                }
                c2 = 65535;
                break;
            case 2048841036:
                if (str.equals("subtitle_typeface_name")) {
                    c2 = '>';
                    break;
                }
                c2 = 65535;
                break;
            case 2084975869:
                if (str.equals("subtitle_text_background_color")) {
                    c2 = '?';
                    break;
                }
                c2 = 65535;
                break;
            default:
                c2 = 65535;
                break;
        }
        switch (c2) {
            case 0:
                this.f0 = b3dVar.b.getBoolean("display_seeking_position", true);
                break;
            case 1:
                boolean z4 = false;
                if (this.V.b0() && this.V.X() && s6d.D1) {
                    z4 = true;
                }
                this.Z0 = z4;
                PlaybackController playbackController = this.l0;
                playbackController.o = z4;
                Handler handler = playbackController.d;
                if (z4) {
                    if (playbackController.f.L == 5) {
                        handler.sendEmptyMessageDelayed(1, s6d.r(playbackController));
                        break;
                    }
                } else {
                    handler.removeMessages(1);
                    break;
                }
                break;
            case 2:
                getIntent().removeExtra("orientation");
                ra(s6d.W);
                tb();
                break;
            case 3:
                J9(b3dVar.b.getBoolean("navi_show_move_buttons", false));
                break;
            case 4:
                Ab(tya.o.b.getInt("default_playback_speed", 100) / 100.0d);
                break;
            case 5:
                this.x3 = b3dVar.b.getBoolean("sticky_audio", true);
                Db(false);
                break;
            case 6:
                this.v3 = s6d.G();
                Db(false);
                boolean z5 = this.u instanceof ScreenToolbar;
                break;
            case 7:
                this.Q0.setBorderColor(s6d.G);
                break;
            case '\b':
                this.e0 = s6d.g();
                break;
            case '\t':
                lb();
                break;
            case '\n':
                Aa(s6d.x);
                break;
            case 11:
                F7();
                break;
            case '\f':
                int i2 = b3dVar.b.getInt("video_zoom", 1);
                this.V.E0(i2);
                z1j z1jVar = this.D1;
                z1jVar.k();
                z1jVar.m(i2, 0.0d, 0.0d, 1.0f, true, true);
                break;
            case '\r':
            case '/':
                if (s6d.I) {
                    this.Q0.setBackgroundColor(s6d.J);
                    break;
                } else {
                    this.Q0.setBackgroundDrawable(null);
                    break;
                }
            case 14:
                s6d.Q();
                break;
            case 15:
                com.mxtech.videoplayer.n nVar = this.V;
                if (nVar.I != null) {
                    nVar.a();
                    a8().e();
                    break;
                }
                break;
            case 16:
                TextView textView = this.l1;
                if (textView != null) {
                    textView.setText(Integer.toString(s6d.D0 / TranslateInfo.MX_MAX_LENGTH));
                }
                TextView textView2 = this.m1;
                if (textView2 != null) {
                    textView2.setText(Integer.toString(s6d.D0 / TranslateInfo.MX_MAX_LENGTH));
                    break;
                }
                break;
            case 17:
                ob();
                break;
            case 18:
                this.g0 = b3dVar.b.getBoolean(str, false);
                break;
            case 19:
            case '3':
                ja(-1, "user");
                finish();
                break;
            case 20:
                SubView subView = this.Q0;
                subView.v = s6d.s();
                subView.l();
                break;
            case 21:
            case '>':
                this.Q0.setTypeface(s6d.J(), s6d.C);
                com.mxtech.videoplayer.n nVar2 = this.V;
                if (nVar2.a0 != null) {
                    String K = s6d.K();
                    nVar2.d();
                    nVar2.o0(K, true);
                    break;
                }
                break;
            case 22:
                this.w3 = tya.o.b.getBoolean("use_custom_popwindow", true) ? 2 : 1;
                break;
            case 23:
                R(s6d.K ? -1.0f : s6d.L);
                break;
            case 24:
                SubView subView2 = this.Q0;
                boolean z6 = tya.o.b.getBoolean("subtitle_shadow_enabled", true);
                for (int childCount = subView2.getChildCount() - 1; childCount >= 0; childCount--) {
                    StrokeView childAt = subView2.getChildAt(childCount);
                    childAt.g = z6;
                    childAt.c();
                }
                break;
            case 25:
                d7(b3dVar.b.getInt("osd_text_color", -3355444));
                break;
            case 26:
                boolean z7 = s6d.Y0;
                ntf ntfVar = this.x0;
                if (ntfVar != null) {
                    ub(ntfVar, z7, false);
                    break;
                }
                break;
            case 27:
                this.d0 = b3dVar.b.getBoolean("subtitle_fit_overlay_to_video", true);
                if (this.M0 != null) {
                    Eb();
                    break;
                }
                break;
            case 28:
                vb();
                RecyclerView recyclerView = this.m0;
                if (recyclerView != null) {
                    recyclerView.setVisibility(s6d.U ? 0 : 4);
                    break;
                }
                break;
            case 29:
                if (this.B2 != null) {
                    boolean f2 = s6d.f();
                    this.a0 = f2;
                    MenuItem menuItem = this.B2;
                    if (menuItem != null) {
                        menuItem.setVisible(f2);
                    }
                    gb();
                    eb();
                    break;
                }
                break;
            case 30:
                if (s6d.y0) {
                    z2 = false;
                    if (b3dVar.b.getBoolean(str, false)) {
                        z3 = true;
                        this.Z = z3;
                        Hb(z2);
                        break;
                    }
                } else {
                    z2 = false;
                }
                z3 = z2;
                this.Z = z3;
                Hb(z2);
            case 31:
                this.Q0.setTextColor(s6d.D);
                break;
            case ' ':
                this.h0 = tya.o.b.getInt("stereo_mode", 0);
                Cb();
                break;
            case '!':
                boolean z8 = b3dVar.b.getBoolean("show_left_time", false);
                if (z8 != this.U1) {
                    xa(z8);
                    break;
                }
                break;
            case '\"':
                b7(b3dVar.b.getInt("osd_back_color", -2013265920));
                break;
            case '#':
                if (s6d.U) {
                    D8();
                    vb();
                }
                if (this.m0 != null) {
                    if (!s6d.U || !L8()) {
                        this.m0.setVisibility(4);
                        break;
                    } else {
                        this.m0.setVisibility(0);
                        break;
                    }
                }
                break;
            case '$':
                this.Q0.setSubtitlePadding(s6d.d0 * xk4.b);
                break;
            case '%':
                this.Q0.setGravity(s6d.H | 80);
                break;
            case '&':
                qa(s6d.n());
                break;
            case '\'':
                this.T1 = b3dVar.b.getBoolean(str, false);
                pb();
                break;
            case '(':
                float f3 = b3dVar.b.getFloat(str, 0.08f);
                this.Q0.setBorderThickness(f3, f3);
                break;
            case ')':
                U9();
                break;
            case '*':
                if (!T8()) {
                    this.Q0.setTextSize(b3dVar.b.getFloat("subtitle_text_size.2", 20.0f));
                    break;
                }
                break;
            case '+':
                com.mxtech.videoplayer.n nVar3 = this.V;
                com.mxtech.media.b bVar = nVar3.I;
                if (bVar != null) {
                    nVar3.W0(bVar.c.b(), nVar3.I.c.a(), false);
                    break;
                }
                break;
            case ',':
                this.Q0.h(s6d.p0);
                break;
            case '-':
                qb();
                break;
            case '.':
                this.Y = b3dVar.b.getBoolean(str, false);
                gb();
                Bb();
                break;
            case '0':
                tb();
                break;
            case '1':
                kb();
                break;
            case '2':
                K9(b3dVar.b.getBoolean(str, true));
                break;
            case '4':
                z1j z1jVar2 = this.D1;
                ZoomButton zoomButton = z1jVar2.q;
                if (zoomButton != null && zoomButton.getDrawable() != null) {
                    z1jVar2.q.getDrawable().setLevel(z1jVar2.c(z1jVar2.b));
                    break;
                }
                break;
            case '5':
                this.c0 = b3dVar.b.getFloat(str, 10.0f) * 100000.0f;
                break;
            case '6':
                R(s6d.K ? -1.0f : s6d.L);
                break;
            case '7':
                boolean z9 = b3dVar.b.getBoolean(str, false);
                this.Q0.setEnableFadeOut(z9);
                SubtitleOverlay subtitleOverlay = this.M0;
                if (subtitleOverlay != null) {
                    subtitleOverlay.setEnableFadeOut(z9);
                    break;
                }
                break;
            case '8':
                this.S1 = b3dVar.b.getBoolean(str, false);
                pb();
                break;
            case '9':
                int i3 = 1;
                SubView subView3 = this.Q0;
                boolean z10 = tya.o.b.getBoolean("subtitle_border_enabled", false);
                int childCount2 = subView3.getChildCount() - 1;
                while (childCount2 >= 0) {
                    subView3.getChildAt(childCount2).a(i3, z10, s6d.p0);
                    childCount2--;
                    i3 = 1;
                }
                break;
            case ':':
                com.mxtech.videoplayer.n nVar4 = this.V;
                String K2 = b3dVar.b.getBoolean(str, false) ? s6d.K() : null;
                nVar4.d();
                nVar4.o0(K2, true);
                break;
            case ';':
                SubView subView4 = this.Q0;
                if (subView4 != null) {
                    boolean z11 = s6d.E;
                    int i4 = z11 ? s6d.F : 0;
                    for (int childCount3 = subView4.getChildCount() - 1; childCount3 >= 0; childCount3--) {
                        subView4.getChildAt(childCount3).a(2, z11, s6d.p0);
                    }
                    subView4.setTextBackgroundColor(i4);
                }
                com.mxtech.videoplayer.n nVar5 = this.V;
                if (nVar5 != null) {
                    boolean z12 = s6d.E;
                    nVar5.V0(z12 ? s6d.F : 0, z12);
                    break;
                }
                break;
            case '<':
                com.mxtech.videoplayer.n nVar6 = this.V;
                if (nVar6.I != null) {
                    nVar6.S0();
                    break;
                }
                break;
            case '=':
                this.b0 = s6d.p(false);
                mb();
                break;
            case '?':
                SubView subView5 = this.Q0;
                if (subView5 != null) {
                    subView5.setTextBackgroundColor(s6d.E ? s6d.F : 0);
                }
                com.mxtech.videoplayer.n nVar7 = this.V;
                if (nVar7 != null && (p2 = nVar7.p(1, null)) != null) {
                    if (s6d.E) {
                        p2.overrideBackColor(s6d.F);
                        break;
                    } else {
                        p2.restoreBackColor();
                        break;
                    }
                }
                break;
        }
    }

    public final boolean Q8() {
        return TextUtils.equals(this.j0, "cloudonline") || TextUtils.equals(this.j0, "cloud_drive");
    }

    public final void Q9() {
        if (i9()) {
            if (tya.o.b.getBoolean("sticky_smooth_switch", false)) {
                getIntent();
            }
            if (L.l().inKeyguardRestrictedInputMode() && (this.V.F & 6) != 0) {
                ba();
            }
            this.Q0.c = 0;
            this.V.y0();
            this.W1 = true;
        }
        this.V.p0(7);
        if (L.l().inKeyguardRestrictedInputMode()) {
            ba();
        }
        this.Q0.c = 0;
        this.V.y0();
        this.W1 = true;
    }

    public final void Qa() {
        if (this.N0 == null) {
            ViewGroup viewGroup = (ViewGroup) this.T.getParent();
            SubView subView = this.Q0;
            LayoutInflater layoutInflater = this.Q;
            View.OnClickListener subtitlePanel = new SubtitlePanel(viewGroup, subView, this.p, layoutInflater, this, this.V.o);
            this.N0 = subtitlePanel;
            if (((SubtitlePanel) subtitlePanel).i == null) {
                ViewGroup viewGroup2 = (ViewGroup) layoutInflater.inflate(2131560366, viewGroup, false);
                ((SubtitlePanel) subtitlePanel).i = viewGroup2;
                ((SubtitlePanel) subtitlePanel).j = viewGroup2.findViewById(2131362230);
                ((SubtitlePanel) subtitlePanel).k = (ImageButton) ((SubtitlePanel) subtitlePanel).i.findViewById(2131364705);
                ((SubtitlePanel) subtitlePanel).l = (ViewGroup) ((SubtitlePanel) subtitlePanel).i.findViewById(2131366269);
                ImageButton imageButton = (ImageButton) ((SubtitlePanel) subtitlePanel).i.findViewById(R.id.closeButton);
                imageButton.setOnClickListener(subtitlePanel);
                TypedArray obtainStyledAttributes = subView.getContext().obtainStyledAttributes(new int[]{2130969007});
                try {
                    int color = obtainStyledAttributes.getColor(0, 0);
                    if (color != 0) {
                        PorterDuffColorFilter porterDuffColorFilter = new PorterDuffColorFilter(color, PorterDuff.Mode.SRC_ATOP);
                        ((SubtitlePanel) subtitlePanel).k.setColorFilter(porterDuffColorFilter);
                        imageButton.setColorFilter(porterDuffColorFilter);
                    }
                    obtainStyledAttributes.recycle();
                    ((SubtitlePanel) subtitlePanel).j.b = subtitlePanel;
                    ((SubtitlePanel) subtitlePanel).k.setOnClickListener(new fkg(subtitlePanel));
                    viewGroup.addView(((SubtitlePanel) subtitlePanel).i);
                } catch (Throwable th) {
                    obtainStyledAttributes.recycle();
                    throw th;
                }
            }
            Kb();
        }
    }

    public final void R(float f2) {
        xk4.j(getWindow(), f2);
        cpa cpaVar = this.V0;
        if (cpaVar != null) {
            ((WindowManager.LayoutParams) cpaVar.f.getLayoutParams()).screenBrightness = f2;
            cpaVar.f.requestLayout();
        }
        this.Q1 |= 1;
        la();
    }

    @Override
    public final void R0() {
        this.O.removeMessages(13);
        pa(null);
    }

    public final boolean R6() {
        PlayService playService;
        return i9() && (playService = PlayService.L0) != null && playService.d == null && (this.V.f0 || S6()) && this.V.b0();
    }

    public final void R9() {
        Ta();
        Uri uri = this.V.o;
        File parentFile = (uri == null || !Files.v(uri)) ? null : new File(uri.getPath()).getParentFile();
        if (parentFile == null) {
            parentFile = Environment.getExternalStorageDirectory();
        }
        Dialog z46Var = new z46(this);
        ((z46) z46Var).k = sgj.k(parentFile) ? tya.m.getResources().getString(2131889689) : null;
        z46Var.setCanceledOnTouchOutside(true);
        z46Var.setTitle(2131889423);
        ((z46) z46Var).h = (String[]) MediaExtensions.j.toArray(new String[0]);
        z46Var.m(parentFile);
        z46Var.setOnDismissListener(new l());
        this.p.h(z46Var);
        z46Var.show();
        z46Var.setOwnerActivity(this);
    }

    public void Ra(boolean r4) {
        throw new UnsupportedOperationException("Method not decompiled: com.mxtech.videoplayer.ActivityScreen.Ra(boolean):void");
    }

    public boolean S6() {
        return false;
    }

    public final df8 S7(int i2) {
        Iterator<df8> it = this.e2.iterator();
        while (it.hasNext()) {
            df8 next = it.next();
            if (next.getLayout().getId() == i2) {
                return next;
            }
        }
        return null;
    }

    public final void S9(int i2) {
        int i3 = this.c3;
        if (i2 < i3 - 500 || i2 > i3 + TranslateInfo.GOOGLE_MAX_LENGTH) {
            this.c3 = i2;
            this.V.z0(i2, -1);
        }
    }

    public final boolean T8() {
        return (Build.VERSION.SDK_INT >= 26 && isInPictureInPictureMode()) || this.R == 2;
    }

    public final void T9() {
        Ta();
        if (this.V.b0()) {
            com.mxtech.subtitle.service.f c8 = c8();
            c8.e();
            e u7 = u7();
            int i2 = ((rwf) u7.b).d;
            if (i2 > 0) {
                c8.l((f.b[]) u7.toArray(new f.b[i2]));
            }
        }
    }

    public final void Ta() {
        bpb bpbVar = this.E1;
        if (bpbVar != null) {
            bpbVar.g();
        }
    }

    @Override
    public final boolean U1() {
        return (this.F2 & 16) != 0;
    }

    public final void U6() {
        Handler handler = this.O;
        if (handler.hasMessages(14)) {
            handler.removeMessages(14);
        }
        this.e4 = false;
    }

    public final String U7() {
        return this.j0;
    }

    public final void U9() {
        c78 c78Var = this.P;
        synchronized (c78Var) {
            c78Var.e.clear();
        }
        c78 c78Var2 = this.P;
        String str = s6d.r;
        synchronized (c78Var2) {
            c78Var2.e.put("User-Agent", str);
        }
        String[] stringArrayExtra = getIntent().getStringArrayExtra("headers");
        if (stringArrayExtra != null) {
            if ((stringArrayExtra.length & 1) != 0) {
                Log.e("MX.Screen", "Incorrect header. header array should be packed by this order; key, value, key, value,...");
                return;
            }
            for (int i2 = 0; i2 < stringArrayExtra.length; i2 += 2) {
                c78 c78Var3 = this.P;
                String str2 = stringArrayExtra[i2];
                String str3 = stringArrayExtra[i2 + 1];
                synchronized (c78Var3) {
                    c78Var3.e.put(str2, str3);
                }
            }
        }
    }

    public final void Ua(Uri uri) {
        Uri j2 = d89.j(uri);
        Ta();
        if (!BH.n1(j2)) {
            j2 = kkb.o(j2);
        }
        if (j2.equals(this.V.o)) {
            return;
        }
        L9(j2);
        ab();
        nqd nqdVar = new nqd();
        this.f2 = nqdVar;
        nqdVar.h = true;
        ja(-1, "user");
        this.V.y0();
        this.V.h(0);
        Intent intent = getIntent();
        kgc.l(intent);
        Intent intent2 = new Intent("android.intent.action.VIEW", j2, tya.m, getClass());
        if (intent.hasExtra("decode_mode")) {
            intent2.putExtra("decode_mode", intent.getByteExtra("decode_mode", (byte) 0));
        }
        setIntent(intent2);
        U9();
        J6(intent2, j2, null);
    }

    @NonNull
    public final String V7(StringBuilder sb) {
        String stringExtra = getIntent().getStringExtra("title");
        return stringExtra != null ? stringExtra : sgj.h(this.V.o, sb);
    }

    public final boolean V8(int i2) {
        PlaybackController playbackController = this.l0;
        if (i2 >= ((View) playbackController.getParent()).getHeight() - playbackController.q) {
            return true;
        }
        ActionBar supportActionBar = getSupportActionBar();
        return supportActionBar != null && i2 < supportActionBar.f();
    }

    public final void V9() {
        try {
            BookmarkSeekBar bookmarkSeekBar = this.P0;
            if (bookmarkSeekBar != null) {
                bookmarkSeekBar.dots.clear();
                bookmarkSeekBar.invalidate();
                String decode = URLDecoder.decode(this.V.o.toString(), "utf-8");
                hh hhVar = new hh(this);
                ((b3b) s0b.d()).execute(new pk0(7, decode, hhVar));
            }
        } catch (Exception unused) {
        }
    }

    public final void W0(int i2, int i3) {
        com.mxtech.videoplayer.n nVar = this.V;
        nVar.U = i2;
        nVar.V = i3;
        SubStationAlphaMedia subStationAlphaMedia = nVar.T;
        if (subStationAlphaMedia != null) {
            subStationAlphaMedia.setCanvasSize(i2, i3);
        }
    }

    @Override
    public final boolean W5() {
        return true;
    }

    public int W7() {
        String string = tya.o.b.getString("playback.theme", null);
        if (string == null || string.length() <= 0) {
            string = tya.w().getString(2131887230);
        }
        return s6d.y(string);
    }

    public final boolean W8(float f2, float f3, float f4) {
        Layout layout;
        this.Q0.getLocationOnScreen(this.W3);
        float f5 = f2 - r1[0];
        float f6 = f3 - r1[1];
        if (this.Q0.getBackground() != null && f6 >= (-f4)) {
            return true;
        }
        float paddingTop = f5 + r1.getPaddingTop();
        float paddingLeft = f6 + r1.getPaddingLeft();
        StrokeView.a aVar = this.Q0.getCurrentView().c;
        if (aVar.length() == 0 || (layout = aVar.getLayout()) == null) {
            return false;
        }
        float paddingTop2 = paddingLeft - (r3.getPaddingTop() + aVar.getTotalPaddingTop());
        float f7 = -f4;
        if (paddingTop2 < f7 || paddingTop2 >= ((aVar.getHeight() - aVar.getTotalPaddingBottom()) - r3.getPaddingBottom()) + f4) {
            return false;
        }
        float scrollY = paddingTop2 + aVar.getScrollY();
        float paddingLeft2 = paddingTop - (r3.getPaddingLeft() + aVar.getTotalPaddingLeft());
        if (paddingLeft2 < f7 || paddingLeft2 >= ((aVar.getWidth() - aVar.getTotalPaddingRight()) - r3.getPaddingRight()) + f4) {
            return false;
        }
        float scrollX = paddingLeft2 + aVar.getScrollX();
        float f8 = 0.0f;
        float f9 = Float.MAX_VALUE;
        float f10 = Float.MAX_VALUE;
        float f11 = 0.0f;
        for (int lineCount = layout.getLineCount() - 1; lineCount >= 0; lineCount--) {
            f9 = Math.min(f9, layout.getLineLeft(lineCount));
            f10 = Math.min(f10, layout.getLineTop(lineCount));
            f8 = Math.max(f8, layout.getLineRight(lineCount));
            f11 = Math.max(f11, layout.getLineBottom(lineCount));
        }
        return f9 - f4 <= scrollX && scrollX < f8 + f4 && f10 - f4 <= scrollY && scrollY < f11 + f4;
    }

    public final void W9() {
        cpa cpaVar;
        if (jnc.b().d(this)) {
            int dimension = (int) ((j1b) getResources()).a.getDimension(2131165727);
            int c2 = jnc.b().c(this);
            int i2 = this.m4.f;
            if (i2 == 0) {
                cpa cpaVar2 = this.V0;
                if (cpaVar2 != null) {
                    cpaVar2.c(0, 0);
                    return;
                }
                return;
            }
            if (i2 != 1) {
                if (i2 == 3 && (cpaVar = this.V0) != null) {
                    cpaVar.c(-1, c2 + dimension);
                    return;
                }
                return;
            }
            cpa cpaVar3 = this.V0;
            if (cpaVar3 != null) {
                cpaVar3.c(c2 + dimension, -1);
            }
        }
    }

    public final void X() {
        this.Q1 |= 4;
        com.mxtech.videoplayer.n nVar = this.V;
        if (nVar.I != null) {
            nVar.a();
            a8().e();
        }
        la();
    }

    @Override
    public final void X4(boolean z2) {
        if (z2) {
            this.h2++;
            kb();
        } else {
            this.O.removeMessages(9);
            DialogInterface d2 = this.p.d(u.class);
            if (d2 != null) {
                d2.dismiss();
            }
            this.Q0.l();
            this.V.x0();
            this.h2--;
            kb();
        }
        jb();
        if (this.r2) {
            this.r2 = false;
            A7(4, false);
        }
    }

    public boolean X6() {
        return Q8() || TextUtils.equals(this.j0, "ins_video_stream");
    }

    public final int X7() {
        return getIntent().getIntExtra("orientation", s6d.W);
    }

    public final void X9() {
        if (jnc.b().d(this)) {
            int c2 = jnc.b().c(this);
            View findViewById = findViewById(2131367842);
            if (findViewById == null) {
                return;
            }
            ViewGroup.MarginLayoutParams b2 = yki.b(findViewById);
            int i2 = this.m4.f;
            if (i2 != 1) {
                if (i2 == 3 && b2 != null) {
                    b2.rightMargin = c2;
                }
            } else if (b2 != null) {
                b2.rightMargin = c2;
            }
            if (b2 != null) {
                findViewById.setLayoutParams(b2);
            }
        }
    }

    public final void Xa(int i2) {
        Ta();
        df8 S7 = S7(i2);
        ArrayList<df8> arrayList = this.e2;
        if (S7 != null) {
            ViewGroup layout = S7.getLayout();
            ((ViewGroup) layout.getParent()).removeView(layout);
            arrayList.remove(S7);
        } else {
            df8 v9 = v9(i2);
            arrayList.add(v9);
            v9.getLayout().requestFocus();
        }
        Kb();
    }

    @Override
    public final void Y1() {
        this.O.removeMessages(13);
        pa(null);
        if (isFinishing() || !this.V.b0()) {
            return;
        }
        if (this.i4) {
            ho4.a(2131887593, this);
        }
        this.i4 = false;
        this.h4 = false;
    }

    public final Object Y2() {
        return this.I0.getTag();
    }

    public final void Y6(@NonNull Intent intent) {
        Bundle extras;
        Uri data = intent.getData();
        if (data != null) {
            String stringExtra = intent.getStringExtra("mx_stream_url");
            if (TextUtils.isEmpty(stringExtra)) {
                intent.setData(kkb.o(data));
            } else {
                intent.setData(Uri.parse(stringExtra));
                if (TextUtils.isEmpty(intent.getStringExtra("download_url"))) {
                    intent.putExtra("download_url", data.toString());
                }
            }
        }
        if ("android.intent.action.SEND".equals(intent.getAction()) && (extras = intent.getExtras()) != null && extras.containsKey("android.intent.extra.STREAM")) {
            intent.setData(kkb.o((Uri) extras.getParcelable("android.intent.extra.STREAM")));
        }
        String stringExtra2 = intent.getStringExtra("fromSource");
        if (TextUtils.isEmpty(stringExtra2) && intent.getData() != null) {
            String uri = intent.getData().toString();
            if (Files.z(uri)) {
                stringExtra2 = "usb";
            } else if (p86.d(uri)) {
                stringExtra2 = "sd";
            } else {
                if (uri != null && uri.length() != 0) {
                    String lowerCase = uri.toLowerCase(Locale.ROOT);
                    if (StringsKt.B(lowerCase, "youtube.com/watch?v", false) || StringsKt.B(lowerCase, "youtu.be/", false)) {
                        stringExtra2 = "youtube";
                    }
                }
                Uri data2 = intent.getData();
                if (data2 != null) {
                    String scheme = data2.getScheme();
                    if ("http".equals(scheme) || AuthenticationConstants.HTTPS_PROTOCOL_STRING.equals(scheme)) {
                        stringExtra2 = "network_stream";
                    }
                }
                stringExtra2 = "local";
            }
        }
        this.j0 = stringExtra2;
    }

    public final void Y9() {
        if (jnc.b().d(this)) {
            int dimension = (int) ((j1b) getResources()).a.getDimension(2131165727);
            int c2 = jnc.b().c(this);
            ViewGroup.MarginLayoutParams b2 = yki.b((TableLayout) findViewById(2131365390));
            int i2 = this.m4.f;
            if (i2 == 0) {
                if (b2 != null) {
                    b2.rightMargin = 0;
                }
            } else if (i2 == 1) {
                if (b2 != null) {
                    b2.rightMargin = dimension;
                }
            } else if (i2 == 3 && b2 != null) {
                b2.rightMargin = c2 + dimension;
            }
        }
    }

    public final void Ya() {
        int i2 = 0;
        s6d.q = !s6d.q;
        ib();
        if (!s6d.q) {
            this.V.D0(-1);
            z6h.c(this, 2131890368, false);
            return;
        }
        this.V.D0(1);
        w8(2);
        gfh.d(new mdg("enhanceEnabled", weh.c));
        vpd vpdVar = this.w2;
        SurfaceView surfaceView = this.J0;
        jh jhVar = new jh(this, i2);
        vpdVar.getClass();
        ViewGroup viewGroup = (ViewGroup) surfaceView.getParent();
        EnhanceEffectView enhanceEffectView = new EnhanceEffectView(viewGroup.getContext(), (AttributeSet) null, 6, 0);
        enhanceEffectView.setLayoutParams(new ViewGroup.LayoutParams(-1, -1));
        enhanceEffectView.setTag("enhance");
        viewGroup.addView(enhanceEffectView);
        qpd qpdVar = new qpd(viewGroup, enhanceEffectView, jhVar);
        ArrayList arrayList = enhanceEffectView.B;
        Iterator it = arrayList.iterator();
        while (it.hasNext()) {
            ((ValueAnimator) it.next()).cancel();
        }
        arrayList.clear();
        enhanceEffectView.D = true;
        enhanceEffectView.E = 1.0f;
        enhanceEffectView.F = 0.0f;
        enhanceEffectView.G = 0.0f;
        enhanceEffectView.H = 0.0f;
        enhanceEffectView.I = 0.0f;
        enhanceEffectView.J = 0;
        enhanceEffectView.K = 0.0f;
        enhanceEffectView.invalidate();
        ValueAnimator ofFloat = ValueAnimator.ofFloat(enhanceEffectView.q, 1.0f);
        long j2 = enhanceEffectView.p;
        ofFloat.setDuration(j2);
        ofFloat.setInterpolator(new LinearInterpolator());
        ofFloat.addUpdateListener(new pd5(enhanceEffectView, 0));
        ValueAnimator ofFloat2 = ValueAnimator.ofFloat(0.0f, 1.0f);
        long j3 = enhanceEffectView.r;
        ofFloat2.setDuration(j3);
        long j4 = enhanceEffectView.s + j2;
        ofFloat2.setStartDelay(j4);
        ofFloat2.setInterpolator(new LinearInterpolator());
        ofFloat2.addUpdateListener(new qd5(enhanceEffectView));
        ValueAnimator ofFloat3 = ValueAnimator.ofFloat(0.0f, 1.0f);
        ofFloat3.setDuration(enhanceEffectView.t);
        ofFloat3.setStartDelay(j4 + j3);
        ofFloat3.addListener(new vd5(enhanceEffectView, qpdVar));
        ValueAnimator ofInt = ValueAnimator.ofInt(0, enhanceEffectView.w);
        ofInt.setDuration(enhanceEffectView.x);
        ofInt.setInterpolator(new LinearInterpolator());
        ofInt.addUpdateListener(new rd5(enhanceEffectView));
        ValueAnimator ofFloat4 = ValueAnimator.ofFloat(0.0f, 1.0f);
        ofFloat4.setDuration(enhanceEffectView.y);
        ofFloat4.setStartDelay(j2);
        ofFloat4.setInterpolator(new LinearInterpolator());
        ofFloat4.addUpdateListener(new sd5(enhanceEffectView));
        arrayList.add(ofFloat);
        arrayList.add(ofFloat2);
        arrayList.add(ofFloat3);
        arrayList.add(ofInt);
        arrayList.add(ofFloat4);
        ofFloat.start();
        ofFloat2.start();
        ofFloat3.start();
        ofInt.start();
        ofFloat4.start();
        while (true) {
            int i3 = enhanceEffectView.l;
            if (i2 >= i3) {
                return;
            }
            ValueAnimator ofFloat5 = ValueAnimator.ofFloat(0.0f, 1.0f);
            ofFloat5.setDuration(enhanceEffectView.o);
            ofFloat5.setStartDelay(i2 * enhanceEffectView.n);
            ofFloat5.setInterpolator(new LinearInterpolator());
            ofFloat5.addUpdateListener(new td5(enhanceEffectView, i2));
            if (i2 == i3 - 1) {
                ofFloat5.addListener(new ud5(enhanceEffectView));
            }
            arrayList.add(ofFloat5);
            ofFloat5.start();
            i2++;
        }
    }

    public final boolean Z2(am8 am8Var) {
        FFPlayer N = this.V.N();
        if (N != null) {
            return N.K(am8Var);
        }
        jb();
        return false;
    }

    public final void Z6(Uri[] uriArr, Uri uri) {
        finish();
        long L = this.V.L();
        CastActivity.r = uriArr;
        CastActivity.s = uri;
        CastActivity.t = L;
        startActivity(new Intent((Context) this, (Class<?>) CastActivity.class));
    }

    public final SoundBar Z7() {
        com.mxtech.media.b bVar = this.V.I;
        if (bVar == null || !bVar.isAudioPassthrough()) {
            return a8();
        }
        if (this.H3 == null) {
            Toast makeText = Toast.makeText(tya.w(), getString(2131886224), 0);
            this.H3 = makeText;
            z6h.a(makeText);
        }
        this.H3.show();
        return null;
    }

    public final void Za(int i2) {
        mdg mdgVar = new mdg("shortcutsClickedOnPlayer", weh.c);
        HashMap hashMap = mdgVar.b;
        hashMap.put("from", this.j0);
        hashMap.put("buttonName", (i2 < 0 || i2 >= 18) ? TelemetryEventStrings.Value.UNKNOWN : ntf.j[i2]);
        gfh.d(mdgVar);
    }

    @Override
    public final void a3(boolean z2, byte b2, byte b3) {
        if (isFinishing()) {
            return;
        }
        this.G2 = b3;
        if (!z2) {
            m9(null, 3, b3, SkinViewInflater.FLAG_SWITCH_THUMB);
            return;
        }
        this.H2 |= SkinViewInflater.FLAG_SWITCH_THUMB;
        int i2 = this.F2;
        if ((i2 & 16) != 0) {
            this.F2 = i2 & (-17);
            new h0(b2);
            return;
        }
        Log.i("MX.Screen", "Trying next decoder: " + ((int) b2) + " -> " + ((int) b3));
        n9();
    }

    public final void a7(byte b2) {
        ba();
        x7();
        com.mxtech.videoplayer.n nVar = this.V;
        nVar.getClass();
        if (((b2 & 6) == 0) == ((nVar.F & 6) != 0)) {
            nVar.e0 = true;
            nVar.j(7);
        } else if ((s6d.u & 1) != 0 && nVar.b0() && nVar.I.hasVideoTrack()) {
            nVar.r0();
        }
        nVar.D = (byte) (nVar.D | b2);
        nVar.F = b2;
        a8().e();
        ea();
        fa();
        ga();
        if (!this.V.a0()) {
            if (this.V.L != 0) {
                m9(null, 19, b2, 0);
            }
        } else {
            this.F2 |= 19;
            com.mxtech.videoplayer.n nVar2 = this.V;
            nVar2.getClass();
            nVar2.O = SystemClock.uptimeMillis() + 5000;
            k7();
            hb();
        }
    }

    @NonNull
    public final SoundBar a8() {
        com.mxtech.media.b bVar;
        SoundBar findViewById = this.S.findViewById(2131366066);
        if (findViewById == null) {
            View view = this.F3;
            if (view != null) {
                this.S.addView(view);
                findViewById = (SoundBar) this.F3.findViewById(2131366066);
            } else {
                findViewById = (SoundBar) this.Q.inflate(2131560328, this.S).findViewById(2131366066);
                this.F3 = findViewById;
                findViewById.setScreen(this);
            }
        }
        findViewById.d((!s6d.O || (bVar = this.V.I) == null || (bVar.N() & 4) == 0) ? false : true);
        return findViewById;
    }

    public final void aa() {
        ImageView imageView = this.t3;
        if (imageView != null) {
            this.S.removeView(imageView);
            this.t3 = null;
        }
        this.u3 = null;
    }

    public final void ab() {
        if (this.V != null) {
            if (this.k4 != 0) {
                this.j4 = (SystemClock.elapsedRealtime() - this.k4) + this.j4;
                this.k4 = 0L;
            }
            try {
                M9(this.j4);
                Wa();
                String uri = this.V.o.toString();
                long j2 = this.j4;
                weh.k(uri, "" + this.V.w, "" + this.V.L(), this.j0, j2);
                this.j4 = 0L;
            } catch (Exception unused) {
            }
        }
    }

    public final void b1(File file, String str, String str2, TranslateInfo translateInfo) {
        vih vihVar = this.S0;
        if (vihVar != null && !vihVar.isCancelled()) {
            this.S0.cancel(true);
        }
        P6();
        vih vihVar2 = new vih(file, str, str2, translateInfo, this);
        this.S0 = vihVar2;
        vihVar2.executeOnExecutor(s0b.e(), new Void[0]);
    }

    public final void b7(int i2) {
        boolean z2;
        this.b2 = i2;
        View view = this.y2;
        boolean z3 = true;
        if (view != null) {
            view.setBackgroundDrawable(null);
            z2 = true;
        } else {
            z2 = false;
        }
        TextView textView = this.g1;
        if (textView != null) {
            textView.setBackgroundDrawable(null);
            z2 = true;
        }
        q qVar = this.f1;
        if (qVar != null) {
            qVar.setBackgroundDrawable((Drawable) null);
        } else {
            z3 = z2;
        }
        if (z3) {
            pb();
        }
    }

    public final void ba() {
        this.V.C0(null, null, 2);
        SurfaceView surfaceView = this.J0;
        if (surfaceView != null) {
            this.S.removeView(surfaceView);
            this.J0 = null;
        }
        SurfaceHolder surfaceHolder = this.L0;
        if (surfaceHolder != null) {
            surfaceHolder.removeCallback(this);
            this.L0 = null;
        }
    }

    public void bb(int i2, boolean z2) {
        if (this.b3 < 0) {
            Da(i2, false);
        }
        SubView subView = this.Q0;
        if (subView.c == 0) {
            subView.f((int) ((i2 - subView.m) * subView.n), 0, false, z2);
        }
    }

    @Override
    public final int c1() {
        return this.q;
    }

    @Override
    @SuppressLint({"InflateParams"})
    public boolean c6(MenuItem menuItem) {
        oab r2;
        com.mxtech.media.b bVar;
        if (isFinishing()) {
            return true;
        }
        int itemId = menuItem.getItemId();
        if (itemId == 16908332) {
            ja(-1, "user");
            try {
                super.onBackPressed();
            } catch (IllegalStateException unused) {
                finish();
            }
            return true;
        }
        if (itemId == 2131362975) {
            new s().a();
            do2.a0("decoder", "screen", this.j0);
            return true;
        }
        if (itemId == 2131365353) {
            do2.a0("pip", "screen", this.j0);
            q7();
            return true;
        }
        if (itemId == 2131362137 || itemId == 2131362153) {
            if (itemId == 2131362137) {
                do2.a0("audio", "screen", this.j0);
            }
            J8(false);
            return true;
        }
        if (itemId == 2131362170) {
            Xa(2131362171);
            return true;
        }
        if (itemId == 2131365248) {
            R9();
            return true;
        }
        if (itemId == 2131366138 || itemId == 2131365686 || itemId == 2131362182 || itemId == 2131364873) {
            SharedPreferences.Editor edit = tya.o.b.edit();
            if (itemId == 2131365686) {
                r11 = 2;
            } else if (itemId == 2131362182) {
                r11 = 99;
            } else if (itemId == 2131364873) {
                r11 = 1;
            }
            edit.putInt("stereo_mode", r11);
            edit.apply();
            return true;
        }
        if (itemId == 2131362192) {
            SharedPreferences.Editor edit2 = tya.o.b.edit();
            edit2.putBoolean("av_sync", !s6d.v);
            edit2.apply();
            return true;
        }
        if (itemId == 2131363523) {
            SharedPreferences.Editor edit3 = tya.o.b.edit();
            edit3.putBoolean("fix_broken_audio", !s6d.w);
            edit3.apply();
            if (this.V.b0() && (bVar = this.V.I) != null) {
                com.mxtech.media.a s2 = bVar.s();
                if (s2 instanceof FFPlayer) {
                    ((FFPlayer) s2).enableFixBrokenAudio(s6d.w);
                }
            }
            return true;
        }
        if (itemId == 2131363290) {
            Ka("audio");
        } else {
            if (itemId == 2131362467) {
                do2.a0("subtitle", "screen", this.j0);
                K8(false);
                return true;
            }
            if (itemId == 2131365251) {
                Pa();
                return true;
            }
            if (itemId == 2131365252) {
                new y();
                return true;
            }
            if (itemId == 2131365980) {
                s6d.G0 = !s6d.G0;
                SharedPreferences.Editor edit4 = tya.o.b.edit();
                edit4.putBoolean("shuffle", s6d.G0);
                edit4.apply();
                xb();
                return true;
            }
            if (itemId == 2131364770) {
                SharedPreferences.Editor edit5 = tya.o.b.edit();
                edit5.putInt("loop.2", s6d.H0 != 9 ? 9 : 0);
                edit5.apply();
                nb();
                return true;
            }
            if (itemId == 2131364771) {
                SharedPreferences.Editor edit6 = tya.o.b.edit();
                edit6.putInt("loop.2", s6d.H0 != 1 ? 1 : 0);
                edit6.apply();
                nb();
                return true;
            }
            if (itemId == 2131366140) {
                if (!this.z3 || this.A3) {
                    this.z3 = true;
                    this.A3 = false;
                } else {
                    this.z3 = false;
                    this.A3 = true;
                }
                Db(false);
                return true;
            }
            if (itemId == 2131367840) {
                do2.a0("zoom", "screen", this.j0);
                this.D1.j();
                return true;
            }
            bn4 bn4Var = this.p;
            if (itemId == 2131362133) {
                if (!isFinishing() && bn4Var.j() <= 0 && this.V.b0()) {
                    new xo0(this, this.D1);
                }
                return true;
            }
            if (itemId == 2131362625) {
                do2.a0("chapter", "screen", this.j0);
                n7();
                return true;
            }
            if (itemId == 2131365752) {
                p9(menuItem.isChecked());
                tb();
                return true;
            }
            if (itemId == 2131365957) {
                SharedPreferences.Editor edit7 = tya.o.b.edit();
                boolean z2 = !s6d.U;
                s6d.U = z2;
                edit7.putBoolean("shortcuts_enabled", z2);
                edit7.apply();
                return true;
            }
            if (itemId == 2131367582) {
                boolean u9 = u9(s6d.T);
                getIntent().removeExtra("video");
                SharedPreferences.Editor edit8 = tya.o.b.edit();
                boolean z3 = !u9;
                edit8.putBoolean("video", z3);
                edit8.apply();
                if (u9 != u9(z3)) {
                    Mb();
                }
                return true;
            }
            if (itemId == 2131362983) {
                com.mxtech.media.b bVar2 = this.V.I;
                if (bVar2 != null) {
                    int processing = bVar2.c.getProcessing() & (-4);
                    if (!menuItem.isChecked()) {
                        processing |= 1;
                    }
                    bVar2.setProcessing(processing);
                }
                return true;
            }
            if (itemId == 2131362982) {
                com.mxtech.media.b bVar3 = this.V.I;
                if (bVar3 != null) {
                    int processing2 = bVar3.c.getProcessing() & (-4);
                    if (!menuItem.isChecked()) {
                        processing2 |= 2;
                    }
                    bVar3.setProcessing(processing2);
                }
                return true;
            }
            if (itemId == 2131367434) {
                SharedPreferences.Editor edit9 = tya.o.b.edit();
                edit9.putBoolean("use_speedup_tricks", !s6d.J0);
                edit9.apply();
                return true;
            }
            if (itemId == 2131365547) {
                ja(-1, "user");
                com.mxtech.videoplayer.f.V(null);
                return true;
            }
            if (itemId == 2131363014) {
                if (this.V.b0()) {
                    fh8 e2 = this.V.I.e();
                    try {
                        try {
                            r2 = oab.r();
                        } catch (SQLiteException e3) {
                            Log.e("MX.Screen", "", e3);
                            ho4.a(2131887584, this);
                        }
                        try {
                            int i2 = getIntent().getBooleanExtra("secure_uri", false) ? 10 : 2;
                            ubb ubbVar = new ubb();
                            com.mxtech.videoplayer.n nVar = this.V;
                            ubbVar.r9(nVar.o, e2, nVar.I, this, r2, i2, (String) null);
                            FragmentManager supportFragmentManager = getSupportFragmentManager();
                            supportFragmentManager.getClass();
                            androidx.fragment.app.a aVar = new androidx.fragment.app.a(supportFragmentManager);
                            aVar.f(0, ubbVar, "entry_property_dialog", 1);
                            aVar.j(true);
                        } finally {
                            r2.getClass();
                        }
                    } finally {
                        e2.close();
                    }
                }
                return true;
            }
            if (itemId == 2131365650) {
                Xa(2131365651);
                return true;
            }
            if (itemId == 2131366289) {
                ma();
                return true;
            }
            if (itemId == 2131366285) {
                T9();
                return true;
            }
            if (itemId == 2131366296) {
                Nb();
                return true;
            }
            if (itemId == 2131366293) {
                Xa(2131366294);
                return true;
            }
            if (itemId == 2131366291) {
                Xa(2131366292);
                return true;
            }
            if (itemId == 2131366284) {
                if (this.N0 != null) {
                    y8();
                } else {
                    Qa();
                }
                return true;
            }
            if (itemId == 2131366290) {
                Ta();
                if (bn4Var.j() <= 0) {
                    L7();
                    B5(new com.mxtech.videoplayer.preference.b(this, this, bn4Var, 1));
                }
                return true;
            }
            if (itemId == 2131366700) {
                Ta();
                if (bn4Var.j() <= 0) {
                    L7();
                    B5(new com.mxtech.videoplayer.preference.b(this, this, bn4Var, 0));
                }
                return true;
            }
            if (itemId == 2131365389) {
                Xa(2131365390);
                Y9();
                return true;
            }
            if (itemId == 2131365455) {
                try {
                    J7();
                } catch (Exception e4) {
                    Log.e("MX.Screen", "", e4);
                }
                return true;
            }
            if (itemId == 2131364737) {
                v vVar = this.B3;
                if (vVar != null) {
                    vVar.a(false);
                }
                return true;
            }
            if (itemId == 2131365935) {
                Ia();
                return true;
            }
            if (itemId == 2131362984) {
                new w();
                return true;
            }
            if (itemId == 2131365644) {
                new x();
                return true;
            }
            if (itemId == 2131366019) {
                new y0g(this);
                return true;
            }
            if (((com.mxtech.videoplayer.f) getApplication()).P(this, itemId, null)) {
                return true;
            }
            if (itemId == 2131365427) {
                do2.a0("playlist", "screen", this.j0);
                r7(false);
                return true;
            }
        }
        return super.c6(menuItem);
    }

    @Override
    public final void c7(File file) {
        F9(file, false);
    }

    public final com.mxtech.subtitle.service.f c8() {
        if (this.O0 == null) {
            com.mxtech.subtitle.service.f fVar = new com.mxtech.subtitle.service.f(this, 85);
            this.O0 = fVar;
            fVar.g = this;
        }
        return this.O0;
    }

    @SuppressLint({"InlinedApi"})
    public final void ca() {
        this.F2 = 1;
        Da(0, false);
        com.mxtech.videoplayer.n nVar = this.V;
        switch (nVar.L) {
            case 1:
                nVar.j.P4(1, 0, 0);
                break;
            case 2:
                nVar.j.P4(1, 0, 0);
                nVar.j.P4(2, 0, 0);
                break;
            case 3:
                nVar.j.P4(1, 0, 0);
                nVar.j.P4(2, 0, 0);
                nVar.j.P4(3, 0, 0);
                break;
            case 4:
                nVar.j.P4(1, 0, 0);
                nVar.j.P4(2, 0, 0);
                nVar.j.P4(3, 0, 0);
                nVar.j.P4(4, 0, 0);
                break;
            case 5:
                nVar.j.P4(1, 0, 0);
                nVar.j.P4(2, 0, 0);
                nVar.j.P4(3, 0, 0);
                nVar.j.P4(5, 0, 0);
                break;
            case 6:
                nVar.j.P4(6, 0, 0);
                break;
        }
        int i2 = nVar.w;
        if (i2 > 0) {
            nVar.j.K2(i2);
            emb embVar = nVar.k;
            if (embVar != null) {
                embVar.p9(nVar.w);
            }
        }
        nVar.U0(true);
        this.F2 = 0;
    }

    public final void cb(Uri uri) {
        if (uri != null) {
            if (kkb.i(uri)) {
                this.B1 = true;
                this.C1 = uri.toString();
            } else {
                this.B1 = false;
                this.C1 = null;
            }
        }
    }

    public final boolean d1() {
        return tya.o.b.getBoolean("headset_show_system_volume_ui", true) && this.b1;
    }

    @Override
    public final void d2(int i2) {
        if (i2 == 0 || i2 == 2) {
            this.Q0.setSSARenderingMode(false, this.V);
        }
    }

    public final void d4() {
        Fb();
        Kb();
        jb();
    }

    @Override
    public void d6(int i2) {
        y0g d2;
        Bitmap A;
        j6(i2);
        z1j z1jVar = this.D1;
        int i3 = 0;
        if (z1jVar != null) {
            this.G1 = 0;
            this.H1 = 0;
            this.I1 = false;
            z1jVar.a();
        }
        com.mxtech.videoplayer.n nVar = this.V;
        if (nVar != null && !nVar.X() && this.t3 != null && this.u3 != (A = this.V.A(this.q))) {
            this.t3.setImageBitmap(A);
            this.u3 = A;
        }
        if (L.t != null) {
            Jb(L.w);
        }
        if (!isFinishing() && (d2 = this.p.d(y0g.class)) != null) {
            d2.dismiss();
            new y0g(this);
        }
        invalidateOptionsMenu();
        Ha();
        ua(i2);
        boolean u2 = s6d.u();
        ZoomButton zoomButton = this.q1;
        if (zoomButton == null || this.F1 != 0) {
            return;
        }
        if (u2 && this.q != 2) {
            i3 = 8;
        }
        zoomButton.setVisibility(i3);
    }

    public final void d7(int i2) {
        this.a2 = i2;
        TextView textView = this.g1;
        if (textView != null) {
            textView.setTextColor(i2);
        }
        View view = this.y2;
        if (view != null) {
            if (view.getLayoutParams() instanceof RelativeLayout.LayoutParams) {
                ya(this.a2);
            } else {
                ya(-3355444);
            }
        }
        AppCompatTextView appCompatTextView = this.f1;
        if (appCompatTextView != null) {
            appCompatTextView.setTextColor(i2);
        }
    }

    public final void db(TextView textView, RelativeLayout.LayoutParams layoutParams) {
        boolean z2 = true;
        boolean z3 = false;
        int i2 = !s6d.e0 || !this.S1 ? 0 : -1;
        int[] rules = layoutParams.getRules();
        if (rules[12] != -1) {
            rules[12] = -1;
            z3 = true;
        }
        if (rules[14] != i2) {
            rules[14] = i2;
        } else {
            z2 = z3;
        }
        if (z2) {
            textView.requestLayout();
        }
    }

    public final boolean dispatchKeyEvent(KeyEvent keyEvent) {
        this.l0.c();
        if (l8(keyEvent.getAction(), keyEvent, keyEvent.getKeyCode())) {
            return true;
        }
        return super.dispatchKeyEvent(keyEvent);
    }

    @Override
    public final boolean dispatchTouchEvent(MotionEvent motionEvent) {
        if (this.Z0) {
            this.l0.c();
            Handler handler = this.O;
            if (handler.hasMessages(6)) {
                handler.removeMessages(6);
                handler.sendEmptyMessageDelayed(6, s6d.r(this));
            }
        }
        return super.dispatchTouchEvent(motionEvent);
    }

    public final boolean dispatchTrackballEvent(MotionEvent motionEvent) {
        if (this.p.j() > 0) {
            return super/*android.app.Activity*/.dispatchTrackballEvent(motionEvent);
        }
        this.l0.c();
        int action = motionEvent.getAction();
        if (action == 0) {
            this.V.Q0(true);
        } else if (action == 2) {
            na((int) (motionEvent.getX() * 20000.0f), 3);
        }
        return true;
    }

    public final void e0() {
        this.O.sendEmptyMessageDelayed(4, TranslateInfo.GOOGLE_MAX_LENGTH);
    }

    public final fab e8() {
        if (!this.V.b0()) {
            return null;
        }
        if (!this.Z2) {
            this.Z2 = true;
            Intent intent = getIntent();
            File file = this.V.q;
            String stringExtra = intent.getStringExtra("filename");
            if (stringExtra == null) {
                if (file != null) {
                    stringExtra = file.getName();
                } else {
                    stringExtra = o0i.a(this.V.o);
                    if (stringExtra == null) {
                        return null;
                    }
                }
            }
            String str = stringExtra;
            fh8 e2 = this.V.I.e();
            try {
                Uri uri = this.V.o;
                c78 c78Var = this.P;
                String V7 = V7(null);
                String j2 = e2.j();
                com.mxtech.videoplayer.n nVar = this.V;
                this.Y2 = new fab(uri, c78Var, str, file, V7, j2, nVar.w, nVar.frameTime(), intent.getLongExtra("size", 0L), intent.getStringExtra("hash.opensubtitles"));
            } finally {
                e2.close();
            }
        }
        return this.Y2;
    }

    public final void ea() {
        FFPlayer u2;
        if (this.c2) {
            this.c2 = false;
            com.mxtech.media.b bVar = this.V.I;
            if (bVar != null && (u2 = bVar.u()) != null) {
                u2.setFlipHorizontal(false);
            }
            ub(this.D0, false, false);
        }
    }

    public final void eb() {
        if (this.Y || (this.a0 && (this.l0.getVisibleParts() & 2) != 0)) {
            fb(true);
        }
    }

    @Override
    public boolean enterPictureInPictureMode(@NonNull PictureInPictureParams pictureInPictureParams) {
        if (this.f) {
            return super.enterPictureInPictureMode(pictureInPictureParams);
        }
        return false;
    }

    public final void f0() {
        if (!s6d.M) {
            this.Q1 |= 16;
            la();
        }
        com.mxtech.videoplayer.n nVar = this.V;
        if (nVar.I != null) {
            nVar.S0();
        }
    }

    public final void f7(int i2) {
        SoundBar Z7 = Z7();
        if (Z7 != null) {
            Z7.a();
            Z7.setValue(Z7.getCurrent() + i2);
            if (h9()) {
                s6d.t1 = -1;
                ub(this.w0, false, false);
            }
        }
    }

    public final void fa() {
        FFPlayer u2;
        if (this.d2) {
            this.d2 = false;
            com.mxtech.media.b bVar = this.V.I;
            if (bVar != null && (u2 = bVar.u()) != null) {
                u2.setFlipVertical(false);
            }
            ub(this.E0, false, false);
        }
    }

    public final void fb(boolean z2) {
        if (this.R2 == null) {
            return;
        }
        StringBuilder sb = L.w;
        sb.setLength(0);
        int i2 = this.M1;
        if (i2 >= 0) {
            sb.append(i2);
            sb.append("%   ");
        }
        sb.append(this.R2.format(new Date()));
        String sb2 = sb.toString();
        TextView textView = this.z2;
        if (textView != null) {
            textView.setText(sb2, TextView.BufferType.NORMAL);
        }
        if (z2) {
            BatteryClockActionView batteryClockActionView = this.C2;
            if (batteryClockActionView != null) {
                batteryClockActionView.setContent(sb2, this.N1 != 0);
            }
            ImageView imageView = this.A2;
            if (imageView != null) {
                int visibility = imageView.getVisibility();
                int i3 = this.N1 == 0 ? 8 : 0;
                if (visibility != i3) {
                    this.A2.setVisibility(i3);
                }
            }
        }
    }

    public void finish() {
        if (isFinishing()) {
            return;
        }
        this.O.removeMessages(9);
        com.mxtech.videoplayer.n nVar = this.V;
        if (nVar != null) {
            nVar.d();
        }
        super/*android.app.Activity*/.finish();
    }

    public final void g1(int i2, int i3) {
        FFPlayer u2;
        FFPlayer u3;
        if (this.J0 == null) {
            return;
        }
        if (!this.V.Z()) {
            if (i2 <= 0 || i3 <= 0) {
                return;
            }
            RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) this.J0.getLayoutParams();
            layoutParams.width = i2;
            layoutParams.height = i3;
            int width = this.S.getWidth();
            int height = this.S.getHeight();
            int i4 = width - i2;
            int i5 = (i4 / 2) + this.G1;
            layoutParams.leftMargin = i5;
            layoutParams.rightMargin = i4 - i5;
            int i6 = height - i3;
            int i7 = (i6 / 2) + this.H1;
            layoutParams.topMargin = i7;
            layoutParams.bottomMargin = i6 - i7;
            if (!this.V.Z()) {
                int width2 = this.J0.getWidth();
                int height2 = this.J0.getHeight();
                int i8 = layoutParams.width;
                if (i8 != width2 || layoutParams.height != height2) {
                    Ca(i8, layoutParams.height);
                }
            }
            this.J0.requestLayout();
            if (this.M0 == null || !this.d0) {
                return;
            }
            r9();
            return;
        }
        int width3 = this.S.getWidth();
        int height3 = this.S.getHeight();
        RelativeLayout.LayoutParams layoutParams2 = (RelativeLayout.LayoutParams) this.J0.getLayoutParams();
        if (layoutParams2.width != width3 || layoutParams2.height != height3) {
            layoutParams2.width = width3;
            layoutParams2.height = height3;
            layoutParams2.leftMargin = 0;
            layoutParams2.topMargin = 0;
            layoutParams2.rightMargin = 0;
            layoutParams2.bottomMargin = 0;
            this.J0.requestLayout();
            Ca(width3, height3);
        }
        com.mxtech.videoplayer.n nVar = this.V;
        z1j z1jVar = this.D1;
        float f2 = z1jVar.n;
        boolean z2 = z1jVar.o;
        boolean z3 = z1jVar.p;
        int i9 = this.G1;
        int i10 = this.H1;
        com.mxtech.media.b bVar = nVar.I;
        if (bVar != null && (u3 = bVar.u()) != null) {
            u3.setZoomScale(f2, z2, z3, i9, i10);
        }
        com.mxtech.videoplayer.n nVar2 = this.V;
        int i11 = this.D1.b;
        com.mxtech.media.b bVar2 = nVar2.I;
        if (bVar2 == null || (u2 = bVar2.u()) == null) {
            return;
        }
        u2.setViewMode(i11);
    }

    @Override
    public final void g6(int i2, int i3) {
        if (t9() && i2 == 2 && i3 == 0) {
            Hb(this.s3);
            this.s3 = false;
        }
    }

    public final TapSeekLayout g8() {
        if (this.n4 == null) {
            ViewStub viewStub = (ViewStub) findViewById(2131366442);
            if (viewStub == null || viewStub.getParent() == null) {
                this.n4 = findViewById(2131363101);
            } else {
                this.n4 = viewStub.inflate();
            }
        }
        return this.n4;
    }

    public final boolean g9() {
        int i2;
        return (xk4.g || !tya.o.b.getBoolean("screen_rotation_button", true) || !this.V.X() || (i2 = s6d.W) == 4 || i2 == 10 || this.C3) ? false : true;
    }

    public final void ga() {
        s6d.q = false;
        this.V.D0(-1);
        ib();
    }

    public final void gb() {
        if (this.Q2 || !this.r) {
            return;
        }
        if (this.Y || this.a0) {
            zm3.a(this, this.P2, v4, true);
            this.Q2 = true;
        }
    }

    public final int getHeight() {
        return this.S.getHeight();
    }

    @NonNull
    public final com.mxtech.videoplayer.n getPlayer() {
        return this.V;
    }

    public final int getWidth() {
        return this.S.getWidth();
    }

    @Override
    public final void h6(int i2) {
        super.h6(i2);
        Log.v("MX.Screen", "screen---resetToolbars---------" + this.m4.f);
        C();
    }

    public final int h8(int i2) {
        View view;
        int i3 = 0;
        if (i2 == 0) {
            return 0;
        }
        SurfaceView surfaceView = this.J0;
        if (surfaceView != null && this.S.indexOfChild(surfaceView) >= 0) {
            i3 = 1;
        }
        if (i2 == 1) {
            return i3;
        }
        ImageView imageView = this.t3;
        if (imageView != null && this.S.indexOfChild(imageView) >= 0) {
            i3++;
        }
        if (i2 == 2) {
            return i3;
        }
        ViewParent parent = this.Q0.getParent();
        TopLayout topLayout = this.S;
        if (parent == topLayout && topLayout.indexOfChild(this.Q0) >= 0) {
            i3++;
        }
        return (i2 == 3 || (view = this.M0) == null || this.S.indexOfChild(view) < 0) ? i3 : i3 + 1;
    }

    public final boolean ha(android.content.Intent r9, android.os.Bundle r10) {
        throw new UnsupportedOperationException("Method not decompiled: com.mxtech.videoplayer.ActivityScreen.ha(android.content.Intent, android.os.Bundle):boolean");
    }

    @Override
    public final boolean handleMessage(Message message) {
        switch (message.what) {
            case 4:
                A5(null);
                if ((this.l0.getVisibleParts() & 5) == 1) {
                    w8(2);
                }
                return true;
            case 5:
            case 11:
            default:
                return false;
            case 6:
                Hb(false);
                return true;
            case 7:
                if (this.L0 != null) {
                    if (this.V.a0()) {
                        if (u9(s6d.T)) {
                            try {
                                this.V.C0(this.L0, getDisplay(), 0);
                            } catch (IllegalArgumentException e2) {
                                Log.e("MX.Screen", "", e2);
                            }
                        }
                        this.K0 = this.V.F;
                        hb();
                    } else if (this.V.c0()) {
                        m9(null, this.F2, this.G2, this.H2);
                    }
                }
                return true;
            case 8:
                x9();
                return true;
            case 10:
                L7();
            case 9:
                return true;
            case 12:
                yb();
                return true;
            case 13:
                pa(getString(2131890552));
                return true;
            case 14:
                this.e4 = true;
                this.l0.h();
                u8();
                Gb(true);
                this.x2 = this.V.R();
                this.V.I0(s6d.p1);
                this.M3 = 38;
                do2.Q("longSpeed");
                return true;
        }
    }

    public final void hb() {
        com.mxtech.videoplayer.n nVar = this.V;
        if (nVar == null || !nVar.c0()) {
            return;
        }
        MenuItem menuItem = this.u1;
        if (menuItem != null) {
            byte b2 = this.V.F;
            menuItem.setTitle(getString(b2 != 1 ? b2 != 2 ? b2 != 4 ? 2131887209 : 2131887211 : 2131887212 : 2131887210));
        }
        ZoomButton zoomButton = this.s1;
        if (zoomButton != null) {
            zoomButton.getDrawable().setLevel(this.V.F);
        }
    }

    public final boolean i9() {
        if (this.z3 || this.v3 == 1) {
            return true;
        }
        if (this.V.X()) {
            return false;
        }
        return this.x3;
    }

    public final void ia(Bundle bundle) {
        this.z3 = bundle.getBoolean("sticky_requested", false);
        this.A3 = bundle.getBoolean("sticky_auto_reset", true);
        if (bundle.getBoolean("rotation_locked")) {
            o9(bundle.getInt("locked_orientation"), true);
        }
    }

    public final void ib() {
        byte b2;
        CastContext castContext;
        if (this.w1 != null) {
            boolean z2 = true;
            if ((this.q != 2 && (castContext = this.K2) != null && castContext.getCastState() != 1) || ((b2 = this.V.F) != 4 && b2 != 2)) {
                z2 = false;
            }
            this.w1.setVisible(z2);
            this.w1.setEnabled(z2);
            EnhanceMenuActionProvider a2 = onb.a(this.w1);
            if (a2 != null) {
                a2.updateIcon();
            }
        }
    }

    @Override
    public final void j(int i2) {
        bb(i2, true);
    }

    @Override
    public final void j3(int i2) {
        if (i2 >= 100) {
            this.P0.setSecondaryProgress(0);
        } else {
            BookmarkSeekBar bookmarkSeekBar = this.P0;
            bookmarkSeekBar.setSecondaryProgress((bookmarkSeekBar.getMax() * i2) / 100);
        }
    }

    public final Uri j8(Intent intent) {
        ClipData clipData;
        ClipData.Item itemAt;
        String charSequence;
        if (intent != null && (clipData = intent.getClipData()) != null && clipData.getItemCount() > 0 && (itemAt = clipData.getItemAt(0)) != null && itemAt.getText() != null && (charSequence = itemAt.getText().toString()) != null && charSequence.length() != 0) {
            String lowerCase = charSequence.toLowerCase(Locale.ROOT);
            if ((StringsKt.B(lowerCase, "youtube.com/watch?v", false) || StringsKt.B(lowerCase, "youtu.be/", false)) && this.v2) {
                return Uri.parse(charSequence);
            }
        }
        return null;
    }

    public final boolean j9() {
        ClipData clipData;
        ClipData.Item itemAt;
        String charSequence;
        if (getIntent() == null || (clipData = getIntent().getClipData()) == null || clipData.getItemCount() <= 0 || (itemAt = clipData.getItemAt(0)) == null || itemAt.getText() == null || (charSequence = itemAt.getText().toString()) == null || charSequence.length() == 0) {
            return false;
        }
        String lowerCase = charSequence.toLowerCase(Locale.ROOT);
        return StringsKt.B(lowerCase, "youtube.com/watch?v", false) || StringsKt.B(lowerCase, "youtu.be/", false);
    }

    public final void ja(int i2, String str) {
        File l2;
        if (!getIntent().getBooleanExtra("return_result", false)) {
            Log.v("MX.Screen", "Activity result: Result is not returned because 'return_result' extra was not set.");
            return;
        }
        Uri uri = this.V.o;
        if (uri != null && (l2 = Files.l(uri)) != null) {
            uri = FileProvider.d(this, getResources().getString(2131887709), l2);
        }
        if (uri == null) {
            Log.v("MX.Screen", "Activity result: Can't return result because media player object is already closed.");
            return;
        }
        Intent intent = new Intent("com.mxtech.intent.result.VIEW", uri);
        if (this.V.b0()) {
            com.mxtech.videoplayer.n nVar = this.V;
            if (nVar.L != 6) {
                intent.putExtra("position", nVar.L());
                intent.putExtra("duration", this.V.w);
            }
            intent.putExtra("decode_mode", this.V.F);
        }
        if (str != null) {
            intent.putExtra("end_by", str);
        }
        setResult(i2, intent);
        Log.v("MX.Screen", "Activity result: Successfully returned.");
    }

    public final void jb() {
        SubView subView;
        if (this.h2 <= 0 || ((subView = this.Q0) != null && subView.j())) {
            t8(a.c);
        } else {
            La(a.c, null);
        }
    }

    @Override
    public final void k3(Dialog dialog) {
        if (!i9()) {
            Log.v("MX.Screen", "Pause playback temporarily as dialog(s) registered.");
            this.V.p0(7);
        }
        A9(true);
    }

    public final boolean k7() {
        byte b2;
        byte b3 = this.V.F;
        if (this.J0 == null || ((b2 = this.K0) == 1 ? b3 == 1 : !(b2 == 2 ? b3 != 2 : !(b2 != 4 || b3 == 1 || b3 == 4)))) {
            return this.L0 != null;
        }
        ba();
        x7();
        return false;
    }

    public final void k8(int r12) {
        throw new UnsupportedOperationException("Method not decompiled: com.mxtech.videoplayer.ActivityScreen.k8(int):void");
    }

    public final void ka(Bundle bundle) {
        Uri uri;
        com.mxtech.videoplayer.n nVar = this.V;
        if (nVar != null && nVar.j == this && (uri = nVar.o) != null) {
            bundle.putParcelable("uri", uri);
            bundle.putBoolean("playing", this.V.f0);
        }
        if (this.C3) {
            bundle.putBoolean("rotation_locked", true);
            bundle.putInt("locked_orientation", getRequestedOrientation());
        }
        bundle.putBoolean("sticky_requested", this.z3);
        bundle.putBoolean("sticky_auto_reset", this.A3);
    }

    public final void kb() {
        b1g b1gVar;
        this.S.setKeepScreenOn(this.h2 > 0 || (s6d.E0 && ((b1gVar = L.t) == null || !b1gVar.d)));
    }

    public final void l(int i2) {
        bb(i2, true);
    }

    public final void l2(int i2) {
        Na(i2, false);
    }

    @Override
    public final void l5() {
        F7();
    }

    public final boolean l7() {
        AppOpsManager appOpsManager;
        return Build.VERSION.SDK_INT >= 26 && (appOpsManager = (AppOpsManager) getSystemService("appops")) != null && appOpsManager.checkOpNoThrow("android:picture_in_picture", getApplicationInfo().uid, getPackageName()) == 0;
    }

    @SuppressLint({WarningType.NewApi})
    public final boolean l8(int i2, KeyEvent keyEvent, int i3) {
        StringBuilder sb = L.w;
        sb.setLength(0);
        sb.append("Key pressed - action:");
        sb.append(i2);
        sb.append(" code:");
        sb.append(i3);
        if (keyEvent != null) {
            sb.append(" repeat:");
            sb.append(keyEvent.getRepeatCount());
            sb.append(" meta:");
            sb.append(keyEvent.getMetaState());
        }
        Log.v("MX.Screen", sb.toString());
        if (i2 == 0) {
            this.n3 = i3;
            if (i3 != 24 && i3 != 25) {
                if (i3 != 89 && i3 != 90) {
                    switch (i3) {
                        case 19:
                        case 20:
                            if (keyEvent != null && keyEvent.isCtrlPressed()) {
                                com.mxtech.media.b bVar = this.V.I;
                                if (bVar != null && (bVar.N() & 8) != 0) {
                                    double b2 = kod.b(bVar.c.A() + (i3 == 19 ? 0.05d : -0.05d));
                                    if (this.V.R() != b2) {
                                        Oa(b2);
                                        e0();
                                    }
                                }
                                return true;
                            }
                            if (keyEvent != null && keyEvent.isShiftPressed()) {
                                BrightnessBar M7 = (s6d.a0 == 1 && s6d.T()) ? M7() : Z7();
                                if (M7 != null) {
                                    M7.a();
                                    M7.setValue(M7.getCurrent() + (i3 == 19 ? 1 : -1));
                                    s6d.t1 = -1;
                                    ub(this.w0, false, false);
                                    break;
                                }
                            } else if (!P8()) {
                                if (getIntent().getIntExtra("keys.dpad_up_down", 0) == 1) {
                                    if ((i3 == 19 ? this.V.s0(false) : this.V.k0()) != null) {
                                        A5(V7(sb));
                                        e0();
                                    }
                                } else {
                                    BrightnessBar M72 = (s6d.a0 == 2 && s6d.T()) ? M7() : Z7();
                                    if (M72 != null) {
                                        M72.a();
                                        M72.setValue(M72.getCurrent() + (i3 == 19 ? 1 : -1));
                                        if (h9()) {
                                            s6d.t1 = -1;
                                            ub(this.w0, false, false);
                                        }
                                    }
                                }
                                return true;
                            }
                            break;
                        case 21:
                        case 22:
                            if (!P8() || this.P0.hasFocus()) {
                                K7(i3).a(keyEvent);
                                return true;
                            }
                            break;
                        default:
                            bz9 K7 = K7(i3);
                            if (K7 != null) {
                                K7.a(keyEvent);
                                return true;
                            }
                            break;
                    }
                }
            } else if (q8(i3)) {
                return true;
            }
        } else if (i2 == 1 && (keyEvent == null || keyEvent.getRepeatCount() == 0)) {
            if (this.n3 != i3) {
                l8(0, null, i3);
            }
            this.n3 = 0;
            if (i3 != 62) {
                if (i3 != 66) {
                    if (i3 != 108) {
                        if (i3 != 111) {
                            if (i3 != 89 && i3 != 90) {
                                switch (i3) {
                                    case 23:
                                        break;
                                    case 24:
                                    case 25:
                                        if (!xk4.g && s6d.M) {
                                            return true;
                                        }
                                        break;
                                    default:
                                        bz9 K72 = K7(i3);
                                        if (K72 != null && K72.b()) {
                                            return true;
                                        }
                                        break;
                                }
                            }
                        } else if (M8()) {
                            w8(0);
                            return true;
                        }
                    }
                }
                if (!P8()) {
                    O3();
                    return true;
                }
            }
            this.V.Q0(true);
            return true;
        }
        if (s6d.k0) {
            if (i3 != 79 && i3 != 175 && i3 != 222) {
                switch (i3) {
                    default:
                        switch (i3) {
                        }
                    case 85:
                    case 86:
                    case 87:
                    case 88:
                    case 89:
                    case 90:
                        n8(i2, keyEvent, i3);
                        break;
                }
                return true;
            }
            n8(i2, keyEvent, i3);
            return true;
        }
        return false;
    }

    public final void la() {
        Handler handler = this.O;
        handler.removeMessages(10);
        handler.sendEmptyMessageDelayed(10, 1000L);
    }

    public final void lb() {
        Lb(this.l0.getVisibleParts(), 0);
        Hb(false);
    }

    public void m7() {
        Bundle bundle = new Bundle();
        emb embVar = new emb();
        embVar.setArguments(bundle);
        com.mxtech.videoplayer.n nVar = this.V;
        embVar.i = nVar;
        embVar.j = this;
        embVar.s = this.p;
        nVar.k = embVar;
        embVar.k = nVar.w;
        embVar.l = nVar.L();
        embVar.r = kotlin.text.c.m(URLDecoder.decode(String.valueOf(nVar.o), "utf-8"), "file://", "");
        bpb bpbVar = this.E1;
        bpbVar.o = 3;
        bpbVar.c(embVar, true);
        gfh.d(new mdg("markPageShown", weh.c));
    }

    public final void m9(Uri uri, int i2, byte b2, int i3) {
        cpa cpaVar;
        D9(uri);
        B8();
        if (this.I2 > 0) {
            Log.d("MX.Screen", "Loading holded. (count=" + this.I2 + ")");
            return;
        }
        com.mxtech.videoplayer.n nVar = this.V;
        if (nVar.j != this) {
            Log.d("MX.Screen", "Player is bound to other object: " + this.V.j);
            return;
        }
        int i4 = nVar.L;
        this.F2 = i2;
        this.G2 = b2;
        this.H2 = i3;
        if (i4 == 0) {
            L6(getIntent(), uri);
            int i5 = (i2 & 4) != 0 ? 3 : (!((i2 & 32) == 0 && s6d.X) && ((cpaVar = this.V0) == null || !cpaVar.a())) ? s6d.K1 : 2;
            if (this instanceof ActivityPipScreen) {
                i5 = 2;
            }
            int i6 = (i5 != 2 || s6d.Y) ? SkinViewInflater.FLAG_SWITCH_TRACK : 0;
            this.Y2 = null;
            this.Z2 = false;
            if (b2 == 0) {
                b2 = getIntent().getByteExtra("decode_mode", (byte) 0);
            }
            HashMap hashMap = t4;
            this.V.B0(uri, b2, i6, hashMap != null ? (Map) hashMap.get(uri) : null);
            this.E2 = false;
            zjb zjbVar = this.V.Z;
            if (zjbVar != null) {
                if (zjbVar.a <= 0) {
                    zjbVar.a();
                } else if (T8()) {
                    if (i5 == 1 || i5 == 2) {
                        zjbVar.a();
                    }
                } else {
                    if (i5 == 1) {
                        Jb(null);
                        if (xk4.g) {
                            new d0();
                            return;
                        } else {
                            La(a.b, this.U2);
                            n9();
                            return;
                        }
                    }
                    if (i5 == 2) {
                        zjbVar.a();
                    }
                }
            }
        } else if (i4 != 1) {
            o9.e(i4, "Invalid state while loading: ", "MX.Screen");
            return;
        }
        if (k7()) {
            com.mxtech.videoplayer.n nVar2 = this.V;
            if (nVar2.Z != null) {
                this.H2 &= -129;
            }
            this.K0 = nVar2.F;
            if (u9(s6d.T)) {
                this.V.q0(this.L0, getDisplay(), this.H2);
            } else {
                this.V.q0(null, null, this.H2);
            }
            if (this.J0 == null) {
                x7();
            }
        }
    }

    public final void ma() {
        fab e8;
        Ta();
        if (!this.V.b0() || (e8 = e8()) == null) {
            return;
        }
        com.mxtech.subtitle.service.f c8 = c8();
        c8.e();
        c8.m = false;
        c8.n = new fab[]{e8};
        c8.new e();
        mdg mdgVar = new mdg("onlineSubSearchClicked", weh.c);
        do2.n("source", "player", mdgVar.b);
        gfh.d(mdgVar);
    }

    public final void mb() {
        SurfaceView surfaceView = this.J0;
        if (surfaceView != null) {
            ((RelativeLayout.LayoutParams) surfaceView.getLayoutParams()).addRule(13, ((this.b0 & 6) != 0 || this.I1) ? 0 : -1);
            this.J0.requestLayout();
            if (this.M0 != null) {
                Eb();
            }
        }
        do2.Q("2tZoom");
    }

    @Override
    public final void n() {
        this.Q0.l();
    }

    public final void n7() {
        if (xk4.g) {
            cmh cmhVar = new cmh(this);
            com.mxtech.videoplayer.n nVar = this.V;
            cmhVar.f = nVar;
            if (nVar != null) {
                nVar.l = cmhVar;
            }
            B5(cmhVar);
            return;
        }
        lmb lmbVar = new lmb();
        com.mxtech.videoplayer.n nVar2 = this.V;
        lmbVar.i = nVar2;
        if (nVar2 != null) {
            nVar2.l = lmbVar;
        }
        this.E1.c(lmbVar, true);
    }

    public final void n8(int i2, KeyEvent keyEvent, int i3) {
        if (s6d.l0) {
            if (i3 == 87) {
                i3 = 90;
            } else if (i3 == 88) {
                i3 = 89;
            }
        }
        if (i2 == 0) {
            bz9 K7 = K7(i3);
            if (K7 != null) {
                K7.a(keyEvent);
                return;
            }
            return;
        }
        if (i2 == 1) {
            if (i3 != 79) {
                if (i3 == 175) {
                    do2.a0("subtitle", "screen", this.j0);
                    K8(false);
                    return;
                }
                if (i3 == 222) {
                    do2.a0("audio", "screen", this.j0);
                    J8(false);
                    return;
                }
                if (i3 != 126) {
                    if (i3 == 127) {
                        this.V.p0(4);
                        return;
                    }
                    switch (i3) {
                        case 85:
                            this.V.Q0(true);
                            if (!xk4.i) {
                                O3();
                                break;
                            }
                            break;
                        case 86:
                            ja(-1, "user");
                            finish();
                            break;
                        case 87:
                            this.V.k0();
                            break;
                        case 88:
                            this.V.t0();
                            break;
                        default:
                            bz9 K72 = K7(i3);
                            if (K72 != null) {
                                K72.b();
                                break;
                            }
                            break;
                    }
                    return;
                }
                if (!s6d.m0) {
                    this.V.O0();
                    return;
                }
            }
            if (!s6d.n0 || keyEvent.getRepeatCount() > 0) {
                this.V.Q0(true);
                if (xk4.i) {
                    return;
                }
                O3();
                return;
            }
            this.Y1++;
            if (this.Z1 == null) {
                this.Z1 = new Handler(new com.mxtech.videoplayer.c(this));
            }
            if (this.Z1.hasMessages(TranslateInfo.GOOGLE_MAX_LENGTH)) {
                return;
            }
            this.Z1.sendEmptyMessageDelayed(TranslateInfo.GOOGLE_MAX_LENGTH, 500L);
        }
    }

    public final void n9() {
        if (this.V.L == 1) {
            m9(null, this.F2, this.G2, this.H2);
        }
    }

    public final boolean na(int r8, int r9) {
        throw new UnsupportedOperationException("Method not decompiled: com.mxtech.videoplayer.ActivityScreen.na(int, int):boolean");
    }

    public final void nb() {
        ntf ntfVar = this.u0;
        if (ntfVar != null) {
            int i2 = s6d.H0;
            if (i2 == 0) {
                ntfVar.e = 2131235753;
            } else if (i2 == 9) {
                ntfVar.e = 2131235753;
            } else if (i2 == 1) {
                ntfVar.e = 2131235754;
            }
            ub(ntfVar, i2 != 0, true);
        }
    }

    public final boolean o2(boolean z2) {
        kb();
        if (z2 && this.V.b0()) {
            return false;
        }
        this.V.p0(0);
        Jb(L.w);
        zb(-1L);
        return true;
    }

    @Override
    public final Uri o3() {
        return this.V.Q;
    }

    public final SubtitleOverlay o4() {
        int i2;
        int i3;
        SubtitleOverlay subtitleOverlay = this.M0;
        if (subtitleOverlay != null) {
            return subtitleOverlay;
        }
        SubtitleOverlay subtitleOverlay2 = new SubtitleOverlay(this);
        this.M0 = subtitleOverlay2;
        subtitleOverlay2.setFrameScale(s6d.x);
        com.mxtech.videoplayer.n nVar = this.V;
        if (nVar.I != null) {
            if (nVar.X()) {
                i2 = this.V.Q();
                i3 = this.V.P();
            } else {
                i2 = -1;
                i3 = -1;
            }
            this.M0.setVideoSize(i2, i3);
        }
        this.S.addView((View) this.M0, h8(3));
        Eb();
        return this.M0;
    }

    public final void o7() {
        int i2 = 0;
        if (s6d.k1) {
            s6d.k1 = false;
            SharedPreferences.Editor edit = tya.o.b.edit();
            edit.putBoolean("shortcut_customize_item_new", s6d.k1);
            edit.apply();
        }
        ntf ntfVar = this.s0;
        if (ntfVar != null) {
            ntfVar.h = false;
        }
        if (this.E1 != null) {
            String str = this.j0;
            mdg mdgVar = new mdg("editScreenPanelShown", weh.c);
            do2.n("from", str, mdgVar.b);
            gfh.d(mdgVar);
            int i3 = this.q;
            z1j z1jVar = this.D1;
            int c2 = z1jVar == null ? 2 : z1jVar.c(z1jVar.b);
            com.mxtech.videoplayer.n nVar = this.V;
            byte b2 = nVar == null ? (byte) 1 : nVar.F;
            int i4 = this.F1;
            Bundle bundle = new Bundle();
            bundle.putInt("orientation", i3);
            bundle.putInt("zoomIndex", c2);
            bundle.putInt("decoderIndex", b2);
            bundle.putInt("subscribeEntry", i4);
            anb anbVar = new anb();
            anbVar.setArguments(bundle);
            bpb bpbVar = this.E1;
            bpbVar.o = 1;
            bpbVar.a();
            if (jz9.N(bpbVar.m) && bpbVar.d != null) {
                bpbVar.j.clear();
                bpbVar.d.setBackground(null);
                bpbVar.d(anbVar, 0, false);
            }
            if (this.V != null && !i9()) {
                this.V.p0(7);
            }
            int rotation = ((WindowManager) getSystemService("window")).getDefaultDisplay().getRotation();
            if (rotation == 0) {
                i2 = 1;
            } else if (rotation != 1) {
                i2 = rotation != 2 ? rotation != 3 ? 2 : 8 : 9;
            }
            setRequestedOrientation(i2);
        }
    }

    public final void o9(int i2, boolean z2) {
        if (z2) {
            int i3 = this.E3;
            if (i3 == Integer.MIN_VALUE) {
                Log.w("MX.Screen", "Can't lock rotation since last-requested-orientation is null.");
                return;
            } else {
                this.D3 = i3;
                this.C3 = true;
                E7(i2);
            }
        } else {
            this.C3 = false;
            E7(this.D3);
        }
        v vVar = this.B3;
        if (vVar != null) {
            vVar.b();
        }
    }

    public final void oa(o oVar, int i2) {
        if (!this.V.b0() || oVar == null) {
            return;
        }
        int i3 = oVar.b;
        if (i3 < 0) {
            File file = oVar.c;
            if (file != null) {
                this.V.f0(file);
            } else {
                this.V.v0();
            }
        } else if (this.V.e(i2, i3) == -4) {
            this.V.y0();
            com.mxtech.videoplayer.n nVar = this.V;
            nVar.e0 = true;
            nVar.j(7);
            m9(null, 3, (byte) 0, 0);
        }
        this.V.x0();
    }

    public final void ob() {
        if (s6d.k0 && this.r) {
            if (this.X1) {
                return;
            }
            com.mxtech.videoplayer.m.a().b(this, "MX.Screen", 0);
            this.X1 = true;
            return;
        }
        if (this.X1) {
            com.mxtech.videoplayer.m a2 = com.mxtech.videoplayer.m.a();
            a2.getClass();
            com.mxtech.videoplayer.m.c(this);
            a2.d();
            this.X1 = false;
        }
    }

    @Override
    public void onActivityResult(int i2, int i3, Intent intent) {
        boolean isExternalStorageManager;
        super.onActivityResult(i2, i3, intent);
        if (100 == i2) {
            this.r2 = l7();
        }
        if (i2 == 155) {
            e5b.k9(getSupportFragmentManager());
            isExternalStorageManager = Environment.isExternalStorageManager();
            if (isExternalStorageManager) {
                u6();
            } else {
                finish();
            }
        }
    }

    public final void onAttachedToWindow() {
        super/*android.app.Activity*/.onAttachedToWindow();
        if (this.E3 == Integer.MIN_VALUE) {
            ra(X7());
        }
        this.m4.b(this);
    }

    @Override
    public void onBackPressed() {
        bpb bpbVar = this.E1;
        boolean z2 = true;
        if (bpbVar != null && bpbVar.e()) {
            ArrayList arrayList = bpbVar.j;
            if (arrayList.size() == 1) {
                bpbVar.g();
                return;
            }
            arrayList.remove(arrayList.size() - 1);
            xlb D = bpbVar.m.getSupportFragmentManager().D(2131362799);
            if (D != null && (D instanceof xlb)) {
                D.k9();
            }
            bpbVar.o = 0;
        }
        if (j21.a(this)) {
            return;
        }
        boolean y8 = y8();
        if (this.e2.size() > 0) {
            r8();
        } else {
            z2 = y8;
        }
        if (z2) {
            return;
        }
        if (!xk4.i && M8()) {
            w8(0);
            return;
        }
        if (tya.o.b.getBoolean("double_tap_back_key", false)) {
            long uptimeMillis = SystemClock.uptimeMillis();
            if (this.e3 + 2000 < uptimeMillis) {
                if (this.d3 == null) {
                    Toast makeText = Toast.makeText(tya.w(), 2131889612, 0);
                    this.d3 = makeText;
                    z6h.a(makeText);
                }
                this.d3.show();
                this.e3 = uptimeMillis;
                return;
            }
            this.d3.cancel();
        }
        ja(-1, "user");
        try {
            super.onBackPressed();
        } catch (IllegalStateException unused) {
            finish();
        }
    }

    @Override
    public final void onConfigurationChanged(Configuration configuration) {
        super.onConfigurationChanged(configuration);
        SubView subView = this.Q0;
        if (subView != null) {
            subView.onConfigurationChanged(configuration);
        }
        if (h9()) {
            qtf qtfVar = this.o0;
            if (qtfVar != null && this.p0) {
                qtfVar.m.getClass();
                qtfVar.notifyItemChanged(qtfVar.i.size() - 1);
            }
            if (this.n0 != null && this.m0 != null) {
                Ma();
            }
        }
        bpb bpbVar = this.E1;
        if (bpbVar != null) {
            bpbVar.f();
        }
        Ib();
        Ra(true);
    }

    @Override
    public final void onContentChanged() {
        super.onContentChanged();
        ActionBar supportActionBar = getSupportActionBar();
        if (supportActionBar != null) {
            supportActionBar.a(this);
        }
    }

    @Override
    @SuppressLint({WarningType.NewApi})
    public void onCreate(Bundle bundle) {
        boolean z2;
        wfc wfcVar;
        aii c2;
        char c3 = 4;
        char c4 = 2;
        char c5 = 1;
        int i2 = 0;
        s6d.q = false;
        d0c.i().h(true);
        ((com.mxtech.videoplayer.f) getApplication()).q();
        Intent intent = getIntent();
        d89.w(intent);
        setIntent(intent);
        this.i0 = intent.getBooleanExtra("self", false);
        Apps.a(this, "onCreate", intent, bundle);
        Y6(intent);
        if (getIntent() != null) {
            cb(getIntent().getData());
        }
        F6();
        if (this.n2) {
            super.onCreate(bundle);
            return;
        }
        if (!this.i0) {
            if (intent.getAction() != null && intent.getAction().endsWith(".playback_local")) {
                th0.v("network_streaming");
            } else if (j9()) {
                th0.v("network_streaming_youtube");
            } else {
                th0.v("file_playback");
            }
        }
        if (s6d.t) {
            getWindow().setFlags(16777216, 16777216);
        }
        setTheme(W7());
        super.onCreate(bundle);
        int p2 = s6d.p(false);
        SharedPreferences.Editor edit = tya.o.b.edit();
        if (tya.o.b.getBoolean("default_gestures_set", false)) {
            z2 = false;
        } else {
            p2 |= SkinViewInflater.FLAG_ANDROID_TEXT_COLOR_HINT;
            edit.putBoolean("default_gestures_set", true);
            z2 = true;
        }
        boolean z3 = z2;
        if (!tya.o.b.getBoolean("gesture_upgrade_set_v1", false)) {
            int i3 = p2 | SkinViewInflater.FLAG_ANDROID_DRAWABLELEFT;
            p2 = ((i3 & SkinViewInflater.FLAG_ANDROID_TEXT_COLOR_HINT) == 0 && (i3 & 64) == 0) ? i3 : p2 | 12352;
            edit.putBoolean("gesture_upgrade_set_v1", true);
            z3 = true;
        }
        if (z3) {
            edit.putInt("gestures", p2);
            edit.apply();
        }
        this.b0 = p2;
        if (Build.VERSION.SDK_INT >= 33) {
            this.l4 = new aud(this);
        }
        F8();
        this.F1 = 0;
        this.f2 = new nqd();
        this.W = ((com.mxtech.videoplayer.f) tya.m).I();
        this.Q = (LayoutInflater) getSystemService("layout_inflater");
        this.Y = tya.o.b.getBoolean("status_show_always", false);
        this.Z = s6d.y0 && tya.o.b.getBoolean("status_bar_show_always", false);
        this.X = s6d.n();
        s6d.Q();
        this.c0 = tya.o.b.getFloat("drag_seek_speed", 10.0f) * 100000.0f;
        this.d0 = tya.o.b.getBoolean("subtitle_fit_overlay_to_video", true);
        this.e0 = s6d.g();
        this.S1 = tya.o.b.getBoolean("osd_bottom", false);
        this.T1 = tya.o.b.getBoolean("osd_background", true);
        this.a2 = tya.o.b.getInt("osd_text_color", -3355444);
        this.b2 = tya.o.b.getInt("osd_back_color", -2013265920);
        this.U1 = tya.o.b.getBoolean("show_left_time", false);
        this.f0 = tya.o.b.getBoolean("display_seeking_position", true);
        this.x3 = tya.o.b.getBoolean("sticky_audio", true);
        this.h0 = tya.o.b.getInt("stereo_mode", 0);
        if (intent.hasExtra("sticky")) {
            this.v3 = intent.getBooleanExtra("sticky", false) ? 1 : 0;
        } else {
            this.v3 = s6d.G();
        }
        if (L.s()) {
            this.w3 = tya.o.b.getBoolean("use_custom_popwindow", true) ? 2 : 1;
        } else {
            this.w3 = 2;
        }
        setContentView(2131560254);
        ?? r9 = (SwitchToNewPlayerView) findViewById(2131367305);
        this.c1 = r9;
        if (xk4.g) {
            r9.setVisibility(8);
        }
        y7();
        RelativeLayout relativeLayout = (RelativeLayout) findViewById(2131366392);
        this.k0 = relativeLayout;
        if (relativeLayout != null && s6d.x0 < 16) {
            ViewGroup viewGroup = (ViewGroup) relativeLayout.getParent();
            int childCount = viewGroup.getChildCount();
            int i4 = 0;
            while (true) {
                if (i4 >= childCount) {
                    break;
                }
                if (viewGroup.getChildAt(i4) == this.k0) {
                    viewGroup.removeViewAt(i4);
                    int childCount2 = this.k0.getChildCount();
                    int i5 = 0;
                    while (i5 < childCount2) {
                        View childAt = this.k0.getChildAt(0);
                        this.k0.removeViewAt(0);
                        viewGroup.addView(childAt, i4);
                        i5++;
                        i4++;
                    }
                    this.k0 = null;
                } else {
                    i4++;
                }
            }
        }
        setVolumeControlStream(3);
        this.F0 = findViewById(2131366307);
        View findViewById = findViewById(2131366310);
        this.G0 = findViewById;
        findViewById.setVisibility(8);
        this.H0 = (ImageView) findViewById(2131366308);
        this.I0 = (TextView) findViewById(2131366309);
        this.S = (TopLayout) findViewById(2131366631);
        this.T = (UILayout) findViewById(2131367401);
        this.U = findViewById(2131365514);
        this.l0 = findViewById(2131362852);
        this.P0 = findViewById(2131365513);
        eii eiiVar = new eii(tya.m);
        kii viewModelStore = getViewModelStore();
        gw3 defaultViewModelCreationExtras = getDefaultViewModelCreationExtras();
        mu9 kotlinClass = JvmClassMappingKt.getKotlinClass(jkg.class);
        String k2 = kotlinClass.k();
        if (k2 == null) {
            throw new IllegalArgumentException("Local and anonymous classes can not be ViewModels");
        }
        String concat = "androidx.lifecycle.ViewModelProvider.DefaultKey:".concat(k2);
        aii b2 = viewModelStore.b(concat);
        if (!kotlinClass.i(b2)) {
            o2c o2cVar = new o2c(defaultViewModelCreationExtras);
            o2cVar.a(jii.a, concat);
            try {
                try {
                    c2 = eiiVar.b(kotlinClass, o2cVar);
                } catch (AbstractMethodError unused) {
                    c2 = eiiVar.a(JvmClassMappingKt.getJavaClass(kotlinClass), o2cVar);
                }
            } catch (AbstractMethodError unused2) {
                c2 = eiiVar.c(JvmClassMappingKt.getJavaClass(kotlinClass));
            }
            b2 = c2;
            aii aiiVar = (aii) viewModelStore.a.put(concat, b2);
            if (aiiVar != null) {
                aiiVar.clear$lifecycle_viewmodel_release();
            }
        }
        this.R0 = (xjg) b2;
        SubView findViewById2 = findViewById(2131366281);
        this.Q0 = findViewById2;
        findViewById2.setParentActivity(this);
        this.h1 = findViewById(2131365459);
        this.i1 = findViewById(2131365145);
        this.k1 = (ZoomButton) findViewById(2131362213);
        this.j1 = (ZoomButton) findViewById(2131363583);
        this.m1 = (TextView) findViewById(2131362214);
        this.l1 = (TextView) findViewById(2131363584);
        this.p1 = (ImageButton) findViewById(2131364737);
        this.q1 = (ZoomButton) findViewById(2131367837);
        this.r1 = (ZoomButton) findViewById(2131367838);
        if (this.F1 != 0) {
            ZoomButton zoomButton = this.q1;
            if (zoomButton != null) {
                zoomButton.setVisibility(8);
                this.q1 = null;
            }
            ZoomButton zoomButton2 = this.r1;
            if (zoomButton2 != null) {
                zoomButton2.setVisibility(8);
                this.r1 = null;
            }
            this.o4 = ((ViewStub) findViewById(2131365422)).inflate();
            this.q1 = (ZoomButton) findViewById(2131365419);
            this.r1 = (ZoomButton) findViewById(2131365420);
            this.q1.bringToFront();
            this.r1.bringToFront();
            View view = this.o4;
            if (view != null) {
                view.setVisibility(M8() ? 0 : 8);
            }
            Ha();
            if (this.F1 == 2) {
                o8();
            }
        }
        this.n1 = (TextView) findViewById(2131365449);
        this.o1 = (TextView) findViewById(2131363194);
        this.t1 = (ImageButton) findViewById(2131365433);
        this.E1 = new bpb(this, (ViewStub) findViewById(2131365411));
        D8();
        this.T0 = findViewById(2131364712);
        this.U0 = findViewById(2131364709);
        com.mxtech.videoplayer.n nVar = new com.mxtech.videoplayer.n(this.P, this.R0);
        this.V = nVar;
        nVar.j = this;
        this.l0.setPlayer(nVar);
        this.Q0.setPlayer(this.V, this, this.R0);
        Ha();
        this.P0.setOnSeekBarChangeListener(this);
        this.P0.setOnDotClickedListener(this);
        if (s6d.s()) {
            SubView subView = this.Q0;
            subView.v = true;
            subView.l();
        }
        this.S.b = this;
        this.T.c = this;
        Animation loadAnimation = AnimationUtils.loadAnimation(this, 2130772015);
        this.C = loadAnimation;
        if (this.E == null) {
            this.E = new q7h.b(this);
        }
        loadAnimation.setAnimationListener(this.E);
        Animation loadAnimation2 = AnimationUtils.loadAnimation(this, 2130772016);
        this.D = loadAnimation2;
        if (this.E == null) {
            this.E = new q7h.b(this);
        }
        loadAnimation2.setAnimationListener(this.E);
        this.l0.setShowAnimation(2130772015);
        this.l0.setHideAnimation(2130772016);
        U9();
        this.g0 = tya.o.b.getBoolean("pause_if_obscured", false);
        this.O1 = this.S.getSystemUiVisibility();
        this.S.setOnSystemUiVisibilityChangeListener(this);
        this.o1.setText(this.J1);
        this.o1.setOnClickListener(new f());
        va(0, true);
        ImageButton imageButton = this.t1;
        if (imageButton != null) {
            b0 b0Var = new b0();
            imageButton.setOnClickListener(b0Var);
            this.t1.setOnLongClickListener(b0Var);
        }
        View view2 = this.h1;
        if (view2 != null) {
            view2.setOnClickListener(new c0());
        }
        View view3 = this.i1;
        if (view3 != null) {
            if (xk4.g) {
                z zVar = new z();
                view3.setOnClickListener(zVar);
                this.i1.setOnLongClickListener(zVar);
            } else {
                view3.setOnClickListener(new sh(this, i2));
                this.i1.setOnLongClickListener(new yg(this, i2));
            }
        }
        J9(s6d.u());
        K9(tya.o.b.getBoolean("show_prev_next", true));
        ZoomButton zoomButton3 = this.k1;
        if (zoomButton3 != null) {
            os1 os1Var = new os1(this, -1);
            zoomButton3.setZoomSpeed(50L);
            this.k1.setOnTouchListener(os1Var);
            this.k1.setOnClickListener(os1Var);
        }
        ZoomButton zoomButton4 = this.j1;
        if (zoomButton4 != null) {
            os1 os1Var2 = new os1(this, 1);
            zoomButton4.setZoomSpeed(50L);
            this.j1.setOnTouchListener(os1Var2);
            this.j1.setOnClickListener(os1Var2);
        }
        TextView textView = this.l1;
        if (textView != null) {
            textView.setText(Integer.toString(s6d.D0 / TranslateInfo.MX_MAX_LENGTH));
        }
        TextView textView2 = this.m1;
        if (textView2 != null) {
            textView2.setText(Integer.toString(s6d.D0 / TranslateInfo.MX_MAX_LENGTH));
        }
        if (xk4.g) {
            this.p1.setImageDrawable(null);
            this.p1.setEnabled(false);
            this.p1.setFocusable(false);
            this.h1.setNextFocusLeftId(2131367840);
            this.q1.setNextFocusRightId(2131365459);
        } else {
            this.B3 = new v();
        }
        if (((tya) getApplication()).y(this)) {
            Animation loadAnimation3 = AnimationUtils.loadAnimation(this, 2130772016);
            this.L1 = loadAnimation3;
            loadAnimation3.setAnimationListener(new f0());
            this.T.setController(this.l0);
            this.T.setOnTouchListener(this);
            this.l0.setOnVisibilityChangedListener(this);
            this.l0.bringToFront();
            com.mxtech.videoplayer.o b3 = com.mxtech.videoplayer.o.b();
            za(b3, -1);
            if (b3.v == null) {
                b3.v = new ArrayList<>();
            }
            b3.v.add(this);
            d89.k(intent);
            Uri data = intent.getData();
            if (data == null && (data = j8(intent)) == null) {
                Log.e("MX.Screen", "Finishing " + this + " because 'dat' is not provided.");
                finish();
                return;
            }
            this.f2.h = this.i0;
            if (ha(intent, bundle)) {
                com.mxtech.videoplayer.n nVar2 = this.V;
                if (nVar2 != null) {
                    Da(nVar2.L(), false);
                }
            } else {
                J6(intent, data, bundle);
            }
            tya.o.d(this);
            bd0.c = 2;
            this.l2 = dia.a(this);
            IntentFilter intentFilter = new IntentFilter();
            intentFilter.addAction("playNext");
            a0 a0Var = new a0();
            this.m2 = a0Var;
            this.l2.b(a0Var, intentFilter);
            if (!twd.b().getBoolean("key_set_pause_player_once", false)) {
                twd.b().edit().putBoolean("key_set_pause_player_once", true).apply();
                b00.e(tya.o.b, "pause_if_obscured", false);
            }
            ua(this.q);
            com.mxtech.videoplayer.n nVar3 = this.V;
            if (nVar3 != null && (wfcVar = nVar3.m) != null) {
                Uri[] f2 = wfcVar.f();
                if (f2.length == 0) {
                    f2 = new Uri[]{this.V.o};
                }
                new j(f2, new gh(this, i2)).executeOnExecutor(s0b.d(), new Void[0]);
            }
            String[] stringArray = ((j1b) getResources()).b.getStringArray(2130903074);
            int E = s6d.E();
            StringBuilder sb = new StringBuilder();
            if ((E & 1) != 0) {
                sb.append(stringArray[0]);
                sb.append(",");
            }
            if ((E & 2) != 0) {
                sb.append(stringArray[1]);
                sb.append(",");
            }
            if ((E & 4) != 0) {
                sb.append(stringArray[2]);
                sb.append(",");
            }
            if ((E & 8) != 0) {
                sb.append(stringArray[3]);
                sb.append(",");
            }
            if ((16 & E) != 0) {
                sb.append(stringArray[4]);
                sb.append(",");
            }
            if ((E & 32) != 0) {
                sb.append(stringArray[5]);
                sb.append(",");
            }
            if ((E & 64) != 0) {
                sb.append(stringArray[6]);
                sb.append(",");
            }
            if ((E & SkinViewInflater.FLAG_SWITCH_TRACK) != 0) {
                sb.append(stringArray[7]);
                sb.append(",");
            }
            if ((E & SkinViewInflater.FLAG_ANDROID_FOREGROUND) != 0) {
                sb.append(stringArray[8]);
                sb.append(",");
            }
            if ((E & SkinViewInflater.FLAG_BUTTON_TINT) != 0) {
                sb.append(stringArray[9]);
                sb.append(",");
            }
            if ((E & SkinViewInflater.FLAG_DRAWABLE_TINT) != 0) {
                sb.append(stringArray[10]);
                sb.append(",");
            }
            if ((E & SkinViewInflater.FLAG_ANDROID_TEXT_COLOR_HINT) != 0) {
                sb.append(stringArray[11]);
                sb.append(",");
            }
            if ((E & SkinViewInflater.FLAG_ANDROID_DRAWABLELEFT) != 0) {
                sb.append(stringArray[12]);
                sb.append(",");
            }
            int i6 = 13;
            if ((E & SkinViewInflater.FLAG_ANDROID_BUTTON) != 0) {
                sb.append(stringArray[13]);
                sb.append(",");
            }
            String sb2 = sb.toString();
            mdg mdgVar = new mdg("shortcutsShown", weh.c);
            do2.n("itemName", sb2, mdgVar.b);
            gfh.d(mdgVar);
            String[] stringArray2 = ((j1b) getResources()).b.getStringArray(2130903070);
            StringBuilder sb3 = new StringBuilder();
            inb inbVar = new inb(this);
            Iterator it = inbVar.c(2).b.entrySet().iterator();
            while (it.hasNext()) {
                int i7 = ((b) ((Map.Entry) it.next()).getValue()).a;
                if (i7 == i6) {
                    sb3.append(stringArray2[0]);
                }
                if (i7 == 9) {
                    sb3.append(stringArray2[1]);
                }
                if (i7 == 7) {
                    sb3.append(stringArray2[c4]);
                }
                if (i7 == 8) {
                    sb3.append(stringArray2[3]);
                }
                if (i7 == 11) {
                    sb3.append(stringArray2[4]);
                }
                if (i7 == 10) {
                    sb3.append(stringArray2[5]);
                }
                sb3.append(",");
                c4 = 2;
                i6 = 13;
            }
            String sb4 = sb3.toString();
            mdg mdgVar2 = new mdg("menuShownHorizontal", weh.c);
            do2.n("itemName", sb4, mdgVar2.b);
            gfh.d(mdgVar2);
            StringBuilder sb5 = new StringBuilder();
            Iterator it2 = inbVar.c(1).b.entrySet().iterator();
            while (it2.hasNext()) {
                int i8 = ((b) ((Map.Entry) it2.next()).getValue()).a;
                if (i8 == 13) {
                    sb5.append(stringArray2[0]);
                }
                if (i8 == 9) {
                    sb5.append(stringArray2[c5]);
                }
                if (i8 == 7) {
                    sb5.append(stringArray2[2]);
                }
                if (i8 == 8) {
                    sb5.append(stringArray2[3]);
                }
                if (i8 == 11) {
                    sb5.append(stringArray2[c3]);
                }
                if (i8 == 10) {
                    sb5.append(stringArray2[5]);
                }
                sb5.append(",");
                c3 = 4;
                c5 = 1;
            }
            String sb6 = sb5.toString();
            mdg mdgVar3 = new mdg("menuShownVertical", weh.c);
            do2.n("itemName", sb6, mdgVar3.b);
            gfh.d(mdgVar3);
            this.w2 = new vpd(this);
            try {
                this.K2 = CastContext.getSharedInstance(this);
            } catch (RuntimeException e2) {
                e2.toString();
                int i9 = d1j.a;
            }
            this.L2 = new zg(this);
        }
    }

    public final boolean onCreateOptionsMenu(Menu menu) {
        MenuItem findItem;
        SubMenu subMenu;
        com.mxtech.videoplayer.n nVar;
        SubMenu subMenu2;
        SubMenu subMenu3;
        Bitmap A;
        Uri uri;
        SubMenu subMenu4;
        SubMenu subMenu5;
        SubMenu subMenu6;
        getMenuInflater().inflate(xk4.g ? 2131623975 : 2131623976, menu);
        MenuItem findItem2 = menu.findItem(2131365822);
        this.u2 = findItem2;
        if (findItem2 != null && onb.a(findItem2) != null) {
            try {
                this.u2 = CastButtonFactory.setUpMediaRouteButton(this, menu, 2131365822);
            } catch (IllegalArgumentException e2) {
                gfh.c(e2);
            }
        }
        this.u1 = menu.findItem(2131362975);
        this.B2 = menu.findItem(2131362705);
        this.v1 = menu.findItem(2131362137);
        this.w1 = menu.findItem(2131363267);
        this.x1 = menu.findItem(2131362467);
        this.y1 = menu.findItem(2131365427);
        this.z1 = menu.findItem(2131365353);
        this.A1 = menu.findItem(2131367840);
        if (this.u1 != null) {
            hb();
        }
        MenuItem menuItem = this.B2;
        if (menuItem != null) {
            this.C2 = menuItem.getActionView();
            boolean f2 = s6d.f();
            this.a0 = f2;
            MenuItem menuItem2 = this.B2;
            if (menuItem2 != null) {
                menuItem2.setVisible(f2);
            }
            gb();
            eb();
        } else {
            this.a0 = false;
        }
        MenuItem findItem3 = menu.findItem(2131366188);
        if (xk4.g) {
            if (this.x1 != null) {
                boolean z2 = this.Q0.getSubtitleCount() > 0;
                MenuItem menuItem3 = this.x1;
                if (menuItem3 != null) {
                    menuItem3.setVisible(z2);
                    this.x1.setEnabled(z2);
                }
            }
            MenuItem findItem4 = menu.findItem(2131366187);
            if (findItem4 != null && (subMenu6 = findItem4.getSubMenu()) != null) {
                subMenu6.removeItem(2131365752);
                subMenu6.removeItem(2131365957);
            }
            if (findItem3 != null && (subMenu5 = findItem3.getSubMenu()) != null) {
                subMenu5.removeItem(2131364737);
            }
        }
        com.mxtech.videoplayer.n nVar2 = this.V;
        if (nVar2 != null && (uri = nVar2.o) != null && Files.z(uri.toString()) && findItem3 != null && (subMenu4 = findItem3.getSubMenu()) != null) {
            subMenu4.removeItem(2131365935);
            subMenu4.removeItem(2131362984);
            subMenu4.removeItem(2131365644);
        }
        com.mxtech.videoplayer.n nVar3 = this.V;
        if (nVar3 != null && !nVar3.X() && this.t3 != null && this.u3 != (A = this.V.A(this.q))) {
            this.t3.setImageBitmap(A);
            this.u3 = A;
        }
        if (L.t != null) {
            Jb(L.w);
        }
        if (!L.c(this) && findItem3 != null && (subMenu3 = findItem3.getSubMenu()) != null) {
            subMenu3.removeItem(2131365935);
        }
        if (findItem3 != null && (nVar = this.V) != null) {
            Uri uri2 = nVar.o;
            if (sgj.l(uri2 == null ? null : uri2.toString()) && (subMenu2 = findItem3.getSubMenu()) != null) {
                subMenu2.removeItem(2131365644);
            }
        }
        com.mxtech.videoplayer.n nVar4 = this.V;
        if (nVar4 != null) {
            Uri uri3 = nVar4.o;
            if (sgj.l(uri3 != null ? uri3.toString() : null) && (findItem = menu.findItem(2131362162)) != null && (subMenu = findItem.getSubMenu()) != null) {
                subMenu.removeItem(2131365248);
            }
        }
        MenuItem findItem5 = menu.findItem(2131364882);
        MoreMenuActionProvider a2 = onb.a(findItem5);
        if (a2 != null) {
            a2.setOnClickListener(new ah(this, 0));
        }
        if ((Q8() || TextUtils.equals(this.j0, "ins_video_stream")) && findItem5 != null) {
            findItem5.setVisible(false);
        }
        return true;
    }

    @Override
    public void onDestroy() {
        dia diaVar = this.l2;
        if (diaVar != null) {
            diaVar.d(this.m2);
        }
        Log.v("MX.Screen", "onDestroy (" + this + ") - isFinishing() = " + isFinishing());
        this.p0 = false;
        RecyclerView recyclerView = this.m0;
        if (recyclerView != null) {
            recyclerView.F0(this.M2);
            this.m0.removeCallbacks(this.N2);
        }
        setResult(125);
        this.m4.a();
        if (this.n2) {
            super.onDestroy();
            return;
        }
        PlayService playService = PlayService.L0;
        if (playService != null && playService.f == this) {
            playService.f = null;
        }
        com.mxtech.subtitle.service.f fVar = this.O0;
        if (fVar != null) {
            fVar.e();
        }
        L7();
        com.mxtech.videoplayer.n nVar = this.V;
        if (nVar != null && nVar.j == this) {
            nVar.i();
        }
        tya.o.e(this);
        ArrayList<o.a> arrayList = com.mxtech.videoplayer.o.b().v;
        if (arrayList != null) {
            arrayList.remove(this);
        }
        if (!this.S2) {
            kgc.l(getIntent());
        }
        Handler handler = this.Z1;
        if (handler != null) {
            handler.removeCallbacksAndMessages(null);
        }
        zm3.b(this, this.q2);
        this.q2 = null;
        this.O.removeMessages(4);
        vih vihVar = this.S0;
        if (vihVar != null && !vihVar.isCancelled()) {
            this.S0.cancel(true);
        }
        vpd vpdVar = this.w2;
        if (vpdVar != null) {
            try {
                vpdVar.a.clear();
            } catch (Exception unused) {
                int i2 = d1j.a;
            }
        }
        super.onDestroy();
    }

    @vgg(threadMode = ThreadMode.MAIN)
    public void onEvent(w82 w82Var) {
        com.mxtech.videoplayer.n nVar;
        Uri uri;
        if (tj5.a.contains(this) && w82Var.a == 1 && (nVar = this.V) != null && (uri = nVar.o) != null) {
            if (y82.g(uri)) {
                finish();
            } else {
                Z6(this.V.m.f(), uri);
            }
        }
    }

    @android.annotation.TargetApi(12)
    public final boolean onGenericMotionEvent(android.view.MotionEvent r6) {
        throw new UnsupportedOperationException("Method not decompiled: com.mxtech.videoplayer.ActivityScreen.onGenericMotionEvent(android.view.MotionEvent):boolean");
    }

    public final void onLowMemory() {
        com.mxtech.videoplayer.preference.b d2 = this.p.d(com.mxtech.videoplayer.preference.b.class);
        if (d2 != null) {
            d2.d[4].h();
        }
        super/*android.app.Activity*/.onLowMemory();
    }

    public final boolean onMenuOpened(int i2, Menu menu) {
        MenuItem menuItem;
        MenuItem menuItem2;
        if (i2 == 108 && (menuItem = this.v1) != null && menuItem.isEnabled() && !this.v1.f() && (menuItem2 = this.v1) != null) {
            menuItem2.setVisible(false);
            this.v1.setEnabled(false);
        }
        return super.onMenuOpened(i2, menu);
    }

    public final void onMultiWindowModeChanged(boolean z2) {
        super/*ub3*/.onMultiWindowModeChanged(z2);
        if (z2) {
            return;
        }
        ra(X7());
    }

    public void onNewIntent(Intent intent) {
        com.mxtech.videoplayer.n nVar;
        d89.w(intent);
        d89.k(intent);
        super/*ub3*/.onNewIntent(intent);
        this.i0 = intent.getBooleanExtra("self", false);
        Apps.a(this, "onNewIntent", intent, null);
        Y6(intent);
        cb(intent.getData());
        F6();
        if (!ha(intent, null)) {
            Intent intent2 = getIntent();
            if ("com.mxtech.videoplayer.service.PlayService".equals(intent.getStringExtra("launcher"))) {
                intent.removeExtra("launcher");
                String stringExtra = intent.getStringExtra("video_list.playlist.autogen");
                if (stringExtra != null && !stringExtra.equals(intent2.getStringExtra("video_list.playlist.autogen"))) {
                    new File(stringExtra).delete();
                }
            } else {
                Uri data = intent.getData();
                if (data == null) {
                    data = j8(intent);
                }
                if (data != null && (nVar = this.V) != null && (!data.equals(nVar.o) || intent.hasExtra("decode_mode") != intent2.hasExtra("decode_mode") || intent.getByteExtra("decode_mode", (byte) 0) != intent2.getByteExtra("decode_mode", (byte) 0))) {
                    ab();
                    nqd nqdVar = new nqd();
                    this.f2 = nqdVar;
                    nqdVar.h = this.i0;
                    ja(-1, "user");
                    this.V.y0();
                    this.V.h(0);
                    String stringExtra2 = intent2.getStringExtra("video_list.playlist.autogen");
                    if (stringExtra2 != null && !stringExtra2.equals(intent.getStringExtra("video_list.playlist.autogen"))) {
                        new File(stringExtra2).delete();
                    }
                    setIntent(intent);
                    J6(intent, data, null);
                }
            }
        }
        Ra(this.i0);
    }

    public final void onPanelClosed(int i2, Menu menu) {
        MenuItem menuItem;
        if (i2 == 108 && (menuItem = this.v1) != null && menuItem.isEnabled() && !this.v1.isVisible() && this.q == 2) {
            try {
                MenuItem menuItem2 = this.v1;
                if (menuItem2 != null) {
                    menuItem2.setVisible(true);
                    this.v1.setEnabled(true);
                }
            } catch (NullPointerException e2) {
                gfh.c(e2);
            }
        }
        super.onPanelClosed(i2, menu);
    }

    @Override
    @SuppressLint({"InlinedApi"})
    public void onPause() {
        Log.v("MX.Screen", "onPause (" + this + "): uri=" + this.V.o);
        int i2 = Build.VERSION.SDK_INT;
        if (!isInMultiWindowMode() && !T8()) {
            Q9();
        }
        super.onPause();
        if (i2 > 26 && isFinishing()) {
            setRequestedOrientation(3);
        }
        sb();
        CastContext castContext = this.K2;
        if (castContext != null) {
            castContext.removeCastStateListener(this.L2);
        }
    }

    @Override
    public void onPictureInPictureModeChanged(boolean z2, Configuration configuration) {
        super.onPictureInPictureModeChanged(z2, configuration);
        if (!z2) {
            zm3.b(this, this.q2);
            this.q2 = null;
            if (this.V.b0()) {
                O3();
                if (this.Q0.j()) {
                    this.Q0.setTextSize(s6d.L());
                    return;
                }
                return;
            }
            return;
        }
        xk4.j(getWindow(), -1.0f);
        if (L8()) {
            u8();
        }
        r8();
        if (this.Q0.j()) {
            this.Q0.setTextSize(9.0f);
        }
        if (this.q2 == null) {
            d dVar = new d();
            this.q2 = dVar;
            zm3.a(this, dVar, new IntentFilter("media_control"), true);
        }
    }

    public final boolean onPrepareOptionsMenu(android.view.Menu r17) {
        throw new UnsupportedOperationException("Method not decompiled: com.mxtech.videoplayer.ActivityScreen.onPrepareOptionsMenu(android.view.Menu):boolean");
    }

    @Override
    public void onProgressChanged(SeekBar seekBar, int i2, boolean z2) {
        if (z2 && z2 && this.V.b0()) {
            va(i2, true);
            int i3 = this.b3;
            if (i3 >= 0 && this.f0) {
                wa(i2, i2 - i3, null);
            }
            if (this.b3 < 0) {
                com.mxtech.videoplayer.n nVar = this.V;
                nVar.z0(i2, nVar.O());
            } else if (s9()) {
                S9(i2);
            }
        }
    }

    public final void onRestart() {
        Log.v("MX.Screen", "onRestart (" + this + ")");
        super/*android.app.Activity*/.onRestart();
        ha(null, null);
    }

    public final void onRestoreInstanceState(Bundle bundle) {
        super/*android.app.Activity*/.onRestoreInstanceState(bundle);
        this.m4.f = bundle.getInt("last_notch_orientation");
    }

    @Override
    public void onResume() {
        super.onResume();
        R(s6d.K ? -1.0f : s6d.L);
        ea2.d().b(this);
        Log.v("MX.Screen", "onResume (" + this + "): uri=" + this.V.o);
        if (this.R == 2) {
            PlayService playService = PlayService.L0;
            if (playService != null) {
                playService.f();
            }
            this.R = 0;
        }
        x7();
        this.W1 = false;
        this.V.x0();
        sb();
        CastContext castContext = this.K2;
        if (castContext != null) {
            castContext.addCastStateListener(this.L2);
        }
    }

    public void onSaveInstanceState(Bundle bundle) {
        Log.v("MX.Screen", "onSaveInstanceState (" + this + ")");
        ka(bundle);
        L7();
        bundle.putInt("last_notch_orientation", this.m4.f);
        super/*ub3*/.onSaveInstanceState(bundle);
    }

    @Override
    public final void onSessionStarting(CastSession castSession) {
        ga2.a aVar = ga2.a.LOCAL;
        int i2 = ceh.b.c;
        ceh.c.a(aVar);
        com.mxtech.videoplayer.n nVar = this.V;
        if (nVar != null) {
            this.k2 = nVar.o;
            wfc wfcVar = nVar.m;
            if (wfcVar != null) {
                this.j2 = wfcVar.f();
            }
        }
        j2g.q(this, "onSessionStarting", new String[]{"castPLayUri" + this.k2});
        Z6(this.j2, this.k2);
    }

    @Override
    public void onStart() {
        super.onStart();
        Log.v("MX.Screen", "onStart (" + this + "): video-uri=" + this.V.o);
        this.R2 = android.text.format.DateFormat.getTimeFormat(this);
        eb();
        zm3.a(this, this.O2, u4, true);
        gb();
        new rx3(this).c();
        kb();
        ob();
        boolean z2 = false;
        if (isInMultiWindowMode()) {
            x7();
            this.W1 = false;
            this.V.x0();
        }
        gr6.a(this.W, "Playback");
        Calendar.getInstance().getTimeInMillis();
        Uri uri = this.V.o;
        if (uri != null && !com.mxtech.videoplayer.f.B) {
            z2 = sgj.l(uri.getPath());
        }
        if (z2) {
            Intent intent = new Intent((Context) this, (Class<?>) PrivateVerifyActivity.class);
            intent.addFlags(536870912);
            startActivity(intent);
        }
        if (tj5.b(this)) {
            return;
        }
        tj5.e(this);
    }

    @Override
    public final void onStartTrackingTouch(SeekBar seekBar) {
        if (M6()) {
            this.l0.d();
            if (!this.V.b() || s9()) {
                return;
            }
            this.V.p0(7);
        }
    }

    @Override
    public void onStop() {
        Log.v("MX.Screen", "onStop (" + this + "): uri=" + this.V.o);
        ab();
        if (!this.W1 && this.R != 2) {
            Q9();
        }
        if (!(this.R == 2)) {
            ba();
            s6d.s1 = false;
            s6d.t1 = -1;
        }
        if (R6()) {
            this.V.k(false);
            Bundle bundle = new Bundle();
            ka(bundle);
            PlayService.L0.x(isFinishing() ? null : this, this.V, getClass(), getIntent(), bundle, Boolean.FALSE);
            this.S2 = true;
        } else if (this.R != 2) {
            this.S2 = false;
            if (!isFinishing()) {
                this.V.P0();
                this.V.l();
                ea();
                fa();
            }
        }
        this.R2 = null;
        Calendar.getInstance().getTimeInMillis();
        super.onStop();
        zm3.b(this, this.O2);
        zm3.b(this, this.P2);
        this.Q2 = false;
        ob();
        if (pl0.a(this)) {
            ea2.d().f(this);
        }
        tj5.h(this);
    }

    @Override
    public final void onStopTrackingTouch(SeekBar seekBar) {
        this.l0.h();
        K4(null, null);
        I7(!s9());
    }

    @Override
    @TargetApi(11)
    public final void onSystemUiVisibilityChange(int i2) {
        if (this.r && this.O1 != i2) {
            this.O1 = i2;
            if (i2 == 0) {
                if (s6d.w1 != 0 && s6d.x0 < 19) {
                    int i3 = s6d.Z;
                    if (i3 == 1) {
                        StringBuilder sb = new StringBuilder("Toggle playback silently in response to system ui visibility change to ");
                        StringBuilder sb2 = new StringBuilder();
                        if ((i2 & 4) != 0) {
                            sb2.append("FULLSCREEN ");
                        }
                        if ((i2 & 1) != 0) {
                            sb2.append("LOW_PROFILE ");
                        }
                        if ((i2 & 2) != 0) {
                            sb2.append("HIDE_NAVIGATION ");
                        }
                        if ((i2 & SkinViewInflater.FLAG_DRAWABLE_TINT) != 0) {
                            sb2.append("IMMERSIVE ");
                        }
                        if ((i2 & SkinViewInflater.FLAG_ANDROID_TEXT_COLOR_HINT) != 0) {
                            sb2.append("IMMERSIVE_STICKY ");
                        }
                        if ((i2 & SkinViewInflater.FLAG_BUTTON_TINT) != 0) {
                            sb2.append("LAYOUT_FULLSCREEN ");
                        }
                        if ((i2 & SkinViewInflater.FLAG_ANDROID_FOREGROUND) != 0) {
                            sb2.append("LAYOUT_HIDE_NAVIGATION ");
                        }
                        if ((i2 & SkinViewInflater.FLAG_SWITCH_TRACK) != 0) {
                            sb2.append("LAYOUT_STABLE ");
                        }
                        sb.append((Object) sb2);
                        sb.append(" (=");
                        sb.append(i2);
                        sb.append(", state=");
                        sb.append(this.V.L);
                        sb.append(')');
                        Log.v("MX.Screen", sb.toString());
                        this.V.Q0(true);
                    } else if (i3 == 2) {
                        O3();
                    } else if (i3 != 3) {
                        O3();
                    } else {
                        O3();
                        this.V.p0(0);
                    }
                    this.N3 = 0;
                    this.O3 = SystemClock.uptimeMillis();
                }
                if (this.Z0) {
                    Handler handler = this.O;
                    handler.removeMessages(6);
                    handler.sendEmptyMessageDelayed(6, s6d.r(this));
                }
            }
        }
    }

    @Override
    @SuppressLint({"ClickableViewAccessibility"})
    public final boolean onTouch(View view, MotionEvent motionEvent) {
        p8(view, this.b0, motionEvent);
        return true;
    }

    public final void onUserLeaveHint() {
        if (this.s2) {
            if (isInPictureInPictureMode()) {
                return;
            }
            this.o2 = true;
            cpa cpaVar = this.V0;
            if (cpaVar != null && !cpaVar.a()) {
                this.V0.e(true);
            }
            Ta();
            qod qodVar = rod.a;
            oc8 a2 = qodVar != null ? qodVar.a() : null;
            if (a2 == null) {
                a2 = new sod();
            }
            a2.b(getSupportFragmentManager());
            this.p.c();
            if (X6()) {
                return;
            }
            int A7 = A7(1, false);
            if (A7 == 2 || A7 == 3) {
                finish();
                overridePendingTransition(0, 2130771981);
            }
        }
        this.s2 = true;
    }

    @Override
    @SuppressLint({WarningType.NewApi})
    public void onWindowFocusChanged(boolean z2) {
        bpb bpbVar;
        super.onWindowFocusChanged(z2);
        if (!this.s) {
            this.R1 = false;
            return;
        }
        if (z2 && (bpbVar = this.E1) != null && !bpbVar.p) {
            this.V.x0();
            if (this.D2 && !L.l().inKeyguardRestrictedInputMode()) {
                yb();
            }
            this.l0.i(this.V.L);
            return;
        }
        if (this.R1) {
            this.R1 = false;
            return;
        }
        if (!this.g0 || i9()) {
            return;
        }
        Log.v("MX.Screen", "Pause playback temporarily as main window losing focus. pause-if-obscured=" + this.g0);
        this.V.p0(7);
    }

    @Override
    public final void p4(am8 am8Var) {
        this.Q0.m(am8Var);
        SubtitlePanel subtitlePanel = this.N0;
        if (subtitlePanel != null) {
            subtitlePanel.b();
        }
        this.a3 = null;
    }

    @Override
    public final View p6() {
        return this.S;
    }

    public final void p7() {
        ab();
        Uri w9 = w9();
        B9(w9);
        this.k2 = w9;
        if (w9 != null) {
            nqd nqdVar = new nqd();
            this.f2 = nqdVar;
            nqdVar.h = true;
            nqdVar.i = true;
        }
    }

    @android.annotation.SuppressLint({"ClickableViewAccessibility"})
    public final void p8(android.view.View r28, int r29, android.view.MotionEvent r30) {
        throw new UnsupportedOperationException("Method not decompiled: com.mxtech.videoplayer.ActivityScreen.p8(android.view.View, int, android.view.MotionEvent):void");
    }

    public final void p9(boolean z2) {
        if (z2) {
            o9(xk4.b(this, getDisplay()), true);
        } else {
            o9(0, false);
        }
    }

    public final void pa(String str) {
        if (str == null || str.length() <= 0) {
            ?? r5 = this.f1;
            if (r5 == 0 || r5.k) {
                return;
            }
            if (r5.j == null) {
                Animation loadAnimation = AnimationUtils.loadAnimation(r5.getContext(), 2130772016);
                r5.j = loadAnimation;
                loadAnimation.setAnimationListener(r5);
            }
            r5.k = true;
            r5.startAnimation(r5.j);
            return;
        }
        if (this.f1 == null) {
            ?? qVar = new q(this);
            this.f1 = qVar;
            qVar.setId(2131362185);
            this.f1.setIncludeFontPadding(false);
            this.f1.setTextColor(this.a2);
            if (this.T1) {
                this.f1.setBackgroundColor(this.b2);
            }
            RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-2, -2);
            db(this.f1, layoutParams);
            this.T.addView((View) this.f1, (ViewGroup.LayoutParams) layoutParams);
        }
        ?? r0 = this.f1;
        r0.k = false;
        r0.setText(str);
    }

    public final void pb() {
        throw new UnsupportedOperationException("Method not decompiled: com.mxtech.videoplayer.ActivityScreen.pb():void");
    }

    public final void q7() {
        Uri uri;
        if (Q8()) {
            Sa();
            return;
        }
        com.mxtech.videoplayer.n nVar = this.V;
        if (nVar != null && (uri = nVar.o) != null && Files.z(uri.toString())) {
            z6h.d(this, getString(2131886562), false);
            return;
        }
        if (s6d.f1) {
            s6d.f1 = false;
            SharedPreferences.Editor edit = tya.o.b.edit();
            edit.putBoolean("shortcut_pip_new", s6d.f1);
            edit.apply();
        }
        this.o2 = true;
        if (A7(2, true) == 2) {
            finish();
        }
        Va();
    }

    public final boolean q8(int i2) {
        SoundBar Z7;
        if (xk4.g || !s6d.M || (Z7 = Z7()) == null) {
            return false;
        }
        Z7.a();
        Z7.setValue(Z7.getCurrent() + (i2 == 24 ? 1 : -1));
        s6d.t1 = -1;
        ub(this.w0, false, false);
        return true;
    }

    @SuppressLint({WarningType.NewApi})
    public final void q9() {
        RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) this.M0.getLayoutParams();
        ViewGroup viewGroup = (ViewGroup) this.M0.getParent();
        z1j z1jVar = this.D1;
        double d2 = z1jVar.f;
        if (d2 > 0.0d) {
            double d3 = z1jVar.g;
            if (d3 > 0.0d) {
                layoutParams.width = (int) d2;
                layoutParams.height = (int) d3;
                int width = viewGroup.getWidth();
                int height = viewGroup.getHeight();
                int i2 = layoutParams.width;
                if (i2 > width) {
                    int i3 = width - i2;
                    int i4 = i3 / 2;
                    layoutParams.leftMargin = i4;
                    layoutParams.rightMargin = i3 - i4;
                } else {
                    layoutParams.rightMargin = 0;
                    layoutParams.leftMargin = 0;
                }
                int i5 = layoutParams.height;
                if (i5 > height) {
                    int i6 = height - i5;
                    int i7 = i6 / 2;
                    layoutParams.topMargin = i7;
                    layoutParams.bottomMargin = i6 - i7;
                } else {
                    layoutParams.bottomMargin = 0;
                    layoutParams.topMargin = 0;
                }
                layoutParams.addRule(14, -1);
                this.M0.requestLayout();
            }
        }
        layoutParams.width = -1;
        layoutParams.height = -1;
        layoutParams.bottomMargin = 0;
        layoutParams.topMargin = 0;
        layoutParams.rightMargin = 0;
        layoutParams.leftMargin = 0;
        this.M0.requestLayout();
    }

    @SuppressLint({WarningType.NewApi})
    public final void qa(int i2) {
        this.X = i2;
        if (i2 == 1) {
            Ea(false);
            RelativeLayout relativeLayout = this.k0;
            if (relativeLayout != null) {
                relativeLayout.setFitsSystemWindows(false);
                this.k0.requestApplyInsets();
            }
        } else if (i2 == 0) {
            Ea(true);
            RelativeLayout relativeLayout2 = this.k0;
            if (relativeLayout2 != null) {
                relativeLayout2.setFitsSystemWindows(true);
                this.k0.requestApplyInsets();
            }
        } else if (this.k0 != null) {
            Ea(false);
            this.k0.setFitsSystemWindows(true);
            this.k0.requestApplyInsets();
        }
        lb();
    }

    public final void qb() {
        PictureInPictureParams build;
        ArrayList arrayList = new ArrayList();
        if (Build.VERSION.SDK_INT >= 26) {
            Intent putExtra = new Intent("media_control").putExtra("control_type", 3);
            int i2 = ifd.b;
            PendingIntent broadcast = PendingIntent.getBroadcast(this, 103, putExtra, i2);
            boolean z2 = tya.o.b.getBoolean("custom_pip_control", true);
            arrayList.add(vb.c(Icon.createWithResource((Context) this, z2 ? 2131234247 : 2131235031), broadcast));
            arrayList.add(wb.a(Icon.createWithResource((Context) this, this.V.f0 ? 2131234241 : 2131234244), PendingIntent.getBroadcast(this, this.V.f0 ? 102 : 101, new Intent("media_control").putExtra("control_type", this.V.f0 ? 2 : 1), i2)));
            arrayList.add(xb.b(Icon.createWithResource((Context) this, z2 ? 2131234240 : 2131235026), PendingIntent.getBroadcast(this, 104, new Intent("media_control").putExtra("control_type", 4), i2)));
            Object obj = this.p2;
            if (obj != null) {
                rg.c(obj).setActions(arrayList);
                build = rg.c(this.p2).build();
                setPictureInPictureParams(build);
            }
        }
    }

    @Override
    public final void r3(int i2) {
        m9(null, 1, (byte) 0, i2);
    }

    public final int r5() {
        return (this.V1 || this.V.L == 5) ? 50 : 0;
    }

    public void r7(boolean z2) {
        if (this.V != null) {
            if (xk4.g) {
                oug ougVar = new oug(this, this.V);
                this.g2 = ougVar;
                View findViewById = findViewById(2131365427);
                int[] iArr = new int[2];
                findViewById.getLocationOnScreen(iArr);
                ougVar.showAtLocation(findViewById, 0, (findViewById.getWidth() + iArr[0]) - ougVar.getWidth(), iArr[1]);
                gfh.d(new mdg("nowPlayingLocalClicked", weh.c));
                this.g2.setOnDismissListener(new c());
                PlaybackController playbackController = this.l0;
                if (playbackController != null) {
                    playbackController.d();
                    return;
                }
                return;
            }
            if (this.E1 != null) {
                gfh.d(new mdg("nowPlayingLocalClicked", weh.c));
                fob fobVar = new fob();
                this.t2 = fobVar;
                com.mxtech.videoplayer.n nVar = this.V;
                ArrayList<l91> arrayList = this.J2;
                fobVar.h = nVar;
                fobVar.m = arrayList;
                bpb bpbVar = this.E1;
                bpbVar.c(fobVar, z2);
                View view = bpbVar.h;
                if (view != null) {
                    ConstraintLayout.LayoutParams layoutParams = view.getLayoutParams();
                    ((ViewGroup.MarginLayoutParams) layoutParams).leftMargin = d43.f(bpbVar.m, 12.0f);
                    bpbVar.h.setLayoutParams(layoutParams);
                }
            }
        }
    }

    public final void r8() {
        ArrayList<df8> arrayList = this.e2;
        Iterator<df8> it = arrayList.iterator();
        while (it.hasNext()) {
            ViewGroup layout = it.next().getLayout();
            ((ViewGroup) layout.getParent()).removeView(layout);
        }
        arrayList.clear();
        Kb();
    }

    public final void r9() {
        int i2;
        if (this.V.Z()) {
            G6();
            return;
        }
        RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) this.J0.getLayoutParams();
        RelativeLayout.LayoutParams layoutParams2 = (RelativeLayout.LayoutParams) this.M0.getLayoutParams();
        int i3 = layoutParams.width;
        if (i3 < 0 || (i2 = layoutParams.height) < 0) {
            return;
        }
        layoutParams2.leftMargin = layoutParams.leftMargin;
        layoutParams2.topMargin = layoutParams.topMargin;
        layoutParams2.rightMargin = layoutParams.rightMargin;
        layoutParams2.bottomMargin = layoutParams.bottomMargin;
        layoutParams2.width = i3;
        layoutParams2.height = i2;
        int[] rules = layoutParams2.getRules();
        System.arraycopy(layoutParams.getRules(), 0, rules, 0, rules.length);
        this.M0.requestLayout();
    }

    public final void ra(int i2) {
        if (this.C3) {
            return;
        }
        E7(i2);
    }

    public final void rb() {
        va(this.V.b0() ? this.V.L() : 0, (this.l0.getVisibleParts() & 1) != 0);
    }

    @Override
    public final void s1(am8 am8Var) {
        if (this.V.b0()) {
            ArrayList arrayList = new ArrayList(1);
            arrayList.add(am8Var);
            E6(arrayList, this.V.Z, Apps.d(getIntent(), "subs.enable"), s6d.p ? 3 : 0);
        }
    }

    public final void s4(long j2) {
        com.mxtech.videoplayer.n nVar = this.V;
        if (nVar == null || !nVar.c0()) {
            return;
        }
        Jb(L.w);
        zb(j2);
    }

    @Override
    public final void s6() {
        boolean isExternalStorageManager;
        isExternalStorageManager = Environment.isExternalStorageManager();
        if (isExternalStorageManager) {
            u6();
        } else {
            e5b.m9(getSupportFragmentManager(), true, false);
        }
    }

    public void s7(boolean z2) {
        hnb hnbVar;
        if (xk4.g) {
            return;
        }
        if (z2) {
            tya tyaVar = tya.m;
            if (twd.b().getBoolean("key_show_tutorial_new", false)) {
                SharedPreferences.Editor edit = twd.b().edit();
                edit.putBoolean("key_show_tutorial_new", false);
                edit.apply();
                hnbVar = new hnb();
                Bundle bundle = new Bundle();
                bundle.putBoolean("moreEntry", false);
                hnbVar.setArguments(bundle);
                com.mxtech.videoplayer.n nVar = this.V;
                if (nVar != null) {
                    nVar.p0(0);
                }
            } else {
                hnbVar = null;
            }
        } else {
            hnbVar = new hnb();
            Bundle bundle2 = new Bundle();
            bundle2.putBoolean("moreEntry", true);
            hnbVar.setArguments(bundle2);
            com.mxtech.videoplayer.n nVar2 = this.V;
            if (nVar2 != null) {
                nVar2.p0(1);
            }
        }
        if (hnbVar != null) {
            hnbVar.h = new hh(this);
            bpb bpbVar = this.E1;
            bpbVar.o = 4;
            bpbVar.a();
            if (!jz9.N(bpbVar.m) || bpbVar.d == null) {
                return;
            }
            bpbVar.j.clear();
            bpbVar.d(hnbVar, 0, false);
            bpbVar.d.post(new ed(bpbVar, 8));
        }
    }

    public final boolean s9() {
        int i2;
        int i3;
        if (!s6d.s0) {
            return false;
        }
        com.mxtech.media.b bVar = this.V.I;
        FFPlayer u2 = bVar != null ? bVar.u() : null;
        if (u2 != null) {
            i2 = u2.getConnectivity();
            if (i2 == 1) {
                return false;
            }
        } else {
            i2 = -1;
        }
        com.mxtech.videoplayer.n nVar = this.V;
        InetAddress inetAddress = nVar.u;
        if (inetAddress == null || inetAddress.isSiteLocalAddress() || nVar.u.isLoopbackAddress() || (i3 = s6d.t0) == 0) {
            return true;
        }
        return i3 == 2 && i2 == 0;
    }

    public final void sa(int i2, int i3) {
        if (this.u == null) {
            return;
        }
        int dimension = (int) ((j1b) getResources()).a.getDimension(2131165727);
        Toolbar toolbar = this.u;
        toolbar.setPadding(i2, toolbar.getPaddingTop(), i3, this.u.getPaddingBottom());
        this.U.setPadding(i2 + dimension, this.l0.getPaddingTop(), dimension + i3, this.l0.getPaddingBottom());
        UILayout uILayout = this.T;
        uILayout.setPadding(i2, uILayout.getPaddingTop(), i3, this.T.getPaddingBottom());
    }

    public final void sb() {
        if (this.d1 != null) {
            if (T8()) {
                this.d1.setVisibility(8);
            } else {
                this.d1.setVisibility(0);
            }
        }
    }

    @Override
    public void setSupportActionBar(Toolbar toolbar) {
        super.setSupportActionBar(toolbar);
        ActionBar supportActionBar = getSupportActionBar();
        if (supportActionBar != null) {
            supportActionBar.a(this);
        }
        if (toolbar instanceof ScreenToolbar) {
            ((ScreenToolbar) toolbar).setStyle(com.mxtech.videoplayer.o.b(), -1);
        }
        boolean z2 = this.u instanceof ScreenToolbar;
        TextView textView = (TextView) yki.a(toolbar);
        if (textView != null) {
            textView.setSingleLine(false);
            textView.setMaxLines(2);
        }
    }

    @Override
    public final void surfaceChanged(SurfaceHolder surfaceHolder, int i2, int i3, int i4) {
        com.mxtech.media.b bVar;
        FFPlayer u2;
        Log.d("MX.Screen", surfaceHolder + "surface layout changed --> " + i3 + " x " + i4 + " (format:" + i2 + ")");
        if (i3 <= 0 || i4 <= 0 || (bVar = this.V.I) == null || (u2 = bVar.u()) == null) {
            return;
        }
        u2.setSurfaceViewSize(i3, i4);
    }

    @Override
    @SuppressLint({WarningType.NewApi})
    public final void surfaceCreated(SurfaceHolder surfaceHolder) {
        Log.d("MX.Screen", "=== Enter surfaceCreated. holder=" + surfaceHolder + " _surfaceHolderCreated=" + this.L0 + "_surfaceView=" + this.J0);
        this.L0 = surfaceHolder;
        this.O.sendEmptyMessage(7);
        Log.d("MX.Screen", "=== Leave surfaceCreated.");
    }

    @Override
    public final void surfaceDestroyed(SurfaceHolder surfaceHolder) {
        Log.d("MX.Screen", "=== Enter surfaceDestroyed. holder=" + surfaceHolder + " _surfaceHolderCreated=" + this.L0 + "_surfaceView=" + this.J0);
        this.V.C0(null, null, 2);
        this.L0 = null;
        this.K0 = (byte) 0;
        Log.d("MX.Screen", "=== Leave surfaceDestroyed.");
    }

    @Override
    public final void t4(com.mxtech.videoplayer.o oVar, int i2) {
        za(oVar, i2);
    }

    public void t7() {
        ja(-1, "playback_completion");
        this.V.h(0);
        finish();
    }

    public final void t8(a aVar) {
        C8();
        BottomPromotionControllerLayout bottomPromotionControllerLayout = this.e1;
        bottomPromotionControllerLayout.getClass();
        bottomPromotionControllerLayout.b(aVar.e());
    }

    public final boolean t9() {
        return this.X == 2 || s6d.w1 == 2;
    }

    public final void tb() {
        ntf ntfVar;
        RecyclerView recyclerView;
        LinearLayoutManager layoutManager;
        if (!g9()) {
            ArrayList arrayList = this.n0;
            if (arrayList == null || this.o0 == null || (ntfVar = this.y0) == null || !this.p0 || !arrayList.contains(ntfVar)) {
                return;
            }
            this.o0.notifyItemRemoved(this.n0.indexOf(this.y0));
            this.n0.remove(this.y0);
            return;
        }
        if (this.y0 == null) {
            this.y0 = new ntf(10, 0, false, false, 2131234809, getString(2131890128));
        }
        ArrayList arrayList2 = this.n0;
        if (arrayList2 != null && !arrayList2.contains(this.y0) && this.p0) {
            this.n0.add(this.y0);
            Collections.sort(this.n0, new a());
            this.o0.notifyDataSetChanged();
        }
        if (!M8() || (recyclerView = this.m0) == null || this.o0 == null || (layoutManager = recyclerView.getLayoutManager()) == null) {
            return;
        }
        layoutManager.w1(this.o0.i.size() - this.o0.d(), 0);
    }

    @Override
    public void u3(boolean z2) {
        ImageButton imageButton = this.t1;
        if (imageButton != null) {
            if (z2) {
                imageButton.getDrawable().setLevel(2);
            } else {
                imageButton.getDrawable().setLevel(1);
            }
        }
        if (this.A3 && !z2) {
            this.z3 = false;
        }
        Db(false);
        if (T8() && jz9.N(this)) {
            qb();
        }
    }

    @Override
    public void u6() {
        super.u6();
        if (this.V.I == null) {
            Intent intent = getIntent();
            J6(intent, intent.getData(), null);
        }
    }

    public final e u7() {
        tjg u76Var;
        if (this.a3 == null) {
            this.a3 = new eo0<>();
            fab e8 = e8();
            if (e8 != null) {
                for (am8 am8Var : this.Q0.getAllSubtitles()) {
                    if ((am8Var.o() & 65536) == 0) {
                        Uri a2 = am8Var.a();
                        String uri = a2.toString();
                        int indexOf = uri.indexOf(35);
                        if (indexOf >= 0) {
                            a2 = Uri.parse(uri.substring(0, indexOf));
                        }
                        if (!this.a3.containsKey(a2)) {
                            String scheme = a2.getScheme();
                            if (scheme == null || scheme.equals("file")) {
                                u76Var = new u76(a2, new File(a2.getPath()));
                            } else {
                                u76Var = (tjg) this.V.Y.get(a2);
                                if (u76Var == null) {
                                }
                            }
                            this.a3.put(a2, new f.b(e8, u76Var));
                        }
                    }
                }
            }
        }
        return this.a3.values();
    }

    public final void u8() {
        RecyclerView recyclerView;
        w8(0);
        if (h9() && (recyclerView = this.m0) != null) {
            recyclerView.setVisibility(4);
        }
        Ra(false);
    }

    public final boolean u9(boolean z2) {
        return getIntent().getBooleanExtra("video", z2);
    }

    public final void ua(int i2) {
        this.h1 = findViewById(2131365459);
        this.i1 = findViewById(2131365145);
        this.k1 = (ZoomButton) findViewById(2131362213);
        this.j1 = (ZoomButton) findViewById(2131363583);
        if (!jz9.N(this) || this.h1 == null || this.i1 == null || this.k1 == null || this.j1 == null) {
            return;
        }
        int dimensionPixelSize = ((j1b) getResources()).a.getDimensionPixelSize(2131166236);
        int dimensionPixelSize2 = ((j1b) getResources()).a.getDimensionPixelSize(2131166163);
        if (i2 == 2) {
            RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) this.h1.getLayoutParams();
            layoutParams.width = dimensionPixelSize;
            this.h1.setLayoutParams(layoutParams);
            RelativeLayout.LayoutParams layoutParams2 = (RelativeLayout.LayoutParams) this.k1.getLayoutParams();
            layoutParams2.width = dimensionPixelSize;
            this.k1.setLayoutParams(layoutParams2);
            RelativeLayout.LayoutParams layoutParams3 = (RelativeLayout.LayoutParams) this.i1.getLayoutParams();
            layoutParams3.width = dimensionPixelSize;
            this.i1.setLayoutParams(layoutParams3);
            RelativeLayout.LayoutParams layoutParams4 = (RelativeLayout.LayoutParams) this.j1.getLayoutParams();
            layoutParams4.width = dimensionPixelSize;
            this.j1.setLayoutParams(layoutParams4);
            RelativeLayout.LayoutParams layoutParams5 = (RelativeLayout.LayoutParams) this.t1.getLayoutParams();
            layoutParams5.width = dimensionPixelSize;
            this.t1.setLayoutParams(layoutParams5);
            return;
        }
        RelativeLayout.LayoutParams layoutParams6 = (RelativeLayout.LayoutParams) this.h1.getLayoutParams();
        layoutParams6.width = dimensionPixelSize2;
        this.h1.setLayoutParams(layoutParams6);
        RelativeLayout.LayoutParams layoutParams7 = (RelativeLayout.LayoutParams) this.k1.getLayoutParams();
        layoutParams7.width = dimensionPixelSize2;
        this.k1.setLayoutParams(layoutParams7);
        RelativeLayout.LayoutParams layoutParams8 = (RelativeLayout.LayoutParams) this.i1.getLayoutParams();
        layoutParams8.width = dimensionPixelSize2;
        this.i1.setLayoutParams(layoutParams8);
        RelativeLayout.LayoutParams layoutParams9 = (RelativeLayout.LayoutParams) this.j1.getLayoutParams();
        layoutParams9.width = dimensionPixelSize2;
        this.j1.setLayoutParams(layoutParams9);
        RelativeLayout.LayoutParams layoutParams10 = (RelativeLayout.LayoutParams) this.t1.getLayoutParams();
        layoutParams10.width = dimensionPixelSize2;
        this.t1.setLayoutParams(layoutParams10);
    }

    public final void ub(ntf ntfVar, boolean z2, boolean z3) {
        int i2;
        LinearLayoutManager layoutManager;
        if ((ntfVar == null || ntfVar.d == z2) && !z3) {
            return;
        }
        ArrayList arrayList = this.n0;
        if (arrayList == null || this.o0 == null || !this.p0) {
            i2 = 0;
        } else {
            i2 = arrayList.indexOf(ntfVar);
            ntfVar.d = z2;
            this.o0.notifyItemChanged(i2);
        }
        RecyclerView recyclerView = this.m0;
        if (recyclerView == null || (layoutManager = recyclerView.getLayoutManager()) == null || layoutManager.c1() <= i2) {
            return;
        }
        layoutManager.w1(i2, 0);
    }

    @Override
    public final void v1(int i2) {
        if ((i2 & 236) != 0) {
            this.O.sendEmptyMessageDelayed(13, 1000L);
        }
    }

    @Override
    public final void v7() {
        pa(null);
    }

    public final df8 v9(int i2) throws IllegalArgumentException {
        ViewGroup viewGroup = (ViewGroup) this.T.getParent();
        if (i2 == 2131365390) {
            return new kod(viewGroup, this.Q, this);
        }
        if (i2 == 2131366294) {
            return new hkg(viewGroup, this.Q, this.Q0);
        }
        if (i2 == 2131366292) {
            return new gkg(viewGroup, this.Q, this.Q0);
        }
        if (i2 == 2131365651) {
            return new hqe(viewGroup, this.Q, this);
        }
        if (i2 == 2131362171) {
            return new tu0(viewGroup, this.Q, this);
        }
        if (i2 == 2131367842) {
            return new a2j(viewGroup, this.Q, this, this.D1);
        }
        throw new IllegalArgumentException(wh0.c(i2, "Unknown floating bar: id="));
    }

    public final void va(int i2, boolean z2) {
        String formatElapsedTime;
        String str;
        int i3 = i2 / TranslateInfo.MX_MAX_LENGTH;
        int i4 = this.U1 ? i3 - this.K1 : this.K1;
        if (z2 && i3 == this.o3 && i4 == this.p3) {
            z2 = false;
        }
        boolean z3 = (this.g1 == null || (i3 == this.q3 && i4 == this.r3)) ? false : true;
        if (z2 || z3) {
            StringBuilder sb = L.w;
            if (i3 < 0) {
                DateUtils.formatElapsedTime(sb, -i3);
                sb.insert(0, '-');
                formatElapsedTime = sb.toString();
            } else {
                formatElapsedTime = DateUtils.formatElapsedTime(sb, i3);
            }
            if (!this.U1) {
                str = this.J1;
            } else if (i4 < 0) {
                DateUtils.formatElapsedTime(sb, -i4);
                sb.insert(0, '-');
                str = sb.toString();
            } else {
                str = DateUtils.formatElapsedTime(sb, i4);
            }
            if (z2) {
                TextView textView = this.n1;
                TextView.BufferType bufferType = TextView.BufferType.NORMAL;
                textView.setText(formatElapsedTime, bufferType);
                if (this.U1) {
                    this.o1.setText(str, bufferType);
                }
                this.o3 = i3;
                this.p3 = i4;
            }
            if (z3) {
                sb.setLength(0);
                this.g1.setText(fh.e(sb, formatElapsedTime, " / ", str), TextView.BufferType.NORMAL);
                this.q3 = i3;
                this.r3 = i4;
            }
        }
    }

    public final void vb() {
        qtf qtfVar;
        boolean z2;
        if (h9()) {
            Ma();
            if (this.V.b0()) {
                if (this.n0 == null) {
                    this.n0 = new ArrayList();
                }
                ArrayList arrayList = this.n0;
                if (arrayList != null) {
                    if ((s6d.e1 & 4) == 0) {
                        ntf ntfVar = this.q0;
                        if (ntfVar != null && arrayList.contains(ntfVar)) {
                            this.n0.remove(this.q0);
                            this.q0 = null;
                        }
                    } else if (this.q0 == null) {
                        ntf ntfVar2 = new ntf(9, 0, i9(), false, 2131234073, getString(2131890494));
                        this.q0 = ntfVar2;
                        this.n0.add(ntfVar2);
                    } else {
                        Db(false);
                    }
                    boolean z3 = true;
                    if ((s6d.e1 & SkinViewInflater.FLAG_BUTTON_TINT) != 0) {
                        ntf ntfVar3 = this.r0;
                        if (ntfVar3 == null) {
                            com.mxtech.videoplayer.n nVar = this.V;
                            ntf ntfVar4 = new ntf(0, 0, nVar != null && nVar.u0, false, 2131235567, getString(2131889269));
                            this.r0 = ntfVar4;
                            this.n0.add(ntfVar4);
                        } else {
                            boolean z4 = ntfVar3.d;
                            if (ntfVar3 != null) {
                                ntfVar3.h = false;
                                ub(ntfVar3, z4, false);
                            }
                        }
                    } else {
                        ntf ntfVar5 = this.r0;
                        if (ntfVar5 != null && this.n0.contains(ntfVar5)) {
                            this.n0.remove(this.r0);
                            this.r0 = null;
                        }
                    }
                    if ((s6d.e1 & SkinViewInflater.FLAG_DRAWABLE_TINT) == 0 || xk4.g) {
                        ntf ntfVar6 = this.s0;
                        if (ntfVar6 != null && this.n0.contains(ntfVar6)) {
                            this.n0.remove(this.s0);
                            this.s0 = null;
                        }
                    } else {
                        ntf ntfVar7 = this.s0;
                        if (ntfVar7 == null) {
                            ntf ntfVar8 = new ntf(14, 0, false, s6d.k1, 2131235019, getString(2131887197));
                            this.s0 = ntfVar8;
                            this.n0.add(ntfVar8);
                        } else {
                            ntfVar7.h = s6d.k1;
                        }
                    }
                    if ((s6d.e1 & 32) == 0) {
                        ntf ntfVar9 = this.t0;
                        if (ntfVar9 != null && this.n0.contains(ntfVar9)) {
                            this.n0.remove(this.t0);
                            this.t0 = null;
                        }
                    } else if (this.t0 == null) {
                        ntf ntfVar10 = new ntf(1, 0, s6d.G0, false, 2131235835, getString(2131890332));
                        this.t0 = ntfVar10;
                        this.n0.add(ntfVar10);
                    } else {
                        xb();
                    }
                    if ((s6d.e1 & 8) == 0) {
                        ntf ntfVar11 = this.u0;
                        if (ntfVar11 != null && this.n0.contains(ntfVar11)) {
                            this.n0.remove(this.u0);
                            this.u0 = null;
                        }
                    } else if (this.u0 == null) {
                        int i2 = s6d.H0;
                        ntf ntfVar12 = new ntf(2, 0, i2 != 0, false, i2 == 1 ? 2131235754 : 2131235753, getString(2131888618));
                        this.u0 = ntfVar12;
                        this.n0.add(ntfVar12);
                    } else {
                        nb();
                    }
                    if ((s6d.e1 & 2) == 0) {
                        ntf ntfVar13 = this.v0;
                        if (ntfVar13 != null && this.n0.contains(ntfVar13)) {
                            this.n0.remove(this.v0);
                            this.v0 = null;
                        }
                    } else if (this.v0 == null) {
                        ntf ntfVar14 = new ntf(!(Math.abs(this.V.R() - 1.0d) < 0.01d), getString(2131890455), X8(this.V.R()) ? 16.0f : 12.0f);
                        this.v0 = ntfVar14;
                        ntfVar14.i = b8(this.V.R());
                        this.n0.add(this.v0);
                    } else {
                        Ab(this.V.R());
                    }
                    if ((s6d.e1 & 16) != 0) {
                        ntf ntfVar15 = this.w0;
                        if (ntfVar15 == null) {
                            ntf ntfVar16 = new ntf(3, 0, s6d.s1, false, 2131236022, getString(2131888941));
                            this.w0 = ntfVar16;
                            this.n0.add(ntfVar16);
                        } else {
                            boolean z5 = ntfVar15.d;
                            if (ntfVar15 != null) {
                                ub(ntfVar15, z5, false);
                            }
                        }
                    } else {
                        ntf ntfVar17 = this.w0;
                        if (ntfVar17 != null && this.n0.contains(ntfVar17)) {
                            this.n0.remove(this.w0);
                            this.w0 = null;
                        }
                    }
                    if ((s6d.e1 & 64) == 0) {
                        ntf ntfVar18 = this.x0;
                        if (ntfVar18 != null && this.n0.contains(ntfVar18)) {
                            this.n0.remove(this.x0);
                            this.x0 = null;
                        }
                    } else if (this.x0 == null) {
                        ntf ntfVar19 = new ntf(6, 0, s6d.Y0, false, 2131233943, getString(2131887568));
                        this.x0 = ntfVar19;
                        this.n0.add(ntfVar19);
                    }
                    if ((s6d.e1 & 1) == 0) {
                        ntf ntfVar20 = this.y0;
                        if (ntfVar20 != null && this.n0.contains(ntfVar20)) {
                            this.n0.remove(this.y0);
                            this.y0 = null;
                        }
                    } else if (g9() && this.y0 == null) {
                        ntf ntfVar21 = new ntf(10, 0, false, false, 2131234809, getString(2131890128));
                        this.y0 = ntfVar21;
                        this.n0.add(ntfVar21);
                    } else {
                        tb();
                    }
                    if ((s6d.e1 & SkinViewInflater.FLAG_SWITCH_TRACK) == 0) {
                        ntf ntfVar22 = this.A0;
                        if (ntfVar22 != null && this.n0.contains(ntfVar22)) {
                            this.n0.remove(this.A0);
                            this.A0 = null;
                        }
                    } else if (this.A0 == null) {
                        b1g b1gVar = L.t;
                        ntf ntfVar23 = new ntf(4, 0, (b1gVar == null || b1gVar.d) ? false : true, false, 2131235975, getString(2131890347));
                        this.A0 = ntfVar23;
                        this.n0.add(ntfVar23);
                    } else {
                        zb(-1L);
                    }
                    if ((s6d.e1 & SkinViewInflater.FLAG_ANDROID_FOREGROUND) != 0) {
                        com.mxtech.videoplayer.n nVar2 = this.V;
                        if (nVar2 != null) {
                            z2 = (nVar2.g0 == -1 || nVar2.h0 == -1) ? false : true;
                        } else {
                            z2 = false;
                        }
                        ntf ntfVar24 = this.B0;
                        if (ntfVar24 == null) {
                            ntf ntfVar25 = new ntf(5, 0, z2, false, 2131233116, getString(2131889912));
                            this.B0 = ntfVar25;
                            this.n0.add(ntfVar25);
                        } else if (ntfVar24 != null) {
                            ntfVar24.h = s6d.i1;
                            ub(ntfVar24, z2, false);
                        }
                    } else {
                        ntf ntfVar26 = this.B0;
                        if (ntfVar26 != null && this.n0.contains(ntfVar26)) {
                            this.n0.remove(this.B0);
                            this.B0 = null;
                        }
                    }
                    if ((s6d.e1 & SkinViewInflater.FLAG_ANDROID_TEXT_COLOR_HINT) == 0 || Build.VERSION.SDK_INT < 26 || this.B1) {
                        ntf ntfVar27 = this.C0;
                        if (ntfVar27 != null && this.n0.contains(ntfVar27)) {
                            this.n0.remove(this.C0);
                            this.C0 = null;
                        }
                    } else {
                        ntf ntfVar28 = this.C0;
                        if (ntfVar28 == null) {
                            ntf ntfVar29 = new ntf(15, 0, false, s6d.l1, 2131235022, getString(2131890133));
                            this.C0 = ntfVar29;
                            this.n0.add(ntfVar29);
                        } else {
                            ntfVar28.h = s6d.l1;
                        }
                    }
                    byte b2 = this.V.F;
                    if (b2 != 4 && b2 != 2) {
                        z3 = false;
                    }
                    if ((s6d.e1 & SkinViewInflater.FLAG_ANDROID_DRAWABLELEFT) == 0) {
                        ntf ntfVar30 = this.D0;
                        if (ntfVar30 != null && this.n0.contains(ntfVar30)) {
                            this.n0.remove(this.D0);
                            this.D0 = null;
                        }
                    } else if (z3) {
                        ntf ntfVar31 = this.D0;
                        if (ntfVar31 == null) {
                            ntf ntfVar32 = new ntf(16, 0, this.c2, s6d.m1, 2131234630, getString(2131888832));
                            this.D0 = ntfVar32;
                            this.n0.add(ntfVar32);
                        } else {
                            ub(ntfVar31, this.c2, false);
                        }
                    } else {
                        ntf ntfVar33 = this.D0;
                        if (ntfVar33 != null && this.n0.contains(ntfVar33)) {
                            this.n0.remove(this.D0);
                            this.D0 = null;
                            this.c2 = false;
                        }
                    }
                    if ((s6d.e1 & SkinViewInflater.FLAG_ANDROID_BUTTON) == 0) {
                        ntf ntfVar34 = this.E0;
                        if (ntfVar34 != null && this.n0.contains(ntfVar34)) {
                            this.n0.remove(this.E0);
                            this.E0 = null;
                        }
                    } else if (z3) {
                        ntf ntfVar35 = this.E0;
                        if (ntfVar35 == null) {
                            ntf ntfVar36 = new ntf(17, 0, this.d2, s6d.n1, 2131235099, getString(2131891100));
                            this.E0 = ntfVar36;
                            this.n0.add(ntfVar36);
                        } else {
                            ub(ntfVar35, this.d2, false);
                        }
                    } else {
                        ntf ntfVar37 = this.E0;
                        if (ntfVar37 != null && this.n0.contains(ntfVar37)) {
                            this.n0.remove(this.E0);
                            this.E0 = null;
                            this.d2 = false;
                        }
                    }
                    Iterator it = this.n0.iterator();
                    int i3 = 0;
                    while (it.hasNext()) {
                        int i4 = ((ntf) it.next()).b;
                        if (i4 != 11 && i4 != 12) {
                            i3++;
                        }
                    }
                    if (i3 <= 5) {
                        ntf ntfVar38 = this.z0;
                        if (ntfVar38 != null && this.n0.contains(ntfVar38)) {
                            this.n0.remove(this.z0);
                            this.z0 = null;
                        }
                    } else if (this.z0 == null) {
                        ntf ntfVar39 = new ntf(11, 0, false, s6d.g1, 2131233818, (String) null);
                        this.z0 = ntfVar39;
                        this.n0.add(ntfVar39);
                    }
                    Collections.sort(this.n0, new a());
                }
            }
            ArrayList arrayList2 = this.n0;
            if (arrayList2 == null || (qtfVar = this.o0) == null || this.m0 == null) {
                return;
            }
            qtfVar.i = arrayList2;
            ntf ntfVar40 = qtfVar.m;
            arrayList2.remove(ntfVar40);
            qtfVar.k = qtfVar.d();
            qtfVar.i.add(ntfVar40);
            qtfVar.l = false;
            qtfVar.notifyDataSetChanged();
            this.o0.j = this;
            LinearLayoutManager layoutManager = this.m0.getLayoutManager();
            if (layoutManager != null) {
                layoutManager.w1(this.o0.i.size() - this.o0.d(), 0);
            }
        }
    }

    public final void w5() {
        this.G1 = 0;
        this.H1 = 0;
    }

    @SuppressLint({WarningType.NewApi})
    public final void w7() {
        try {
            if (this.V.g0() != null) {
                this.u3 = null;
                if (this.t3 == null) {
                    this.t3 = new ImageView(this);
                    this.S.addView(this.t3, h8(1), new RelativeLayout.LayoutParams(-1, -1));
                    this.t3.setScaleType(ImageView.ScaleType.FIT_CENTER);
                }
                Bitmap A = this.V.A(this.q);
                if (this.u3 != A) {
                    this.t3.setImageBitmap(A);
                    this.u3 = A;
                }
            }
        } catch (OutOfMemoryError e2) {
            Log.e("MX.Screen", "", e2);
        }
    }

    public final void w8(int i2) {
        t8(a.b);
        this.l0.setVisibleParts(0, i2);
    }

    public final Uri w9() {
        Uri k0 = this.V.k0();
        if (k0 == null) {
            z6h.c(getApplicationContext(), 2131889300, true);
        } else {
            ea();
            fa();
            ga();
        }
        return k0;
    }

    public final void wa(int i2, int i3, g0 g0Var) {
        int i4 = i2 / TranslateInfo.MX_MAX_LENGTH;
        int i5 = i3 / TranslateInfo.MX_MAX_LENGTH;
        SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder();
        if (i4 >= 0) {
            spannableStringBuilder.append((CharSequence) DateUtils.formatElapsedTime(L.w, i4));
        } else {
            spannableStringBuilder.append('-').append((CharSequence) DateUtils.formatElapsedTime(L.w, -i4));
        }
        int length = spannableStringBuilder.length();
        spannableStringBuilder.append('\n').append('[');
        if (i5 >= 0) {
            spannableStringBuilder.append('+').append((CharSequence) DateUtils.formatElapsedTime(L.w, i5));
        } else {
            spannableStringBuilder.append('-').append((CharSequence) DateUtils.formatElapsedTime(L.w, -i5));
        }
        spannableStringBuilder.append(']');
        spannableStringBuilder.setSpan(q4, length, spannableStringBuilder.length(), 33);
        if (g0Var != null) {
            spannableStringBuilder.setSpan(g0Var, 0, 0, 17);
        }
        A5(spannableStringBuilder);
    }

    public final void wb(ntf ntfVar) {
        ArrayList arrayList;
        if (ntfVar == null || (arrayList = this.n0) == null || this.o0 == null || !this.p0) {
            return;
        }
        int indexOf = arrayList.indexOf(ntfVar);
        ntfVar.h = false;
        this.o0.notifyItemChanged(indexOf);
    }

    @Override
    public final int x1(int i2) {
        return (int) ((i2 - r0.m) * this.Q0.n);
    }

    @SuppressLint({WarningType.NewApi})
    public final void x7() {
        if (this.J0 == null && this.L0 == null) {
            SurfaceView surfaceView = new SurfaceView(this);
            this.J0 = surfaceView;
            surfaceView.setId(2131366313);
            SurfaceHolder holder = this.J0.getHolder();
            holder.addCallback(this);
            holder.setFormat(s6d.h());
            holder.setType(this.V.F == 2 ? 0 : 3);
            RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-1, -1);
            if ((this.b0 & 6) == 0 && !this.I1) {
                layoutParams.addRule(13);
            }
            this.S.addView(this.J0, h8(0), layoutParams);
            if (this.M0 != null) {
                Eb();
            }
            com.mxtech.videoplayer.n nVar = this.V;
            if (nVar == null || !nVar.u0) {
                return;
            }
            G7();
        }
    }

    public final void x9() {
        cpa cpaVar;
        Ta();
        ab();
        ea();
        fa();
        ga();
        if (!isFinishing() && ((!this.V.b0() || !this.V.l0()) && ((cpaVar = this.V0) == null || !cpaVar.a()))) {
            t7();
            return;
        }
        nqd nqdVar = new nqd();
        this.f2 = nqdVar;
        nqdVar.h = true;
        nqdVar.i = true;
    }

    public final void xa(boolean z2) {
        this.U1 = z2;
        if (!z2) {
            this.o1.setText(this.J1);
            return;
        }
        this.o3 = Integer.MIN_VALUE;
        this.p3 = Integer.MIN_VALUE;
        this.q3 = Integer.MIN_VALUE;
        this.r3 = Integer.MIN_VALUE;
        rb();
    }

    public final void xb() {
        ntf ntfVar = this.t0;
        if (ntfVar != null) {
            ub(ntfVar, s6d.G0, false);
        }
    }

    public final void y3() {
        wbe e2 = this.R0.e();
        this.Q0.m(e2);
        this.R0.j(e2);
        File file = new File(e2.c.getPath());
        File file2 = new File(file.getParent(), bl0.c("translate", file.getName()));
        if (file2.exists()) {
            for (String str : file2.list()) {
                File file3 = new File(file2, str);
                if (file3.exists() && file3.isFile()) {
                    file3.delete();
                }
            }
            file2.delete();
        }
        this.Q0.a(e2, true);
    }

    public final boolean y8() {
        SubtitlePanel subtitlePanel = this.N0;
        if (subtitlePanel == null) {
            return false;
        }
        ViewGroup viewGroup = subtitlePanel.i;
        if (viewGroup != null) {
            ((ViewGroup) viewGroup.getParent()).removeView(subtitlePanel.i);
            subtitlePanel.a();
            subtitlePanel.j.b = null;
            subtitlePanel.k.setOnClickListener(null);
            subtitlePanel.i = null;
            subtitlePanel.j = null;
            subtitlePanel.k = null;
            subtitlePanel.l = null;
        }
        this.N0 = null;
        lb();
        return true;
    }

    public final void ya(int i2) {
        TextView textView = this.z2;
        if (textView == null || textView.getTextColors().getDefaultColor() == i2) {
            return;
        }
        this.z2.setTextColor(i2);
        ImageView imageView = this.A2;
        if (imageView != null) {
            imageView.setColorFilter(i2, PorterDuff.Mode.SRC_ATOP);
        }
    }

    public final void yb() {
        this.D2 = false;
        Kb();
        z1j z1jVar = this.D1;
        z1jVar.k();
        z1jVar.b();
        if (this.M0 == null || this.d0) {
            return;
        }
        q9();
        this.M0.requestLayout();
    }

    public final void za(com.mxtech.videoplayer.o oVar, int i2) {
        this.l0.setStyle(oVar, i2);
        ScreenToolbar screenToolbar = this.u;
        if (screenToolbar != null) {
            screenToolbar.setStyle(oVar, i2);
        }
        a8().setStyle(oVar, i2);
        M7().setStyle(oVar, i2);
        if (h9() && this.m0 != null && this.o0 != null) {
            for (int i3 = 0; i3 < this.o0.i.size(); i3++) {
                g f02 = this.m0.f0(i3);
                if (f02 instanceof g) {
                    f02.p0(oVar, i2);
                }
            }
        }
        ZoomButton zoomButton = this.q1;
        if (zoomButton != null && zoomButton.getId() == 2131365419) {
            this.q1.setColorFilter(com.mxtech.videoplayer.o.b().a());
            Drawable background = this.q1.getBackground();
            if (background != null) {
                gl0.a(background, com.mxtech.videoplayer.o.b().k);
            }
        }
        ZoomButton zoomButton2 = this.r1;
        if (zoomButton2 == null || zoomButton2.getId() != 2131365420) {
            return;
        }
        this.r1.setColorFilter(com.mxtech.videoplayer.o.b().a());
        Drawable background2 = this.r1.getBackground();
        if (background2 != null) {
            gl0.a(background2, com.mxtech.videoplayer.o.b().k);
        }
    }

    public final void zb(long j2) {
        String format;
        ntf ntfVar = this.A0;
        if (ntfVar != null) {
            ntfVar.h = s6d.h1;
            boolean z2 = false;
            if (j2 <= 0) {
                b1g b1gVar = L.t;
                ub(ntfVar, (b1gVar == null || b1gVar.d) ? false : true, false);
                return;
            }
            long j3 = j2 / 3600;
            long j4 = (j2 % 3600) / 60;
            long j5 = j2 % 60;
            if (j3 > 0) {
                format = String.format("%02d:%02d:%02d", Long.valueOf(j3), Long.valueOf(j4), Long.valueOf(j5));
                this.A0.f = 9.0f;
            } else {
                format = String.format("%02d:%02d", Long.valueOf(j4), Long.valueOf(j5));
                this.A0.f = 11.0f;
            }
            ntf ntfVar2 = this.A0;
            ntfVar2.i = format;
            b1g b1gVar2 = L.t;
            if (b1gVar2 != null && !b1gVar2.d) {
                z2 = true;
            }
            ub(ntfVar2, z2, true);
        }
    }

    public static class o {
        public final CharSequence a;
        public final int b;
        public final File c;

        public o() {
            this.a = tya.w().getString(2131887363);
            this.b = -1;
            this.c = null;
        }

        public static int a(ArrayList arrayList, File file) {
            Iterator it = arrayList.iterator();
            int i = 0;
            while (it.hasNext()) {
                if (file.equals(((o) it.next()).c)) {
                    return i;
                }
                i++;
            }
            return -1;
        }

        public o(gh8 gh8Var, int i, int i2) {
            this.b = i;
            this.c = null;
            tl8 R = gh8Var.R(i);
            try {
                String j = R.j();
                String u = R.u();
                if (j != null) {
                    if (j.length() == 0) {
                    }
                    if (u != null && u.length() > 0) {
                        j = j + " - " + u;
                    }
                    this.a = j;
                    R.close();
                }
                j = mfg.o(2131886391, Integer.valueOf(i2 + 1));
                if (u != null) {
                    j = j + " - " + u;
                }
                this.a = j;
                R.close();
            } catch (Throwable th) {
                R.close();
                throw th;
            }
        }

        public o(File file) {
            SpannableStringBuilder append;
            String path = file.getPath();
            SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder();
            int length = path.length();
            char c = File.separatorChar;
            spannableStringBuilder.append((CharSequence) path, path.lastIndexOf(c, length - 1) + 1, length);
            int length2 = spannableStringBuilder.length();
            spannableStringBuilder.setSpan(L.o(), length2, length2, 18);
            spannableStringBuilder.append((CharSequence) " (");
            int length3 = path.length();
            int lastIndexOf = path.lastIndexOf(c, length3 - 1);
            if (lastIndexOf > 0) {
                append = spannableStringBuilder.append((CharSequence) path, 0, lastIndexOf);
            } else if (lastIndexOf == 0 && length3 > 1) {
                append = spannableStringBuilder.append(c);
            } else {
                append = spannableStringBuilder.append((CharSequence) "null");
            }
            append.append(')');
            this.a = spannableStringBuilder;
            this.b = -1;
            this.c = file;
        }
    }

    public class v implements View.OnClickListener, View.OnLongClickListener, DialogInterface.OnClickListener, DialogInterface.OnMultiChoiceClickListener, DialogInterface.OnDismissListener {
        public int b;

        public v() {
            ActivityScreen.this.p1.setOnClickListener(this);
            ActivityScreen.this.p1.setOnLongClickListener(this);
            this.b = tya.o.b.getInt("lock_target", 1);
            b();
        }

        public final boolean a(boolean z) {
            ?? r2 = ActivityScreen.this;
            if (r2.isFinishing()) {
                return false;
            }
            if (xk4.g) {
                d.a aVar = new d.a((Context) r2);
                aVar.l(2131888563);
                int i = this.b;
                aVar.c(2130903078, new boolean[]{(i & 1) != 0, (i & 2) != 0}, this);
                aVar.g(R.string.ok, this);
                aVar.f(2131886817, this);
                r2.c4(aVar.a(), this);
            } else if (r2.E1 != null) {
                unb unbVar = new unb();
                unbVar.l = r2.B3;
                r2.E1.b(unbVar, z);
            }
            return true;
        }

        public final void b() {
            int i = this.b;
            ActivityScreen activityScreen = ActivityScreen.this;
            int i2 = 3;
            if (i != 2) {
                i2 = i != 3 ? 0 : 1;
            } else if (activityScreen.C3) {
                i2 = 2;
            }
            activityScreen.p1.getDrawable().setLevel(i2);
        }

        @Override
        public final void onClick(View view) {
            int i = this.b & 2;
            ActivityScreen activityScreen = ActivityScreen.this;
            if (i != 0) {
                activityScreen.p9(!activityScreen.C3);
            }
            int i2 = this.b;
            if ((i2 & 1) != 0) {
                if (ActivityScreen.C6(activityScreen, (i2 & 2) != 0)) {
                    activityScreen.R1 = true;
                }
                activityScreen.W9();
            }
        }

        @Override
        public final void onDismiss(DialogInterface dialogInterface) {
            if (tya.o.b.getInt("lock_target", 1) != this.b) {
                SharedPreferences.Editor edit = tya.o.b.edit();
                edit.putInt("lock_target", this.b);
                edit.apply();
            }
            ActivityScreen.this.p.k(dialogInterface);
        }

        @Override
        public final boolean onLongClick(View view) {
            return a(false);
        }

        @Override
        public final void onClick(DialogInterface dialogInterface, int i) {
            if (i == -1) {
                int i2 = this.b & 2;
                ActivityScreen activityScreen = ActivityScreen.this;
                if (i2 != 0) {
                    String str = ActivityScreen.p4;
                    activityScreen.p9(true);
                }
                int i3 = this.b;
                if ((i3 & 1) != 0) {
                    if (ActivityScreen.C6(activityScreen, (i3 & 2) != 0)) {
                        activityScreen.V.x0();
                    }
                }
            }
        }

        @Override
        public final void onClick(DialogInterface dialogInterface, int i, boolean z) {
            int i2 = i == 0 ? 1 : 2;
            if (z) {
                this.b = i2 | this.b;
            } else {
                this.b = (~i2) & this.b;
            }
            b();
        }
    }

    public class z implements ListAdapter, View.OnClickListener, View.OnLongClickListener, DialogInterface.OnClickListener, DialogInterface.OnDismissListener, AdapterView.OnItemClickListener {
        public int b;
        public boolean c;
        public AlertController.RecycleListView d;
        public x24 f;
        public int g;
        public LayoutInflater h;

        public z() {
        }

        public final void a() {
            if (this.c == s6d.G0 && this.b == s6d.H0) {
                return;
            }
            SharedPreferences.Editor edit = tya.o.b.edit();
            edit.putBoolean("shuffle", this.c);
            edit.putInt("loop.2", this.b);
            edit.apply();
            ActivityScreen activityScreen = ActivityScreen.this;
            activityScreen.xb();
            activityScreen.nb();
        }

        @Override
        public final boolean areAllItemsEnabled() {
            return true;
        }

        public final void b() {
            int i = this.b;
            if (i == 0) {
                this.d.setItemChecked(0, false);
                this.d.setItemChecked(1, false);
            } else if (i == 1) {
                this.d.setItemChecked(0, true);
                this.d.setItemChecked(1, false);
            } else if (i == 9) {
                this.d.setItemChecked(0, false);
                this.d.setItemChecked(1, true);
            }
            this.d.setItemChecked(2, this.c);
        }

        @Override
        public final int getCount() {
            return 3;
        }

        @Override
        public final Object getItem(int i) {
            return Integer.valueOf(i);
        }

        @Override
        public final long getItemId(int i) {
            return i;
        }

        @Override
        public final int getItemViewType(int i) {
            return 0;
        }

        @Override
        public final View getView(int i, View view, ViewGroup viewGroup) {
            if (view == null) {
                view = this.h.inflate(this.g, viewGroup, false);
            }
            TextView textView = (TextView) view.findViewById(R.id.text1);
            a aVar = ActivityScreen.this;
            textView.setText(i != 0 ? i != 1 ? i != 2 ? "" : aVar.getString(2131890332) : aVar.getString(2131888619) : aVar.getString(2131888620));
            textView.setEnabled(true);
            return view;
        }

        @Override
        public final int getViewTypeCount() {
            return 1;
        }

        @Override
        public final boolean hasStableIds() {
            return true;
        }

        @Override
        public final boolean isEmpty() {
            return false;
        }

        @Override
        public final boolean isEnabled(int i) {
            return true;
        }

        @Override
        public final void onClick(View view) {
            ActivityScreen activityScreen = ActivityScreen.this;
            activityScreen.ab();
            Uri w9 = activityScreen.w9();
            activityScreen.B9(w9);
            activityScreen.k2 = w9;
            if (w9 != null) {
                nqd nqdVar = new nqd();
                activityScreen.f2 = nqdVar;
                nqdVar.h = true;
                nqdVar.i = true;
            }
        }

        @Override
        public final void onDismiss(DialogInterface dialogInterface) {
            ActivityScreen.this.p.k(dialogInterface);
            a();
        }

        @Override
        public final void onItemClick(AdapterView<?> adapterView, View view, int i, long j) {
            if (i == 0) {
                if (this.d.isItemChecked(0)) {
                    this.b = 1;
                } else {
                    this.b = 0;
                }
                b();
                return;
            }
            if (i != 1) {
                if (i != 2) {
                    return;
                }
                this.c = this.d.isItemChecked(2);
                b();
                return;
            }
            if (this.d.isItemChecked(1)) {
                this.b = 9;
            } else {
                this.b = 0;
            }
            b();
        }

        @Override
        public final boolean onLongClick(View view) {
            a aVar = ActivityScreen.this;
            if (aVar.isFinishing()) {
                return false;
            }
            this.b = s6d.H0;
            this.c = s6d.G0;
            d.a aVar2 = new d.a(aVar);
            aVar2.l(2131889258);
            AlertController.b bVar = aVar2.b;
            bVar.q = this;
            bVar.r = null;
            aVar2.g(R.string.ok, this);
            aVar2.f(2131886817, (DialogInterface.OnClickListener) null);
            androidx.appcompat.app.d a = aVar2.a();
            AlertController.RecycleListView recycleListView = a.b.f;
            this.d = recycleListView;
            recycleListView.setChoiceMode(2);
            this.d.setOnItemClickListener(this);
            this.f = new x24();
            this.h = a.getLayoutInflater();
            TypedArray obtainStyledAttributes = aVar.obtainStyledAttributes(rae.c);
            this.g = obtainStyledAttributes.getResourceId(5, 2131560305);
            obtainStyledAttributes.recycle();
            aVar.c4(a, this);
            b();
            return true;
        }

        @Override
        public final void registerDataSetObserver(DataSetObserver dataSetObserver) {
            x24 x24Var = this.f;
            x24Var.getClass();
            x24Var.registerObserver(dataSetObserver);
        }

        @Override
        public final void unregisterDataSetObserver(DataSetObserver dataSetObserver) {
            x24 x24Var = this.f;
            x24Var.getClass();
            x24Var.unregisterObserver(dataSetObserver);
        }

        @Override
        public final void onClick(DialogInterface dialogInterface, int i) {
            a();
            ActivityScreen.this.V.k0();
        }
    }

    public class k implements sm1 {
        public k() {
        }

        public final void a() {
            a aVar = a.b;
            ?? r1 = ActivityScreen.this;
            r1.t8(aVar);
            if (s6d.Y) {
                com.mxtech.videoplayer.n nVar = r1.V;
                if (nVar.Z != null) {
                    if (nVar.L >= 3) {
                        nVar.z0(0, nVar.O());
                        return;
                    } else {
                        r1.T2 = true;
                        return;
                    }
                }
            }
            com.mxtech.videoplayer.n nVar2 = r1.V;
            Uri uri = nVar2.o;
            if (uri != null) {
                nVar2.h(519);
                try {
                    oab r = oab.r();
                    try {
                        SQLiteDatabase sQLiteDatabase = r.b;
                        r.b(uri);
                    } catch (Throwable th) {
                        r.getClass();
                        throw th;
                    }
                } catch (SQLiteException e) {
                    Log.e("MX.Screen", "", e);
                    if (!r1.isFinishing()) {
                        ho4.a(2131887584, r1);
                    }
                }
                r1.m9(uri, r1.F2, r1.G2, r1.H2);
                r1.V.O0();
            }
        }

        public final void b() {
        }

        public final void c() {
        }
    }

    public void F6() {
    }

    public void F8() {
    }

    public void Sa() {
    }

    public void Va() {
    }

    public void Wa() {
    }

    public void Z9() {
    }

    public void da() {
    }

    public void o8() {
    }

    public void ta() {
    }

    public void y7() {
    }

    public class f0 implements Animation.AnimationListener {
        public f0() {
        }

        @Override
        public final void onAnimationEnd(Animation animation) {
            ActivityScreen activityScreen = ActivityScreen.this;
            if (activityScreen.I0.getTag() == null) {
                activityScreen.B8();
            }
        }

        @Override
        public final void onAnimationRepeat(Animation animation) {
        }

        @Override
        public final void onAnimationStart(Animation animation) {
        }
    }

    public class q extends AppCompatTextView implements Animation.AnimationListener {
        public Animation j;
        public boolean k;

        public q(ActivityScreen activityScreen) {
            super(activityScreen);
        }

        @Override
        public final void onAnimationEnd(Animation animation) {
            if (this.k) {
                ActivityScreen activityScreen = ActivityScreen.this;
                activityScreen.T.removeView(activityScreen.f1);
                activityScreen.f1 = null;
            }
        }

        @Override
        public final void onAnimationRepeat(Animation animation) {
        }

        @Override
        public final void onAnimationStart(Animation animation) {
        }
    }

    public void A9(boolean z2) {
    }

    public void B9(Uri uri) {
    }

    public void D9(Uri uri) {
    }

    public void L9(Uri uri) {
    }

    public void M9(long j2) {
    }

    @Override
    public final void R3(int i2) {
    }

    @Override
    public final void onSessionConnected(CastSession castSession) {
    }

    public void z9(Intent intent) {
    }

    public void N9(int i2, int i3) {
    }

    @Override
    public final void onSessionDisconnected(CastSession castSession, int i2) {
    }
}