TopTV v3.0.1版本的 MD5 值为:0fc1b9ce94885bc92edd11a6ee3e5932

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


package com.toptvone.toptviptvbox.view.activity;

import a.b.k.b;
import a.b.q.j0;
import android.animation.ObjectAnimator;
import android.annotation.SuppressLint;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.util.TypedValue;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.ProgressBar;
import android.widget.RatingBar;
import android.widget.RelativeLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.widget.ActionMenuView;
import androidx.appcompat.widget.Toolbar;
import androidx.core.widget.NestedScrollView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import c.j.b.c0;
import c.j.b.t;
import com.google.android.material.appbar.AppBarLayout;
import com.toptvone.toptviptvbox.R;
import com.toptvone.toptviptvbox.miscelleneious.chromecastfeature.ExpandedControlsActivity;
import com.toptvone.toptviptvbox.model.FavouriteDBModel;
import com.toptvone.toptviptvbox.model.LiveStreamsDBModel;
import com.toptvone.toptviptvbox.model.VodAllCategoriesSingleton;
import com.toptvone.toptviptvbox.model.callback.SearchTMDBMoviesCallback;
import com.toptvone.toptviptvbox.model.callback.TMDBCastsCallback;
import com.toptvone.toptviptvbox.model.callback.TMDBGenreCallback;
import com.toptvone.toptviptvbox.model.callback.TMDBPersonInfoCallback;
import com.toptvone.toptviptvbox.model.callback.TMDBTrailerCallback;
import com.toptvone.toptviptvbox.model.callback.VodInfoCallback;
import com.toptvone.toptviptvbox.model.database.DatabaseHandler;
import com.toptvone.toptviptvbox.model.database.DatabaseUpdatedStatusDBModel;
import com.toptvone.toptviptvbox.model.database.ExternalPlayerDataBase;
import com.toptvone.toptviptvbox.model.database.LiveStreamDBHandler;
import com.toptvone.toptviptvbox.model.database.RecentWatchDBHandler;
import com.toptvone.toptviptvbox.model.database.SharepreferenceDBHandler;
import com.toptvone.toptviptvbox.model.pojo.ExternalPlayerModelClass;
import com.toptvone.toptviptvbox.model.pojo.TMDBCastsPojo;
import com.toptvone.toptviptvbox.model.pojo.TMDBCrewPojo;
import com.toptvone.toptviptvbox.view.adapter.CastAdapter;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.Random;
import java.util.concurrent.TimeUnit;
import me.zhanghai.android.materialprogressbar.BuildConfig;
public class ViewDetailsActivity extends a.b.k.c implements View.OnClickListener, c.k.a.i.f.m, c.k.a.i.f.i {
    public static String f26365d;
    public static String f26366e;
    public DatabaseHandler A;
    public PopupWindow B;
    public Button C;
    public String D;
    public DateFormat E;
    public String F;
    public TextView G;
    public MenuItem H;
    public Menu I;
    public Button L;
    public c.f.a.c.d.u.d M;
    public c.k.a.h.e O;
    public RecentWatchDBHandler P;
    public CastAdapter Q;
    @BindView
    public AppBarLayout appbarToolbar;
    public String f26367f;
    public String f26368g;
    public SimpleDateFormat f26369h;
    public Date f26370i;
    @BindView
    public ImageView ivFavourite;
    @BindView
    public ImageView ivMovieImage;
    @BindView
    public ImageView iv_back_button;
    public ProgressDialog f26372k;
    public SharedPreferences f26373l;
    @BindView
    public LinearLayout llCastBox;
    @BindView
    public LinearLayout llCastBoxInfo;
    @BindView
    public LinearLayout llDirectorBox;
    @BindView
    public LinearLayout llDirectorBoxInfo;
    @BindView
    public LinearLayout llDurationBox;
    @BindView
    public LinearLayout llDurationBoxInfo;
    @BindView
    public LinearLayout llGenreBox;
    @BindView
    public LinearLayout llGenreBoxInfo;
    @BindView
    public LinearLayout llMovieInfoBox;
    @BindView
    public LinearLayout llReleasedBox;
    @BindView
    public LinearLayout llReleasedBoxInfo;
    @BindView
    public LinearLayout ll_play_button_main_layout;
    @BindView
    public LinearLayout ll_watch_trailer;
    @BindView
    public LinearLayout ll_watch_trailer_button_main_layout;
    @BindView
    public ImageView logo;
    public SharedPreferences f26374m;
    public LiveStreamDBHandler f26375n;
    @BindView
    public NestedScrollView nestedScrollView;
    @BindView
    public ProgressBar pb_button_recent_watch;
    @BindView
    public RatingBar ratingBar;
    @BindView
    public RelativeLayout rlAccountInfo;
    @BindView
    public RelativeLayout rlTransparent;
    @BindView
    public RecyclerView rvCast;
    public c.k.a.h.j s;
    @BindView
    public ScrollView scrollView;
    @BindView
    public Toolbar toolbar;
    @BindView
    public TextView tvCast;
    @BindView
    public TextView tvCastInfo;
    @BindView
    public TextView tvDirector;
    @BindView
    public TextView tvDirectorInfo;
    @BindView
    public TextView tvMovieDuration;
    @BindView
    public TextView tvMovieDurationInfo;
    @BindView
    public TextView tvMovieGenere;
    @BindView
    public TextView tvMovieInfo;
    @BindView
    public TextView tvMovieName;
    @BindView
    public TextView tvPlay;
    @BindView
    public TextView tvReadMore;
    @BindView
    public TextView tvReleaseDate;
    @BindView
    public TextView tvReleaseDateInfo;
    @BindView
    public TextView tvWatchTrailer;
    @BindView
    public TextView tv_genre_info;
    public Context f26371j = this;
    public DatabaseUpdatedStatusDBModel f26376o = new DatabaseUpdatedStatusDBModel();
    public DatabaseUpdatedStatusDBModel p = new DatabaseUpdatedStatusDBModel();
    public String q = BuildConfig.FLAVOR;
    public String r = BuildConfig.FLAVOR;
    public String t = BuildConfig.FLAVOR;
    public String u = BuildConfig.FLAVOR;
    public String v = BuildConfig.FLAVOR;
    public String w = BuildConfig.FLAVOR;
    public String x = BuildConfig.FLAVOR;
    public int y = -1;
    public String z = BuildConfig.FLAVOR;
    public String J = BuildConfig.FLAVOR;
    public Boolean K = Boolean.TRUE;
    public String N = BuildConfig.FLAVOR;
    public String R = "mobile";
    public int S = 0;
    public boolean T = false;
    public int U = 0;
    public String V = BuildConfig.FLAVOR;

    public class a implements DialogInterface.OnClickListener {
        public a() {
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i2) {
        }
    }

    public class b implements DialogInterface.OnClickListener {
        public b() {
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i2) {
            dialogInterface.cancel();
        }
    }

    public class c implements c0 {
        public c() {
        }

        @Override
        public void a(Drawable drawable) {
            Log.d("TAG", "FAILED");
        }

        @Override
        public void b(Drawable drawable) {
            Log.d("TAG", "Prepare Load");
        }

        @Override
        public void c(Bitmap bitmap, t.e eVar) {
            ViewDetailsActivity.this.appbarToolbar.setBackground(new BitmapDrawable(ViewDetailsActivity.this.f26371j.getResources(), bitmap));
            ViewDetailsActivity viewDetailsActivity = ViewDetailsActivity.this;
            viewDetailsActivity.rlTransparent.setBackgroundColor(viewDetailsActivity.getResources().getColor(R.color.trasparent_black_2));
            ViewDetailsActivity viewDetailsActivity2 = ViewDetailsActivity.this;
            viewDetailsActivity2.toolbar.setBackgroundColor(viewDetailsActivity2.getResources().getColor(R.color.trasparent_black_2));
        }
    }

    public class d implements c.j.b.e {
        public d() {
        }

        @Override
        public void a() {
            ViewDetailsActivity.this.ivMovieImage.setBackgroundResource(R.drawable.noposter);
        }

        @Override
        public void onSuccess() {
        }
    }

    public class e implements c0 {
        public e() {
        }

        @Override
        public void a(Drawable drawable) {
            Log.d("TAG", "FAILED");
        }

        @Override
        public void b(Drawable drawable) {
            Log.d("TAG", "Prepare Load");
        }

