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

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


package com.toptvone.toptviptvbox.view.activity;

import a.b.k.b;
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.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.Window;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import androidx.appcompat.widget.ActionMenuView;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
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.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.database.SharepreferenceDBHandler;
import com.toptvone.toptviptvbox.view.adapter.PersonImagesAdapter;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import me.zhanghai.android.materialprogressbar.BuildConfig;
public class ViewDetailsCastActivity extends a.b.k.c implements View.OnClickListener, c.k.a.i.f.i {
    public static String f26412d;
    public static String f26413e;
    @BindView
    public AppBarLayout appbarToolbar;
    public String f26414f;
    public String f26415g;
    public SimpleDateFormat f26416h;
    public Date f26417i;
    @BindView
    public ImageView ivMovieImage;
    @BindView
    public ImageView iv_back_button;
    public ProgressDialog f26419k;
    public SharedPreferences f26420l;
    @BindView
    public LinearLayout llDODBoxInfo;
    @BindView
    public LinearLayout llDetailLeftSide;
    @BindView
    public LinearLayout llDetailProgressBar;
    @BindView
    public LinearLayout llDetailRightSide;
    @BindView
    public LinearLayout llDobBox;
    @BindView
    public LinearLayout llDobBoxInfo;
    @BindView
    public LinearLayout llDodBox;
    @BindView
    public LinearLayout llGenderBox;
    @BindView
    public LinearLayout llGenderBoxInfo;
    @BindView
    public LinearLayout llKnownForBox;
    @BindView
    public LinearLayout llKnownForBoxInfo;
    @BindView
    public LinearLayout llPersonInfoBox;
    @BindView
    public LinearLayout llPobBox;
    @BindView
    public LinearLayout llPobBoxInfo;
    @BindView
    public ImageView logo;
    public DateFormat f26423o;
    public MenuItem p;
    public Menu q;
    @BindView
    public RelativeLayout rlAccountInfo;
    @BindView
    public RelativeLayout rlTransparent;
    @BindView
    public RecyclerView rvCast;
    public c.k.a.h.e s;
    @BindView
    public ScrollView scrollView;
    public PersonImagesAdapter t;
    @BindView
    public Toolbar toolbar;
    @BindView
    public TextView tvCastDesc;
    @BindView
    public TextView tvCastName;
    @BindView
    public TextView tvDODInfo;
    @BindView
    public TextView tvDateOfBirth;
    @BindView
    public TextView tvGender;
    @BindView
    public TextView tvKnownFor;
    @BindView
    public TextView tvPlaceOfBirth;
    @BindView
    public ProgressBar tvdetailprogressbar;
    public String u;
    public String v;
    public String w;
    public Context f26418j = this;
    public String f26421m = BuildConfig.FLAVOR;
    public String f26422n = BuildConfig.FLAVOR;
    public Boolean r = Boolean.TRUE;
    public String x = BuildConfig.FLAVOR;

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

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

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

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

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

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

    public class d implements c0 {
        public final Context f26427a;

        public d(Context context) {
            this.f26427a = context;
        }