        @Override
        public void c(Bitmap bitmap, t.e eVar) {
            ViewDetailsActivity.this.appbarToolbar.setBackground(new BitmapDrawable(ViewDetailsActivity.this.f26371j.getResources(), bitmap));
            ViewDetailsActivity viewDetailsActivity = ViewDetailsActivity.this;
            viewDetailsActivity.rlTransparent.setBackgroundColor(viewDetailsActivity.getResources().getColor(R.color.trasparent_black_2));
            ViewDetailsActivity viewDetailsActivity2 = ViewDetailsActivity.this;
            viewDetailsActivity2.toolbar.setBackgroundColor(viewDetailsActivity2.getResources().getColor(R.color.trasparent_black_2));
        }
    }

    public class f implements j0.d {
        public final ArrayList f26382a;
        public final String f26383b;

        public f(ArrayList arrayList, String str) {
            this.f26382a = arrayList;
            this.f26383b = str;
        }

        @Override
        public boolean onMenuItemClick(MenuItem menuItem) {
            ArrayList arrayList;
            try {
                if (ViewDetailsActivity.this.K.booleanValue() && (arrayList = this.f26382a) != null && arrayList.size() > 0) {
                    for (int i2 = 0; i2 < this.f26382a.size(); i2++) {
                        if (menuItem.getItemId() == i2) {
                            if (menuItem.getItemId() == 0) {
                                c.k.a.g.n.e.V(ViewDetailsActivity.this.f26371j, this.f26383b, ViewDetailsActivity.this.y, ViewDetailsActivity.this.v, ViewDetailsActivity.this.w, ViewDetailsActivity.this.x, ViewDetailsActivity.this.t, BuildConfig.FLAVOR, ViewDetailsActivity.this.S);
                            } else {
                                String s = c.k.a.g.n.e.s(c.k.a.g.n.e.E(ViewDetailsActivity.this.f26371j, ViewDetailsActivity.this.y, ViewDetailsActivity.this.w, "movie"));
                                Intent intent = new Intent(ViewDetailsActivity.this.f26371j, PlayExternalPlayerActivity.class);
                                intent.putExtra("url", s);
                                intent.putExtra("app_name", ((ExternalPlayerModelClass) this.f26382a.get(i2)).a());
                                intent.putExtra("packagename", ((ExternalPlayerModelClass) this.f26382a.get(i2)).b());
                                ViewDetailsActivity.this.f26371j.startActivity(intent);
                            }
                        }
                    }
                }
            } catch (Exception unused) {
            }
            return false;
        }
    }

    public class g implements j0.c {
        public g() {
        }

        @Override
        public void a(j0 j0Var) {
        }
    }

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

        @Override
        public void onClick(View view) {
            ViewDetailsActivity.this.B.dismiss();
        }
    }

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

        @Override
        public void onClick(View view) {
            ViewDetailsActivity.this.B.dismiss();
        }
    }

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

        @Override
        public void onClick(View view) {
            ViewDetailsActivity.this.B.dismiss();
        }
    }

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

        @Override
        public void onClick(View view) {
            c.k.a.g.n.e.a(ViewDetailsActivity.this.f26371j);
        }
    }

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

        @Override
        public void onClick(View view) {
            ViewDetailsActivity.this.onBackPressed();
        }
    }

    public class m implements View.OnClickListener {
        public final Context f26391b;

        public m(Context context) {
            this.f26391b = context;
        }

        @Override
        public void onClick(View view) {
            if (ViewDetailsActivity.this.A.l(ViewDetailsActivity.this.y, ViewDetailsActivity.this.z, "vod", SharepreferenceDBHandler.A(this.f26391b)).size() > 0) {
                ViewDetailsActivity.this.M0();
            } else {
                ViewDetailsActivity.this.F0();
            }
        }
    }

    public class n implements DialogInterface.OnClickListener {
        public n() {
        }

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

    public class o implements DialogInterface.OnClickListener {
        public o() {
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i2) {
            c.k.a.g.n.e.N(ViewDetailsActivity.this.f26371j);
        }
    }

    public class p implements DialogInterface.OnClickListener {
        public p() {
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i2) {
            c.k.a.g.n.e.M(ViewDetailsActivity.this.f26371j);
        }
    }

    public class q implements DialogInterface.OnClickListener {
        public q() {
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i2) {
            dialogInterface.cancel();
        }
    }

    public class r implements View.OnFocusChangeListener {
        public final View f26397b;

        public r(View view) {
            this.f26397b = view;
        }

        public final void a(float f2) {
            ObjectAnimator ofFloat = ObjectAnimator.ofFloat(this.f26397b, "scaleX", f2);
            ofFloat.setDuration(150L);
            ofFloat.start();
        }

        public final void b(float f2) {
            ObjectAnimator ofFloat = ObjectAnimator.ofFloat(this.f26397b, "scaleY", f2);
            ofFloat.setDuration(150L);
            ofFloat.start();
        }

        @Override
        @SuppressLint({"ResourceType"})
        public void onFocusChange(View view, boolean z) {
            float f2;
            int i2;
            LinearLayout linearLayout;
            if (z) {
                f2 = z ? 1.05f : 1.0f;
                Log.e("id is", BuildConfig.FLAVOR + this.f26397b.getTag());
                View view2 = this.f26397b;
                if (view2 == null || view2.getTag() == null) {
                    return;
                }
                boolean equals = this.f26397b.getTag().equals("1");
                i2 = R.drawable.blue_btn_effect;
                if (equals) {
                    a(f2);
                    b(f2);
                    linearLayout = ViewDetailsActivity.this.ll_play_button_main_layout;
                } else if (this.f26397b.getTag().equals("2")) {
                    a(f2);
                    b(f2);
                    this.f26397b.setBackgroundResource(R.drawable.blue_btn_effect);
                    return;
                } else if (!this.f26397b.getTag().equals("5")) {
                    if (!this.f26397b.getTag().equals("8")) {
                        a(1.15f);
                        b(1.15f);
                        return;
                    }
                    a(f2);
                    b(f2);
                    ViewDetailsActivity.this.L.setBackgroundResource(R.drawable.back_btn_effect);
                    return;
                } else {
                    a(f2);
                    b(f2);
                    linearLayout = ViewDetailsActivity.this.ll_watch_trailer_button_main_layout;
                }
            } else if (z) {
                return;
            } else {
                f2 = z ? 1.09f : 1.0f;
                a(f2);
                b(f2);
                View view3 = this.f26397b;
                if (view3 == null || view3.getTag() == null) {
                    return;
                }
                boolean equals2 = this.f26397b.getTag().equals("1");
                i2 = R.drawable.rounded_edge_2;
                if (!equals2) {
                    if (this.f26397b.getTag().equals("3")) {
                        this.f26397b.setBackgroundResource(R.drawable.black_button_dark);
                        return;
                    }
                    if (!this.f26397b.getTag().equals("5")) {
                        if (this.f26397b.getTag() == null || !this.f26397b.getTag().equals("8")) {
                            return;
                        }
                        ViewDetailsActivity.this.L.setBackgroundResource(R.drawable.black_button_dark);
                        return;
                    }
                    linearLayout = ViewDetailsActivity.this.ll_watch_trailer_button_main_layout;
                }
                linearLayout = ViewDetailsActivity.this.ll_play_button_main_layout;
            }
            linearLayout.setBackgroundResource(i2);
        }
    }

    public static long H0(SimpleDateFormat simpleDateFormat, String str, String str2) {
        try {
            return TimeUnit.DAYS.convert(simpleDateFormat.parse(str2).getTime() - simpleDateFormat.parse(str).getTime(), TimeUnit.MILLISECONDS);
        } catch (Exception e2) {
            e2.printStackTrace();
            return 0L;
        }
    }

    public static String I0(Context context) {
        return String.valueOf(context.getApplicationInfo().loadLabel(context.getPackageManager()));
    }

    public final void F0() {
        FavouriteDBModel favouriteDBModel = new FavouriteDBModel();
        favouriteDBModel.h(this.z);
        favouriteDBModel.m(this.y);
        favouriteDBModel.k(this.t);
        favouriteDBModel.l(this.x);
        favouriteDBModel.o(SharepreferenceDBHandler.A(this.f26371j));
        this.A.i(favouriteDBModel, "vod");
        int i2 = Build.VERSION.SDK_INT;
        if (i2 <= 21) {
            this.ivFavourite.setImageResource(R.drawable.fav_heart_red);
        }
        if (i2 >= 21) {
            this.ivFavourite.setImageDrawable(this.f26371j.getResources().getDrawable(R.drawable.fav_heart_red, null));
        }
    }

    public final void G0() {
        Window window = getWindow();
        int i2 = Build.VERSION.SDK_INT;
        if (i2 >= 19) {
            window.clearFlags(67108864);
        }
        if (i2 >= 21) {
            window.addFlags(Integer.MIN_VALUE);
        }
        if (i2 >= 21) {
            window.setStatusBarColor(a.i.i.b.d(this, R.color.colorPrimaryDark));
        }
    }

    @SuppressLint({"InlinedApi"})
    public void J0() {
        getWindow().getDecorView().setSystemUiVisibility(5894);
    }

    @Override
    public void K(TMDBPersonInfoCallback tMDBPersonInfoCallback) {
    }

    public final void K0() {
        this.f26375n = new LiveStreamDBHandler(this.f26371j);
        this.A = new DatabaseHandler(this.f26371j);
        this.P = new RecentWatchDBHandler(this.f26371j);
        this.tvPlay.requestFocus();
        this.tvPlay.setFocusable(true);
        TextView textView = this.tvMovieName;
        if (textView != null) {
            textView.setSelected(true);
        }
        ProgressDialog progressDialog = new ProgressDialog(this);
        this.f26372k = progressDialog;
        progressDialog.setCanceledOnTouchOutside(false);
        this.f26372k.setMessage(this.f26371j.getResources().getString(R.string.please_wait));
        this.f26372k.show();
        SharedPreferences sharedPreferences = getSharedPreferences("loginPrefs", 0);
        this.f26373l = sharedPreferences;
        String string = sharedPreferences.getString("username", BuildConfig.FLAVOR);
        String string2 = this.f26373l.getString("password", BuildConfig.FLAVOR);
        if (string.isEmpty() || string2.isEmpty()) {
            startActivity(new Intent(this, LoginActivity.class));
            overridePendingTransition(R.anim.fade_out, R.anim.fade_in);
        } else {
            O0(this.f26371j, string, string2);
        }
        this.logo.setOnClickListener(new k());
        this.iv_back_button.setOnClickListener(new l());
    }

    public final void L0(ViewDetailsActivity viewDetailsActivity) {
        View inflate = ((LayoutInflater) viewDetailsActivity.getSystemService("layout_inflater")).inflate(R.layout.layout_movie_trailer, (RelativeLayout) viewDetailsActivity.findViewById(R.id.rl_password_verification));
        PopupWindow popupWindow = new PopupWindow(viewDetailsActivity);
        this.B = popupWindow;
        popupWindow.setContentView(inflate);
        this.B.setWidth(-1);
        this.B.setHeight(-1);
        this.B.setFocusable(true);
        this.B.setBackgroundDrawable(new BitmapDrawable());
        this.B.showAtLocation(inflate, 17, 0, 0);
        this.L = (Button) inflate.findViewById(R.id.bt_save_password);
        this.C = (Button) inflate.findViewById(R.id.bt_close);
        Button button = this.L;
        if (button != null) {
            button.setOnFocusChangeListener(new r(button));
        }
        Button button2 = this.C;
        if (button2 != null) {
            button2.setOnFocusChangeListener(new r(button2));
        }
        this.C.setOnClickListener(new h());
        this.L.setOnClickListener(new i());
    }

    public final void M0() {
        this.A.o(this.y, this.z, "vod", this.t, SharepreferenceDBHandler.A(this.f26371j));
        int i2 = Build.VERSION.SDK_INT;
        if (i2 <= 21) {
            this.ivFavourite.setImageResource(R.drawable.fav_heart_white);
        }
        if (i2 >= 21) {
            this.ivFavourite.setImageDrawable(this.f26371j.getResources().getDrawable(R.drawable.fav_heart_white, null));
        }
    }

    @Override
    public void N(String str) {
        TextView textView;
        try {
            this.D = BuildConfig.FLAVOR;
            this.F = BuildConfig.FLAVOR;
            Context context = this.f26371j;
            String str2 = this.t;
            if (str2 != null && (textView = this.tvMovieName) != null) {
                textView.setText(str2);
            }
            LinearLayout linearLayout = this.llReleasedBox;
            if (linearLayout != null && this.llReleasedBoxInfo != null) {
                TextView textView2 = this.tvReleaseDateInfo;
            }
            if (linearLayout != null) {
                linearLayout.setVisibility(0);
            }
            LinearLayout linearLayout2 = this.llReleasedBoxInfo;
            if (linearLayout2 != null) {
                linearLayout2.setVisibility(0);
            }
            TextView textView3 = this.tvReleaseDateInfo;
            if (textView3 != null) {
                textView3.setText("N/A");
            }
            if (this.tvDirectorInfo != null && this.llDirectorBoxInfo != null) {
                LinearLayout linearLayout3 = this.llDirectorBox;
            }
            LinearLayout linearLayout4 = this.llDirectorBox;
            if (linearLayout4 != null) {
                linearLayout4.setVisibility(0);
            }
            LinearLayout linearLayout5 = this.llDirectorBoxInfo;
            if (linearLayout5 != null) {
                linearLayout5.setVisibility(0);
            }
            TextView textView4 = this.tvDirectorInfo;
            if (textView4 != null) {
                textView4.setText("N/A");
            }
            LinearLayout linearLayout6 = this.llCastBox;
            if (linearLayout6 != null && this.llCastBoxInfo != null) {
                TextView textView5 = this.tvCastInfo;
            }
            if (linearLayout6 != null) {
                linearLayout6.setVisibility(0);
            }
            LinearLayout linearLayout7 = this.llCastBoxInfo;
            if (linearLayout7 != null) {
                linearLayout7.setVisibility(0);
            }
            TextView textView6 = this.tvReadMore;
            if (textView6 != null) {
                textView6.setVisibility(8);
            }
            TextView textView7 = this.tvCastInfo;
            if (textView7 != null) {
                textView7.setText("N/A");
            }
            RatingBar ratingBar = this.ratingBar;
            TextView textView8 = this.tvMovieInfo;
            if (textView8 != null) {
                textView8.setVisibility(8);
            }
            LinearLayout linearLayout8 = this.llGenreBox;
            if (linearLayout8 != null && this.llGenreBoxInfo != null) {
                TextView textView9 = this.tv_genre_info;
            }
            if (linearLayout8 != null) {
                linearLayout8.setVisibility(0);
            }
            LinearLayout linearLayout9 = this.llGenreBoxInfo;
            if (linearLayout9 != null) {
                linearLayout9.setVisibility(0);
            }
            TextView textView10 = this.tv_genre_info;
            if (textView10 != null) {
                textView10.setText("N/A");
            }
            LinearLayout linearLayout10 = this.llDurationBox;
            if (linearLayout10 == null || this.llDurationBoxInfo == null || this.tvMovieDurationInfo == null) {
                if (linearLayout10 != null) {
                    linearLayout10.setVisibility(0);
                }
                LinearLayout linearLayout11 = this.llDurationBoxInfo;
                if (linearLayout11 != null) {
                    linearLayout11.setVisibility(0);
                }
                TextView textView11 = this.tvMovieDurationInfo;
                if (textView11 != null) {
                    textView11.setText("N/A");
                    return;
                }
                return;
            }
            linearLayout10.setVisibility(0);
            this.llDurationBoxInfo.setVisibility(0);
            float f2 = 0;
            int i2 = (int) (f2 / 3600.0f);
            try {
                int round = Math.round((f2 % 3600.0f) / 60.0f);
                if (i2 == 0) {
                    this.tvMovieDurationInfo.setText(round + "m");
                } else {
                    this.tvMovieDurationInfo.setText(i2 + "h " + round + "m");
                }
            } catch (Exception unused) {
                this.tvMovieDurationInfo.setText(0);
            }
        } catch (Exception unused2) {
        }
    }

    public final void N0(ViewDetailsActivity viewDetailsActivity) {
        View inflate = ((LayoutInflater) viewDetailsActivity.getSystemService("layout_inflater")).inflate(R.layout.layout_cast_details, (RelativeLayout) viewDetailsActivity.findViewById(R.id.rl_password_verification));
        TextView textView = (TextView) inflate.findViewById(R.id.tv_casts_info_popup);
        this.G = textView;
        textView.setText(this.D);
        PopupWindow popupWindow = new PopupWindow(viewDetailsActivity);
        this.B = popupWindow;
        popupWindow.setContentView(inflate);
        this.B.setWidth(-1);
        this.B.setHeight(-1);
        this.B.setFocusable(true);
        this.B.showAtLocation(inflate, 17, 0, 0);
        Button button = (Button) inflate.findViewById(R.id.bt_close);
        this.C = button;
        if (button != null) {
            button.setOnFocusChangeListener(new r(button));
        }
        this.C.setOnClickListener(new j());
    }

    public final void O0(Context context, String str, String str2) {
        int i2;
        this.s = new c.k.a.h.j(this, context);
        this.O = new c.k.a.h.e(this, context);
        Intent intent = getIntent();
        if (intent != null) {
            try {
                this.y = Integer.parseInt(intent.getStringExtra(c.k.a.g.n.a.y));
            } catch (NumberFormatException unused) {
                this.y = -1;
            }
            this.t = intent.getStringExtra("movie");
            this.u = intent.getStringExtra("selectedPlayer");
            this.v = intent.getStringExtra("streamType");
            this.w = intent.getStringExtra("containerExtension");
            this.z = intent.getStringExtra("categoryID");
            this.x = intent.getStringExtra("num");
            this.N = intent.getStringExtra("movie_icon");
            VodAllCategoriesSingleton.b().k(this.N);
            P0();
            TextView textView = this.tvPlay;
            if (textView != null) {
                textView.requestFocus();
                this.tvPlay.setFocusable(true);
            }
            if (this.A.l(this.y, this.z, "vod", SharepreferenceDBHandler.A(context)).size() > 0) {
                int i3 = Build.VERSION.SDK_INT;
                i2 = R.drawable.fav_heart_red;
                if (i3 <= 21) {
                    this.ivFavourite.setImageResource(R.drawable.fav_heart_red);
                }
            } else {
                int i4 = Build.VERSION.SDK_INT;
                i2 = R.drawable.fav_heart_white;
                if (i4 <= 21) {
                    this.ivFavourite.setImageResource(R.drawable.fav_heart_white);
                }
            }
            ImageView imageView = this.ivFavourite;
            if (imageView != null) {
                imageView.setOnFocusChangeListener(new r(imageView));
                this.ivFavourite.setOnClickListener(new m(context));
            }
            int i5 = this.y;
            if (i5 == -1 || i5 == 0) {
                return;
            }
            this.s.b(str, str2, i5);
        }
    }

    @Override
    public void P(TMDBCastsCallback tMDBCastsCallback) {
        if (tMDBCastsCallback != null) {
            try {
                if (tMDBCastsCallback.a() != null && tMDBCastsCallback.a().size() > 0) {
                    this.rvCast.setLayoutManager(new LinearLayoutManager(this, 0, false));
                    this.rvCast.setItemAnimator(new a.y.e.c());
                    CastAdapter castAdapter = new CastAdapter(tMDBCastsCallback.a(), this.f26371j, true, this.V);
                    this.Q = castAdapter;
                    this.rvCast.setAdapter(castAdapter);
                    this.rvCast.setVisibility(0);
                }
            } catch (Exception unused) {
                return;
            }
        }
        this.rvCast.setVisibility(8);
    }

    public void P0() {
        ProgressBar progressBar;
        int i2;
        int i3;
        int i4;
        ArrayList<LiveStreamsDBModel> v = this.P.v(this.y);
        if (v == null || v.size() <= 0) {
            progressBar = this.pb_button_recent_watch;
            if (progressBar == null) {
                return;
            }
        } else {
            TextView textView = this.tvPlay;
            if (textView == null) {
                return;
            }
            textView.setText(getResources().getString(R.string.resume));
            String valueOf = String.valueOf(v.get(0).O());
            String valueOf2 = String.valueOf(v.get(0).N());
            if (this.pb_button_recent_watch == null) {
                return;
            }
            try {
                int R = c.k.a.g.n.e.R(valueOf);
                i2 = Math.round(R / 1000.0f);
                try {
                    this.U = R;
                    i3 = c.k.a.g.n.e.R(valueOf2);
                } catch (Exception unused) {
                    i3 = 0;
                    i4 = Math.round((i2 / i3) * 100.0f);
                    if (i4 == 0) {
                    }
                }
            } catch (Exception unused2) {
                i2 = 0;
            }
            try {
                i4 = Math.round((i2 / i3) * 100.0f);
            } catch (Exception unused3) {
                i4 = 0;
            }
            if (i4 == 0) {
                this.pb_button_recent_watch.setProgress(i4);
                this.pb_button_recent_watch.setVisibility(0);
                return;
            } else if (this.pb_button_recent_watch.getVisibility() != 0) {
                return;
            } else {
                this.pb_button_recent_watch.setProgress(i4);
                progressBar = this.pb_button_recent_watch;
            }
        }
        progressBar.setVisibility(8);
    }

    @Override
    public void T(TMDBTrailerCallback tMDBTrailerCallback) {
        if (tMDBTrailerCallback != null) {
            try {
                if (tMDBTrailerCallback.a() == null || tMDBTrailerCallback.a().size() <= 0) {
                    return;
                }
                for (int i2 = 0; i2 < tMDBTrailerCallback.a().size(); i2++) {
                    if (tMDBTrailerCallback.a().get(i2).b().equals("Trailer")) {
                        this.J = tMDBTrailerCallback.a().get(i2).a();
                        return;
                    }
                }
            } catch (Exception unused) {
            }
        }
    }

    @Override
    @SuppressLint({"SetTextI18n"})
    public void X(TMDBGenreCallback tMDBGenreCallback) {
        TextView textView;
        if (tMDBGenreCallback != null) {
            try {
                if (tMDBGenreCallback.a() != null && tMDBGenreCallback.a().size() > 0) {
                    String str = BuildConfig.FLAVOR;
                    for (int i2 = 0; i2 < tMDBGenreCallback.a().size(); i2++) {
                        str = str + ((c.f.d.w.h) tMDBGenreCallback.a().get(i2)).get("name").toString() + " / ";
                    }
                    String substring = str.substring(0, str.lastIndexOf(47));
                    this.F = substring;
                    if (this.llGenreBox == null || this.llGenreBoxInfo == null || this.tv_genre_info == null || substring.isEmpty()) {
                        LinearLayout linearLayout = this.llGenreBox;
                        if (linearLayout != null) {
                            linearLayout.setVisibility(0);
                        }
                        LinearLayout linearLayout2 = this.llGenreBoxInfo;
                        if (linearLayout2 != null) {
                            linearLayout2.setVisibility(0);
                        }
                        textView = this.tv_genre_info;
                    } else {
                        this.llGenreBox.setVisibility(0);
                        this.llGenreBoxInfo.setVisibility(0);
                        if (substring.length() > 40) {
                        }
                        this.tv_genre_info.setText(substring);
                    }
                    if (tMDBGenreCallback != null || tMDBGenreCallback.b() == null) {
                    }
                    try {
                        int round = (int) Math.round(((Double) tMDBGenreCallback.b()).doubleValue() * 60.0d);
                        LinearLayout linearLayout3 = this.llDurationBox;
                        if (linearLayout3 == null || this.llDurationBoxInfo == null || this.tvMovieDurationInfo == null) {
                            if (linearLayout3 != null) {
                                linearLayout3.setVisibility(0);
                            }
                            LinearLayout linearLayout4 = this.llDurationBoxInfo;
                            if (linearLayout4 != null) {
                                linearLayout4.setVisibility(0);
                            }
                            TextView textView2 = this.tvMovieDurationInfo;
                            if (textView2 != null) {
                                textView2.setText("N/A");
                                return;
                            }
                            return;
                        }
                        linearLayout3.setVisibility(0);
                        this.llDurationBoxInfo.setVisibility(0);
                        this.tvMovieDurationInfo.setText(round);
                        float f2 = round;
                        int i3 = (int) (f2 / 3600.0f);
                        try {
                            int round2 = Math.round((f2 % 3600.0f) / 60.0f);
                            if (i3 == 0) {
                                this.tvMovieDurationInfo.setText(round2 + "m");
                            } else {
                                this.tvMovieDurationInfo.setText(i3 + "h " + round2 + "m");
                            }
                            return;
                        } catch (Exception unused) {
                            this.tvMovieDurationInfo.setText(round);
                            return;
                        }
                    } catch (Exception unused2) {
                        LinearLayout linearLayout5 = this.llDurationBox;
                        if (linearLayout5 != null) {
                            linearLayout5.setVisibility(0);
                        }
                        LinearLayout linearLayout6 = this.llDurationBoxInfo;
                        if (linearLayout6 != null) {
                            linearLayout6.setVisibility(0);
                        }
                        TextView textView3 = this.tvMovieDurationInfo;
                        if (textView3 != null) {
                            textView3.setText("N/A");
                            return;
                        }
                        return;
                    }
                }
            } catch (Exception unused3) {
                return;
            }
        }
        LinearLayout linearLayout7 = this.llGenreBox;
        if (linearLayout7 != null) {
            linearLayout7.setVisibility(0);
        }
        LinearLayout linearLayout8 = this.llGenreBoxInfo;
        if (linearLayout8 != null) {
            linearLayout8.setVisibility(0);
        }
        textView = this.tv_genre_info;
        if (textView != null) {
            textView.setText("N/A");
        }
        if (tMDBGenreCallback != null) {
        }
    }

    @Override
    public void a() {
    }

    @Override
    public void b() {
    }

    @Override
    public void c(String str) {
        try {
            ProgressDialog progressDialog = this.f26372k;
            if (progressDialog == null || !progressDialog.isShowing()) {
                return;
            }
            this.f26372k.dismiss();
            Toast.makeText(this, this.f26371j.getResources().getString(R.string.something_wrong), 1).show();
        } catch (Exception unused) {
        }
    }

    @Override
    public void c0(VodInfoCallback vodInfoCallback) {
        TextView textView;
        TextView textView2;
        int i2;
        LinearLayout linearLayout;
        String str;
        LinearLayout linearLayout2;
        LinearLayout linearLayout3;
        TextView textView3;
        LinearLayout linearLayout4;
        LinearLayout linearLayout5;
        TextView textView4;
        LinearLayout linearLayout6;
        LinearLayout linearLayout7;
        TextView textView5;
        TextView textView6;
        TextView textView7;
        LinearLayout linearLayout8;
        LinearLayout linearLayout9;
        TextView textView8;
        LinearLayout linearLayout10;
        LinearLayout linearLayout11;
        TextView textView9;
        try {
            ProgressDialog progressDialog = this.f26372k;
            if (progressDialog != null && progressDialog.isShowing()) {
                this.f26372k.dismiss();
            }
            if (vodInfoCallback == null || vodInfoCallback.a() == null) {
                String str2 = this.t;
                if (str2 != null && (textView2 = this.tvMovieName) != null) {
                    textView2.setText(str2);
                }
                LinearLayout linearLayout12 = this.llDurationBox;
                if (linearLayout12 != null) {
                    linearLayout12.setVisibility(0);
                }
                LinearLayout linearLayout13 = this.llDurationBoxInfo;
                if (linearLayout13 != null) {
                    linearLayout13.setVisibility(0);
                }
                TextView textView10 = this.tvMovieDurationInfo;
                if (textView10 != null) {
                    textView10.setText("N/A");
                }
                TextView textView11 = this.tvCastInfo;
                if (textView11 != null) {
                    textView11.setText("N/A");
                }
                TextView textView12 = this.tvDirectorInfo;
                if (textView12 != null) {
                    textView12.setText("N/A");
                }
                TextView textView13 = this.tvReleaseDateInfo;
                if (textView13 != null) {
                    textView13.setText("N/A");
                }
                TextView textView14 = this.tv_genre_info;
                if (textView14 != null) {
                    textView14.setText("N/A");
                }
                TextView textView15 = this.tvReadMore;
                if (textView15 != null) {
                    textView15.setVisibility(8);
                }
                textView = this.tvCastInfo;
                if (textView == null) {
                    return;
                }
            } else {
                String f2 = vodInfoCallback.a().f();
                String c2 = vodInfoCallback.a().c();
                String b2 = vodInfoCallback.a().b();
                this.D = b2;
                String i3 = vodInfoCallback.a().i();
                String h2 = vodInfoCallback.a().h();
                String g2 = vodInfoCallback.a().g();
                String e2 = vodInfoCallback.a().e();
                this.S = vodInfoCallback.a().d().intValue();
                try {
                    i2 = Integer.parseInt(vodInfoCallback.a().j());
                } catch (Exception unused) {
                    i2 = 0;
                }
                if (i2 != 0) {
                    this.O.c(i2);
                }
                List<String> a2 = vodInfoCallback.a().a();
                if (this.appbarToolbar != null && a2 != null && a2.size() > 0) {
                    this.V = a2.get(new Random().nextInt(a2.size()));
                    Context context = this.f26371j;
                    if (context != null) {
                        t.q(context).l(this.V).i(new c());
                    }
                }
                this.F = e2;
                if (vodInfoCallback.a().k() == null || vodInfoCallback.a().k().isEmpty()) {
                    TextView textView16 = this.tvWatchTrailer;
                    if (textView16 != null) {
                        textView16.setVisibility(8);
                    }
                    linearLayout = this.ll_watch_trailer;
                    if (linearLayout != null) {
                        linearLayout.setVisibility(8);
                    }
                    int intValue = vodInfoCallback.a().d().intValue();
                    if (this.f26371j != null || f2 == null || f2.isEmpty()) {
                        this.ivMovieImage.setBackgroundResource(R.drawable.noposter);
                    } else {
                        t.q(this.f26371j).l(f2).j(R.drawable.rounded_edge_3).h(this.ivMovieImage, new d());
                    }
                    str = this.t;
                    if (str != null && (textView9 = this.tvMovieName) != null) {
                        textView9.setText(str);
                    }
                    if (this.llReleasedBox != null || this.llReleasedBoxInfo == null || this.tvReleaseDateInfo == null || i3 == null || i3.isEmpty() || i3.equals("n/A")) {
                        linearLayout2 = this.llReleasedBox;
                        if (linearLayout2 != null) {
                            linearLayout2.setVisibility(0);
                        }
                        linearLayout3 = this.llReleasedBoxInfo;
                        if (linearLayout3 != null) {
                            linearLayout3.setVisibility(0);
                        }
                        textView3 = this.tvReleaseDateInfo;
                        if (textView3 != null) {
                            textView3.setText("N/A");
                        }
                    } else {
                        this.llReleasedBox.setVisibility(0);
                        this.llReleasedBoxInfo.setVisibility(0);
                        this.tvReleaseDateInfo.setText(i3);
                    }
                    if (this.tvDirectorInfo != null || this.llDirectorBoxInfo == null || this.llDirectorBox == null || c2 == null || c2.isEmpty() || c2.equals("n/A")) {
                        linearLayout4 = this.llDirectorBox;
                        if (linearLayout4 != null) {
                            linearLayout4.setVisibility(0);
                        }
                        linearLayout5 = this.llDirectorBoxInfo;
                        if (linearLayout5 != null) {
                            linearLayout5.setVisibility(0);
                        }
                        textView4 = this.tvDirectorInfo;
                        if (textView4 != null) {
                            textView4.setText("N/A");
                        }
                    } else {
                        this.llDirectorBox.setVisibility(0);
                        this.llDirectorBoxInfo.setVisibility(0);
                        this.tvDirectorInfo.setText(c2);
                    }
                    if (this.llCastBox != null || this.llCastBoxInfo == null || this.tvCastInfo == null || b2 == null || b2.isEmpty()) {
                        linearLayout6 = this.llCastBox;
                        if (linearLayout6 != null) {
                            linearLayout6.setVisibility(0);
                        }
                        linearLayout7 = this.llCastBoxInfo;
                        if (linearLayout7 != null) {
                            linearLayout7.setVisibility(0);
                        }
                        textView5 = this.tvReadMore;
                        if (textView5 != null) {
                            textView5.setVisibility(8);
                        }
                        textView6 = this.tvCastInfo;
                        if (textView6 != null) {
                            textView6.setText("N/A");
                        }
                    } else {
                        this.llCastBox.setVisibility(0);
                        this.llCastBoxInfo.setVisibility(0);
                        if (b2.length() > 150) {
                            this.tvCastInfo.setText(b2);
                            this.tvReadMore.setVisibility(0);
                        } else {
                            this.tvCastInfo.setText(b2);
                            this.tvReadMore.setVisibility(8);
                        }
                    }
                    if (this.ratingBar != null && h2 != null && !h2.isEmpty() && !h2.equals("n/A")) {
                        this.ratingBar.setVisibility(0);
                        try {
                            this.ratingBar.setRating(Float.parseFloat(h2) / 2.0f);
                        } catch (NumberFormatException unused2) {
                            this.ratingBar.setRating(0.0f);
                        }
                    }
                    if (this.tvMovieInfo != null || g2 == null || g2.isEmpty() || g2.equals("n/A")) {
                        textView7 = this.tvMovieInfo;
                        if (textView7 != null) {
                            textView7.setVisibility(8);
                        }
                    } else {
                        this.tvMovieInfo.setText(g2);
                    }
                    if (this.llGenreBox != null || this.llGenreBoxInfo == null || this.tv_genre_info == null || e2 == null || e2.isEmpty()) {
                        linearLayout8 = this.llGenreBox;
                        if (linearLayout8 != null) {
                            linearLayout8.setVisibility(0);
                        }
                        linearLayout9 = this.llGenreBoxInfo;
                        if (linearLayout9 != null) {
                            linearLayout9.setVisibility(0);
                        }
                        textView8 = this.tv_genre_info;
                        if (textView8 != null) {
                            textView8.setText("N/A");
                        }
                    } else {
                        this.llGenreBox.setVisibility(0);
                        this.llGenreBoxInfo.setVisibility(0);
                        if (e2.length() > 40) {
                        }
                        this.tv_genre_info.setText(e2);
                    }
                    linearLayout10 = this.llDurationBox;
                    if (linearLayout10 == null && this.llDurationBoxInfo != null && this.tvMovieDurationInfo != null) {
                        linearLayout10.setVisibility(0);
                        this.llDurationBoxInfo.setVisibility(0);
                        float f3 = intValue;
                        int i4 = (int) (f3 / 3600.0f);
                        try {
                            int round = Math.round((f3 % 3600.0f) / 60.0f);
                            if (i4 == 0) {
                                this.tvMovieDurationInfo.setText(round + "m");
                            } else {
                                this.tvMovieDurationInfo.setText(i4 + "h " + round + "m");
                            }
                            return;
                        } catch (Exception unused3) {
                            this.tvMovieDurationInfo.setText(intValue);
                            return;
                        }
                    }
                    if (linearLayout10 != null) {
                        linearLayout10.setVisibility(0);
                    }
                    linearLayout11 = this.llDurationBoxInfo;
                    if (linearLayout11 != null) {
                        linearLayout11.setVisibility(0);
                    }
                    textView = this.tvMovieDurationInfo;
                    if (textView == null) {
                        return;
                    }
                } else {
                    String k2 = vodInfoCallback.a().k();
                    this.J = k2;
                    if (k2 == null || k2.isEmpty()) {
                        TextView textView17 = this.tvWatchTrailer;
                        if (textView17 != null) {
                            textView17.setVisibility(8);
                        }
                        linearLayout = this.ll_watch_trailer;
                    } else {
                        TextView textView18 = this.tvWatchTrailer;
                        if (textView18 != null) {
                            textView18.setVisibility(0);
                        }
                        LinearLayout linearLayout14 = this.ll_watch_trailer;
                        if (linearLayout14 != null) {
                            linearLayout14.setVisibility(0);
                        }
                    }
                    int intValue2 = vodInfoCallback.a().d().intValue();
                    if (this.f26371j != null) {
                    }
                    this.ivMovieImage.setBackgroundResource(R.drawable.noposter);
                    str = this.t;
                    if (str != null) {
                        textView9.setText(str);
                    }
                    if (this.llReleasedBox != null) {
                    }
                    linearLayout2 = this.llReleasedBox;
                    if (linearLayout2 != null) {
                    }
                    linearLayout3 = this.llReleasedBoxInfo;
                    if (linearLayout3 != null) {
                    }
                    textView3 = this.tvReleaseDateInfo;
                    if (textView3 != null) {
                    }
                    if (this.tvDirectorInfo != null) {
                    }
                    linearLayout4 = this.llDirectorBox;
                    if (linearLayout4 != null) {
                    }
                    linearLayout5 = this.llDirectorBoxInfo;
                    if (linearLayout5 != null) {
                    }
                    textView4 = this.tvDirectorInfo;
                    if (textView4 != null) {
                    }
                    if (this.llCastBox != null) {
                    }
                    linearLayout6 = this.llCastBox;
                    if (linearLayout6 != null) {
                    }
                    linearLayout7 = this.llCastBoxInfo;
                    if (linearLayout7 != null) {
                    }
                    textView5 = this.tvReadMore;
                    if (textView5 != null) {
                    }
                    textView6 = this.tvCastInfo;
                    if (textView6 != null) {
                    }
                    if (this.ratingBar != null) {
                        this.ratingBar.setVisibility(0);
                        this.ratingBar.setRating(Float.parseFloat(h2) / 2.0f);
                    }
                    if (this.tvMovieInfo != null) {
                    }
                    textView7 = this.tvMovieInfo;
                    if (textView7 != null) {
                    }
                    if (this.llGenreBox != null) {
                    }
                    linearLayout8 = this.llGenreBox;
                    if (linearLayout8 != null) {
                    }
                    linearLayout9 = this.llGenreBoxInfo;
                    if (linearLayout9 != null) {
                    }
                    textView8 = this.tv_genre_info;
                    if (textView8 != null) {
                    }
                    linearLayout10 = this.llDurationBox;
                    if (linearLayout10 == null) {
                    }
                    if (linearLayout10 != null) {
                    }
                    linearLayout11 = this.llDurationBoxInfo;
                    if (linearLayout11 != null) {
                    }
                    textView = this.tvMovieDurationInfo;
                    if (textView == null) {
                    }
                }
            }
            textView.setText("N/A");
        } catch (Exception unused4) {
        }
    }

    @Override
    public boolean dispatchKeyEvent(KeyEvent keyEvent) {
        int keyCode = keyEvent.getKeyCode();
        return keyCode == 82 ? keyEvent.getAction() == 0 ? onKeyDown(keyCode, keyEvent) : onKeyUp(keyCode, keyEvent) : super.dispatchKeyEvent(keyEvent);
    }

    @Override
    public void onBackPressed() {
        super.onBackPressed();
        c.k.a.g.n.a.V = true;
        overridePendingTransition(R.anim.fade_out, R.anim.fade_in);
    }

    @Override
    public void onClick(View view) {
        if (view.getId() != R.id.tv_header_title) {
            return;
        }
        startActivity(new Intent(this, NewDashboardActivity.class));
    }

    @Override
    public void onCreate(Bundle bundle) {
        int i2;
        this.f26371j = this;
        super.onCreate(bundle);
        J0();
        if (new c.k.a.i.d.a.a(this.f26371j).z().equals(c.k.a.g.n.a.s0)) {
            this.R = "tv";
            i2 = R.layout.activity_view_details_tv;
        } else {
            this.R = "mobile";
            i2 = R.layout.activity_view_details;
        }
        setContentView(i2);
        ButterKnife.a(this);
        overridePendingTransition(R.anim.fade_out, R.anim.fade_in);
        this.T = true;
        AppBarLayout appBarLayout = this.appbarToolbar;
        if (appBarLayout != null) {
            appBarLayout.setBackground(getResources().getDrawable(R.drawable.dashboard_background));
        }
        G0();
        this.f26370i = new Date();
        TextView textView = this.tvPlay;
        if (textView != null) {
            textView.setOnFocusChangeListener(new r(textView));
        }
        f26365d = I0(this.f26371j);
        Locale locale = Locale.US;
        this.E = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss", locale);
        TextView textView2 = this.tvReadMore;
        if (textView2 != null) {
            textView2.setOnFocusChangeListener(new r(textView2));
        }
        this.f26368g = c.k.a.g.n.e.m0(c.k.a.i.d.c.a.e.d());
        f26366e = getApplicationContext().getPackageName();
        TextView textView3 = this.tvWatchTrailer;
        if (textView3 != null) {
            textView3.setOnFocusChangeListener(new r(textView3));
        }
        this.f26367f = c.k.a.g.n.e.m0(c.k.a.i.d.c.a.a.a());
        this.f26369h = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss", locale);
        getWindow().setFlags(1024, 1024);
        p0((Toolbar) findViewById(R.id.toolbar));
        K0();
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        super.onCreateOptionsMenu(menu);
        this.toolbar.x(R.menu.menu_text_icon);
        this.I = menu;
        this.H = menu.getItem(1).getSubMenu().findItem(R.id.empty);
        if (SharepreferenceDBHandler.f(this.f26371j).equals("api")) {
            menu.getItem(1).getSubMenu().findItem(R.id.menu_load_channels_vod).setVisible(false);
        }
        TypedValue typedValue = new TypedValue();
        if (getTheme().resolveAttribute(16843499, typedValue, true)) {
            TypedValue.complexToDimensionPixelSize(typedValue.data, getResources().getDisplayMetrics());
        }
        for (int i2 = 0; i2 < this.toolbar.getChildCount(); i2++) {
            if (this.toolbar.getChildAt(i2) instanceof ActionMenuView) {
                ((Toolbar.e) this.toolbar.getChildAt(i2).getLayoutParams()).f132a = 16;
            }
        }
        return true;
    }

    @Override
    public boolean onKeyUp(int i2, KeyEvent keyEvent) {
        if (i2 != 82) {
            return super.onKeyUp(i2, keyEvent);
        }
        Menu menu = this.I;
        if (menu != null) {
            menu.performIdentifierAction(R.id.empty, 0);
            return true;
        }
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem menuItem) {
        Context context;
        this.H = menuItem;
        int itemId = menuItem.getItemId();
        if (itemId == R.id.nav_home) {
            startActivity(new Intent(this, NewDashboardActivity.class));
            finish();
        }
        if (itemId == R.id.nav_settings) {
            startActivity(new Intent(this, SettingsActivity.class));
        }
        if (itemId == R.id.action_logout && (context = this.f26371j) != null) {
            new b.a(context, R.style.AlertDialogCustom).setTitle(getResources().getString(R.string.logout_title)).f(getResources().getString(R.string.logout_message)).j(getResources().getString(R.string.yes), new o()).g(getResources().getString(R.string.no), new n()).n();
        }
        if (itemId == R.id.menu_load_channels_vod) {
            b.a aVar = new b.a(this);
            aVar.setTitle(this.f26371j.getResources().getString(R.string.confirm_to_refresh));
            aVar.f(this.f26371j.getResources().getString(R.string.do_you_want_toproceed));
            aVar.d(R.drawable.questionmark);
            aVar.j(this.f26371j.getResources().getString(R.string.yes), new p());
            aVar.g(this.f26371j.getResources().getString(R.string.no), new q());
            aVar.n();
        }
        if (itemId == R.id.menu_load_tv_guide) {
            b.a aVar2 = new b.a(this);
            aVar2.setTitle(this.f26371j.getResources().getString(R.string.confirm_to_refresh));
            aVar2.f(this.f26371j.getResources().getString(R.string.do_you_want_toproceed));
            aVar2.d(R.drawable.questionmark);
            aVar2.j(this.f26371j.getResources().getString(R.string.yes), new a());
            aVar2.g(this.f26371j.getResources().getString(R.string.no), new b());
            aVar2.n();
        }
        return super.onOptionsItemSelected(menuItem);
    }

    @Override
    public void onResume() {
        J0();
        super.onResume();
        c.k.a.g.n.e.f(this.f26371j);
        if (!this.T) {
            P0();
        }
        this.T = false;
        getWindow().setFlags(1024, 1024);
    }

    @OnClick
    public void onViewClicked(View view) {
        String str;
        String str2;
        switch (view.getId()) {
            case R.id.iv_movie_image:
            case R.id.tv_play:
                SharedPreferences sharedPreferences = this.f26371j.getSharedPreferences("selectedPlayer", 0);
                this.f26374m = sharedPreferences;
                String str3 = BuildConfig.FLAVOR;
                String string = sharedPreferences.getString("selectedPlayer", BuildConfig.FLAVOR);
                SimpleDateFormat simpleDateFormat = this.f26369h;
                if (H0(simpleDateFormat, simpleDateFormat.format(new Date(c.k.a.i.d.c.a.f.a(this.f26371j))), this.E.format(this.f26370i)) >= c.k.a.i.d.c.a.d.p() && (str = this.f26367f) != null && this.f26368g != null && (!f26365d.equals(str) || (this.f26367f != null && (str2 = this.f26368g) != null && !f26366e.equals(str2)))) {
                    this.K = Boolean.FALSE;
                }
                if (this.K.booleanValue()) {
                    try {
                        if (this.R.equals("mobile")) {
                            try {
                                this.M = c.f.a.c.d.u.b.e(this.f26371j).c().c();
                            } catch (Exception unused) {
                            }
                        }
                        c.f.a.c.d.u.d dVar = this.M;
                        if (dVar != null && dVar.c()) {
                            String s = c.k.a.g.n.e.s(c.k.a.g.n.e.E(this.f26371j, this.y, this.w, "movie"));
                            c.f.a.c.d.u.d dVar2 = this.M;
                            if (dVar2 != null && dVar2.p() != null && this.M.p().j() != null && this.M.p().j().K() != null) {
                                str3 = this.M.p().j().K();
                            }
                            if (str3.equals(s)) {
                                this.f26371j.startActivity(new Intent(this.f26371j, ExpandedControlsActivity.class));
                                return;
                            } else {
                                c.k.a.g.m.a.c(this.U, true, c.k.a.g.m.a.a(this.t, BuildConfig.FLAVOR, BuildConfig.FLAVOR, 0, s, "videos/mp4", this.N, BuildConfig.FLAVOR, null), this.M, this.f26371j);
                                return;
                            }
                        }
                        new ArrayList();
                        ArrayList arrayList = new ArrayList();
                        j0 j0Var = new j0(this, view);
                        j0Var.c().inflate(R.menu.menu_players_hp, j0Var.b());
                        ArrayList<ExternalPlayerModelClass> l2 = new ExternalPlayerDataBase(this.f26371j).l();
                        if (l2 != null) {
                            try {
                                if (l2.size() > 0) {
                                    j0Var.b().add(0, 0, 0, this.f26371j.getResources().getString(R.string.nav_play));
                                    ExternalPlayerModelClass externalPlayerModelClass = new ExternalPlayerModelClass();
                                    externalPlayerModelClass.e(0);
                                    externalPlayerModelClass.d(this.f26371j.getResources().getString(R.string.play_with));
                                    arrayList.add(externalPlayerModelClass);
                                    int i2 = 0;
                                    while (i2 < l2.size()) {
                                        Menu b2 = j0Var.b();
                                        int i3 = i2 + 1;
                                        b2.add(0, i3, 0, this.f26371j.getResources().getString(R.string.play_with) + " " + l2.get(i2).a());
                                        arrayList.add(l2.get(i2));
                                        i2 = i3;
                                    }
                                    j0Var.f(new f(arrayList, string));
                                    j0Var.e(new g());
                                    j0Var.g();
                                    return;
                                }
                            } catch (Exception unused2) {
                                return;
                            }
                        }
                        c.k.a.g.n.e.V(this.f26371j, string, this.y, this.v, this.w, this.x, this.t, BuildConfig.FLAVOR, this.S);
                        return;
                    } catch (Exception unused3) {
                        c.k.a.g.n.e.V(this.f26371j, string, this.y, this.v, this.w, this.x, this.t, BuildConfig.FLAVOR, this.S);
                        return;
                    }
                }
                return;
            case R.id.tv_readmore:
                N0(this);
                return;
            case R.id.tv_watch_trailer:
                String str4 = this.J;
                if (str4 == null || str4.isEmpty()) {
                    L0(this);
                    return;
                } else {
                    startActivity(new Intent(this, YouTubePlayerActivity.class).putExtra("you_tube_trailer", this.J));
                    return;
                }
            default:
                return;
        }
    }

    @Override
    public void onWindowFocusChanged(boolean z) {
        super.onWindowFocusChanged(z);
        J0();
    }

    @Override
    public void p(TMDBCastsCallback tMDBCastsCallback) {
        TextView textView;
        LinearLayout linearLayout;
        LinearLayout linearLayout2;
        TextView textView2;
        String str = BuildConfig.FLAVOR;
        if (tMDBCastsCallback != null) {
            try {
                if (tMDBCastsCallback.a() != null && tMDBCastsCallback.a().size() > 0) {
                    List<TMDBCastsPojo> a2 = tMDBCastsCallback.a();
                    if (a2 == null) {
                        LinearLayout linearLayout3 = this.llCastBox;
                        if (linearLayout3 != null) {
                            linearLayout3.setVisibility(0);
                        }
                        LinearLayout linearLayout4 = this.llCastBoxInfo;
                        if (linearLayout4 != null) {
                            linearLayout4.setVisibility(0);
                        }
                        TextView textView3 = this.tvReadMore;
                        if (textView3 != null) {
                            textView3.setVisibility(8);
                        }
                        textView = this.tvCastInfo;
                        if (textView != null) {
                            textView.setText("N/A");
                        }
                        if (tMDBCastsCallback != null) {
                        }
                        linearLayout = this.llDirectorBox;
                        if (linearLayout != null) {
                        }
                        linearLayout2 = this.llDirectorBoxInfo;
                        if (linearLayout2 != null) {
                        }
                        textView2 = this.tvDirectorInfo;
                        if (textView2 == null) {
                        }
                        textView2.setText("N/A");
                    }
                    String str2 = BuildConfig.FLAVOR;
                    for (int i2 = 0; i2 < a2.size(); i2++) {
                        str2 = str2 + a2.get(i2).b() + " / ";
                    }
                    String substring = str2.substring(0, str2.lastIndexOf(47));
                    this.D = substring;
                    if (this.llCastBox == null || this.llCastBoxInfo == null || this.tvCastInfo == null || substring.isEmpty()) {
                        LinearLayout linearLayout5 = this.llCastBox;
                        if (linearLayout5 != null) {
                            linearLayout5.setVisibility(0);
                        }
                        LinearLayout linearLayout6 = this.llCastBoxInfo;
                        if (linearLayout6 != null) {
                            linearLayout6.setVisibility(0);
                        }
                        TextView textView4 = this.tvReadMore;
                        if (textView4 != null) {
                            textView4.setVisibility(8);
                        }
                        textView = this.tvCastInfo;
                    } else {
                        this.llCastBox.setVisibility(0);
                        this.llCastBoxInfo.setVisibility(0);
                        if (substring.length() > 150) {
                            this.tvCastInfo.setText(substring);
                            this.tvReadMore.setVisibility(0);
                        } else {
                            this.tvCastInfo.setText(substring);
                            this.tvReadMore.setVisibility(8);
                        }
                    }
                    if (tMDBCastsCallback != null || tMDBCastsCallback.b() == null || tMDBCastsCallback.b().size() <= 0) {
                        linearLayout = this.llDirectorBox;
                        if (linearLayout != null) {
                            linearLayout.setVisibility(0);
                        }
                        linearLayout2 = this.llDirectorBoxInfo;
                        if (linearLayout2 != null) {
                            linearLayout2.setVisibility(0);
                        }
                        textView2 = this.tvDirectorInfo;
                        if (textView2 == null) {
                            return;
                        }
                    } else {
                        List<TMDBCrewPojo> b2 = tMDBCastsCallback.b();
                        if (b2 != null) {
                            int i3 = 0;
                            while (true) {
                                if (i3 >= b2.size()) {
                                    break;
                                } else if (b2.get(i3).a().equals("Director")) {
                                    str = b2.get(i3).b();
                                    break;
                                } else {
                                    i3++;
                                }
                            }
                            if (this.tvDirectorInfo != null && this.llDirectorBoxInfo != null && this.llDirectorBox != null && str != null && !str.isEmpty() && !str.equals("n/A")) {
                                this.llDirectorBox.setVisibility(0);
                                this.llDirectorBoxInfo.setVisibility(0);
                                this.tvDirectorInfo.setText(str);
                                return;
                            }
                            LinearLayout linearLayout7 = this.llDirectorBox;
                            if (linearLayout7 != null) {
                                linearLayout7.setVisibility(0);
                            }
                            LinearLayout linearLayout8 = this.llDirectorBoxInfo;
                            if (linearLayout8 != null) {
                                linearLayout8.setVisibility(0);
                            }
                            textView2 = this.tvDirectorInfo;
                            if (textView2 == null) {
                                return;
                            }
                        } else {
                            LinearLayout linearLayout9 = this.llDirectorBox;
                            if (linearLayout9 != null) {
                                linearLayout9.setVisibility(0);
                            }
                            LinearLayout linearLayout10 = this.llDirectorBoxInfo;
                            if (linearLayout10 != null) {
                                linearLayout10.setVisibility(0);
                            }
                            textView2 = this.tvDirectorInfo;
                            if (textView2 == null) {
                                return;
                            }
                        }
                    }
                    textView2.setText("N/A");
                }
            } catch (Exception unused) {
                return;
            }
        }
        LinearLayout linearLayout11 = this.llCastBox;
        if (linearLayout11 != null) {
            linearLayout11.setVisibility(0);
        }
        LinearLayout linearLayout12 = this.llCastBoxInfo;
        if (linearLayout12 != null) {
            linearLayout12.setVisibility(0);
        }
        TextView textView5 = this.tvReadMore;
        if (textView5 != null) {
            textView5.setVisibility(8);
        }
        textView = this.tvCastInfo;
        if (textView != null) {
            textView.setText("N/A");
        }
        if (tMDBCastsCallback != null) {
        }
        linearLayout = this.llDirectorBox;
        if (linearLayout != null) {
        }
        linearLayout2 = this.llDirectorBoxInfo;
        if (linearLayout2 != null) {
        }
        textView2 = this.tvDirectorInfo;
        if (textView2 == null) {
        }
        textView2.setText("N/A");
    }

    @Override
    public void r(SearchTMDBMoviesCallback searchTMDBMoviesCallback) {
        StringBuilder sb;
        TextView textView;
        Context context;
        TextView textView2;
        if (searchTMDBMoviesCallback != null) {
            try {
                if (searchTMDBMoviesCallback.b() != null && searchTMDBMoviesCallback.b().equals(1) && searchTMDBMoviesCallback.a() != null && searchTMDBMoviesCallback.a().get(0) != null) {
                    int intValue = searchTMDBMoviesCallback.a().get(0).b().intValue();
                    this.O.b(intValue);
                    this.O.d(intValue);
                    this.O.g(intValue);
                    String e2 = searchTMDBMoviesCallback.a().get(0).e();
                    Double g2 = searchTMDBMoviesCallback.a().get(0).g();
                    String d2 = searchTMDBMoviesCallback.a().get(0).d();
                    String a2 = searchTMDBMoviesCallback.a().get(0).a();
                    if (new c.k.a.i.d.a.a(this.f26371j).z().equals(c.k.a.g.n.a.s0)) {
                        sb = new StringBuilder();
                        sb.append("https://image.tmdb.org/t/p/w1280/");
                        sb.append(a2);
                    } else {
                        sb = new StringBuilder();
                        sb.append("https://image.tmdb.org/t/p/w500/");
                        sb.append(a2);
                    }
                    this.V = sb.toString();
                    if (this.appbarToolbar != null && a2 != null && (context = this.f26371j) != null) {
                        t.q(context).l(this.V).i(new e());
                    }
                    if (this.llReleasedBox == null || this.llReleasedBoxInfo == null || this.tvReleaseDateInfo == null || e2 == null || e2.isEmpty() || e2.equals("n/A")) {
                        LinearLayout linearLayout = this.llReleasedBox;
                        if (linearLayout != null) {
                            linearLayout.setVisibility(0);
                        }
                        LinearLayout linearLayout2 = this.llReleasedBoxInfo;
                        if (linearLayout2 != null) {
                            linearLayout2.setVisibility(0);
                        }
                        TextView textView3 = this.tvReleaseDateInfo;
                        if (textView3 != null) {
                            textView3.setText("N/A");
                        }
                    } else {
                        this.llReleasedBox.setVisibility(0);
                        this.llReleasedBoxInfo.setVisibility(0);
                        this.tvReleaseDateInfo.setText(e2);
                    }
                    if (this.ratingBar != null && g2 != null && !g2.equals("n/A")) {
                        this.ratingBar.setVisibility(0);
                        try {
                            this.ratingBar.setRating(Float.parseFloat(String.valueOf(g2)) / 2.0f);
                        } catch (NumberFormatException unused) {
                            this.ratingBar.setRating(0.0f);
                        }
                    }
                    if (this.tvMovieInfo != null && d2 != null && !d2.isEmpty() && !d2.equals("n/A")) {
                        this.tvMovieInfo.setText(d2);
                        return;
                    }
                    textView = this.tvMovieInfo;
                    if (textView == null) {
                        return;
                    }
                    textView.setVisibility(8);
                }
            } catch (Exception unused2) {
                return;
            }
        }
        String str = this.t;
        if (str != null && (textView2 = this.tvMovieName) != null) {
            textView2.setText(str);
        }
        LinearLayout linearLayout3 = this.llDurationBox;
        if (linearLayout3 != null) {
            linearLayout3.setVisibility(0);
        }
        LinearLayout linearLayout4 = this.llDurationBoxInfo;
        if (linearLayout4 != null) {
            linearLayout4.setVisibility(0);
        }
        TextView textView4 = this.tvMovieDurationInfo;
        if (textView4 != null) {
            textView4.setText("N/A");
        }
        TextView textView5 = this.tvCastInfo;
        if (textView5 != null) {
            textView5.setText("N/A");
        }
        TextView textView6 = this.tvDirectorInfo;
        if (textView6 != null) {
            textView6.setText("N/A");
        }
        TextView textView7 = this.tvReleaseDateInfo;
        if (textView7 != null) {
            textView7.setText("N/A");
        }
        TextView textView8 = this.tv_genre_info;
        if (textView8 != null) {
            textView8.setText("N/A");
        }
        textView = this.tvReadMore;
        if (textView == null) {
            return;
        }
        textView.setVisibility(8);
    }
}