        @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) {
            ViewDetailsCastActivity.this.appbarToolbar.setBackground(new BitmapDrawable(this.f26427a.getResources(), bitmap));
            ViewDetailsCastActivity viewDetailsCastActivity = ViewDetailsCastActivity.this;
            viewDetailsCastActivity.rlTransparent.setBackgroundColor(viewDetailsCastActivity.getResources().getColor(R.color.trasparent_black_2));
            ViewDetailsCastActivity viewDetailsCastActivity2 = ViewDetailsCastActivity.this;
            viewDetailsCastActivity2.toolbar.setBackgroundColor(viewDetailsCastActivity2.getResources().getColor(R.color.trasparent_black_2));
        }
    }

    public class e extends c.d.a.r.h.g<Bitmap> {
        public e() {
        }

        @Override
        public void b(Bitmap bitmap, c.d.a.r.g.c cVar) {
            ViewDetailsCastActivity.this.ivMovieImage.setBackground(new BitmapDrawable(bitmap));
        }
    }

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

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

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

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

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

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

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

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

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

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

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

    @Override
    public void K(TMDBPersonInfoCallback tMDBPersonInfoCallback) {
        TextView textView;
        TextView textView2;
        String str;
        this.tvdetailprogressbar.setVisibility(8);
        if (tMDBPersonInfoCallback != null) {
            String g2 = tMDBPersonInfoCallback.g() != null ? tMDBPersonInfoCallback.g() : "N/A";
            if (tMDBPersonInfoCallback.i() != null) {
                tMDBPersonInfoCallback.i();
            }
            String b2 = tMDBPersonInfoCallback.b() != null ? tMDBPersonInfoCallback.b() : "N/A";
            String h2 = tMDBPersonInfoCallback.h() != null ? tMDBPersonInfoCallback.h() : "N/A";
            String c2 = tMDBPersonInfoCallback.c() != null ? tMDBPersonInfoCallback.c() : "N/A";
            int intValue = tMDBPersonInfoCallback.d() != null ? tMDBPersonInfoCallback.d().intValue() : 5;
            String f2 = tMDBPersonInfoCallback.f() != null ? tMDBPersonInfoCallback.f() : "N/A";
            String a2 = tMDBPersonInfoCallback.a() != null ? tMDBPersonInfoCallback.a() : "N/A";
            if (tMDBPersonInfoCallback.e() != null && tMDBPersonInfoCallback.e().a() != null && tMDBPersonInfoCallback.e().a().size() > 0) {
                this.rvCast.setLayoutManager(new LinearLayoutManager(this, 0, false));
                this.rvCast.setItemAnimator(new a.y.e.c());
                PersonImagesAdapter personImagesAdapter = new PersonImagesAdapter(tMDBPersonInfoCallback.e().a(), this.f26418j, true);
                this.t = personImagesAdapter;
                this.rvCast.setAdapter(personImagesAdapter);
            }
            TextView textView3 = this.tvCastName;
            if (textView3 != null) {
                textView3.setText(g2);
            }
            if (this.llPobBox == null || this.llPobBoxInfo == null || this.tvPlaceOfBirth == null || h2 == null || h2.isEmpty() || h2.equals("N/A")) {
                LinearLayout linearLayout = this.llPobBox;
                if (linearLayout != null) {
                    linearLayout.setVisibility(0);
                }
                LinearLayout linearLayout2 = this.llPobBoxInfo;
                if (linearLayout2 != null) {
                    linearLayout2.setVisibility(0);
                }
                TextView textView4 = this.tvPlaceOfBirth;
                if (textView4 != null) {
                    textView4.setText("N/A");
                }
            } else {
                this.llPobBox.setVisibility(0);
                this.llPobBoxInfo.setVisibility(0);
                this.tvPlaceOfBirth.setText(h2);
            }
            if (this.tvDateOfBirth == null || this.llDobBoxInfo == null || this.llDobBox == null || b2 == null || b2.isEmpty() || b2.equals("N/A")) {
                LinearLayout linearLayout3 = this.llDobBox;
                if (linearLayout3 != null) {
                    linearLayout3.setVisibility(0);
                }
                LinearLayout linearLayout4 = this.llDobBoxInfo;
                if (linearLayout4 != null) {
                    linearLayout4.setVisibility(0);
                }
                TextView textView5 = this.tvDateOfBirth;
                if (textView5 != null) {
                    textView5.setText("N/A");
                }
            } else {
                this.llDobBox.setVisibility(0);
                this.llDobBoxInfo.setVisibility(0);
                this.tvDateOfBirth.setText(b2);
            }
            LinearLayout linearLayout5 = this.llGenderBox;
            if (linearLayout5 == null || this.llGenderBoxInfo == null || this.tvGender == null || intValue == 5) {
                if (linearLayout5 != null) {
                    linearLayout5.setVisibility(0);
                }
                LinearLayout linearLayout6 = this.llGenderBoxInfo;
                if (linearLayout6 != null) {
                    linearLayout6.setVisibility(0);
                }
                textView = this.tvGender;
            } else {
                linearLayout5.setVisibility(0);
                this.llGenderBoxInfo.setVisibility(0);
                if (intValue == 1) {
                    textView2 = this.tvGender;
                    str = "Female";
                } else if (intValue == 2) {
                    textView2 = this.tvGender;
                    str = "Male";
                } else {
                    textView = this.tvGender;
                    textView.setText("N/A");
                }
                textView2.setText(str);
            }
            LinearLayout linearLayout7 = this.llKnownForBox;
            if (linearLayout7 == null || this.llKnownForBoxInfo == null || this.tvKnownFor == null) {
                if (linearLayout7 != null) {
                    linearLayout7.setVisibility(0);
                }
                LinearLayout linearLayout8 = this.llKnownForBoxInfo;
                if (linearLayout8 != null) {
                    linearLayout8.setVisibility(0);
                }
                TextView textView6 = this.tvKnownFor;
                if (textView6 != null) {
                    textView6.setText("N/A");
                }
            } else {
                linearLayout7.setVisibility(0);
                this.llKnownForBoxInfo.setVisibility(0);
                TextView textView7 = this.tvKnownFor;
                if (textView7 != null) {
                    textView7.setText(f2);
                }
            }
            if (this.tvCastDesc == null || a2 == null || a2.isEmpty() || a2.equals("N/A")) {
                TextView textView8 = this.tvCastDesc;
                if (textView8 != null) {
                    textView8.setVisibility(8);
                }
            } else {
                this.tvCastDesc.setText(a2);
            }
            if (this.llDodBox != null && this.llDODBoxInfo != null && this.tvDODInfo != null && c2 != null && !c2.equals("N/A") && !c2.isEmpty()) {
                this.llDodBox.setVisibility(0);
                this.llDODBoxInfo.setVisibility(0);
                this.tvDODInfo.setText(c2);
                return;
            }
            LinearLayout linearLayout9 = this.llDodBox;
            if (linearLayout9 != null) {
                linearLayout9.setVisibility(8);
            }
            LinearLayout linearLayout10 = this.llDODBoxInfo;
            if (linearLayout10 != null) {
                linearLayout10.setVisibility(8);
            }
        }
    }

    @Override
    public void P(TMDBCastsCallback tMDBCastsCallback) {
    }

    @Override
    public void T(TMDBTrailerCallback tMDBTrailerCallback) {
    }

    @Override
    public void X(TMDBGenreCallback tMDBGenreCallback) {
    }

    @Override
    public void a() {
    }

    @Override
    public void b() {
        ProgressDialog progressDialog = this.f26419k;
        if (progressDialog != null) {
            progressDialog.dismiss();
        }
    }

    @Override
    public void c(String str) {
        this.tvdetailprogressbar.setVisibility(8);
    }

    @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();
        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) {
        this.f26418j = this;
        super.onCreate(bundle);
        v0();
        setContentView(new c.k.a.i.d.a.a(this.f26418j).z().equals(c.k.a.g.n.a.s0) ? R.layout.activity_view_cast_details_tv : R.layout.activity_view_cast_details);
        ButterKnife.a(this);
        overridePendingTransition(R.anim.fade_out, R.anim.fade_in);
        t0();
        this.f26417i = new Date();
        f26412d = u0(this.f26418j);
        Locale locale = Locale.US;
        this.f26423o = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss", locale);
        this.f26415g = c.k.a.g.n.e.m0(c.k.a.i.d.c.a.e.d());
        f26413e = getApplicationContext().getPackageName();
        this.f26414f = c.k.a.g.n.e.m0(c.k.a.i.d.c.a.a.a());
        this.f26416h = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss", locale);
        getWindow().setFlags(1024, 1024);
        p0((Toolbar) findViewById(R.id.toolbar));
        AppBarLayout appBarLayout = this.appbarToolbar;
        if (appBarLayout != null) {
            appBarLayout.setBackground(getResources().getDrawable(R.drawable.dashboard_background));
        }
        w0();
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        super.onCreateOptionsMenu(menu);
        this.toolbar.x(R.menu.menu_text_icon);
        this.q = menu;
        this.p = menu.getItem(1).getSubMenu().findItem(R.id.empty);
        if (SharepreferenceDBHandler.f(this.f26418j).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.q;
        if (menu != null) {
            menu.performIdentifierAction(R.id.empty, 0);
            return true;
        }
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem menuItem) {
        Context context;
        this.p = 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.f26418j) != 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 g()).g(getResources().getString(R.string.no), new f()).n();
        }
        if (itemId == R.id.menu_load_channels_vod) {
            b.a aVar = new b.a(this);
            aVar.setTitle(this.f26418j.getResources().getString(R.string.confirm_to_refresh));
            aVar.f(this.f26418j.getResources().getString(R.string.do_you_want_toproceed));
            aVar.d(R.drawable.questionmark);
            aVar.j(this.f26418j.getResources().getString(R.string.yes), new h());
            aVar.g(this.f26418j.getResources().getString(R.string.no), new i());
            aVar.n();
        }
        if (itemId == R.id.menu_load_tv_guide) {
            b.a aVar2 = new b.a(this);
            aVar2.setTitle(this.f26418j.getResources().getString(R.string.confirm_to_refresh));
            aVar2.f(this.f26418j.getResources().getString(R.string.do_you_want_toproceed));
            aVar2.d(R.drawable.questionmark);
            aVar2.j(this.f26418j.getResources().getString(R.string.yes), new j());
            aVar2.g(this.f26418j.getResources().getString(R.string.no), new a());
            aVar2.n();
        }
        return super.onOptionsItemSelected(menuItem);
    }

    @Override
    public void onResume() {
        super.onResume();
        c.k.a.g.n.e.f(this.f26418j);
        getWindow().setFlags(1024, 1024);
        SharedPreferences sharedPreferences = getSharedPreferences("loginPrefs", 0);
        this.f26420l = sharedPreferences;
        if (sharedPreferences.getString("username", BuildConfig.FLAVOR).equals(BuildConfig.FLAVOR) && this.f26420l.getString("password", BuildConfig.FLAVOR).equals(BuildConfig.FLAVOR)) {
            startActivity(new Intent(this, LoginActivity.class));
        } else if (this.f26418j != null) {
            b();
        }
    }

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

    @Override
    public void p(TMDBCastsCallback tMDBCastsCallback) {
    }

    @Override
    public void r(SearchTMDBMoviesCallback searchTMDBMoviesCallback) {
    }

    public final void t0() {
        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 v0() {
        getWindow().getDecorView().setSystemUiVisibility(5894);
    }

    public final void w0() {
        SharedPreferences sharedPreferences = getSharedPreferences("loginPrefs", 0);
        this.f26420l = sharedPreferences;
        String string = sharedPreferences.getString("username", BuildConfig.FLAVOR);
        String string2 = this.f26420l.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 {
            x0(this.f26418j, string, string2);
        }
        this.logo.setOnClickListener(new b());
        this.iv_back_button.setOnClickListener(new c());
    }

    public final void x0(Context context, String str, String str2) {
        String str3;
        this.s = new c.k.a.h.e(this, context);
        Intent intent = getIntent();
        if (intent != null) {
            this.u = intent.getStringExtra("castID");
            this.v = intent.getStringExtra("castName");
            this.w = intent.getStringExtra("profilePath");
            String stringExtra = intent.getStringExtra("streamBackdrop");
            this.x = stringExtra;
            if (stringExtra != null && !stringExtra.equals(BuildConfig.FLAVOR) && context != null) {
                t.q(context).l(this.x).i(new d(context));
            }
            String str4 = this.u;
            if (str4 == null || str4.equals("0")) {
                return;
            }
            TextView textView = this.tvCastName;
            if (textView != null) {
                textView.setText(this.v);
            }
            if (context != null) {
                try {
                    if (this.ivMovieImage != null && (str3 = this.w) != null && !str3.isEmpty()) {
                        c.d.a.g.u(getApplicationContext()).q("https://image.tmdb.org/t/p/w500/" + this.w).J().m(new e());
                    }
                } catch (Exception unused) {
                }
            }
            this.s.f(this.u);
        }
    }
}