TopTV v3.0.1版本的 MD5 值为:0fc1b9ce94885bc92edd11a6ee3e5932
以下内容为反编译后的 SeriesDetailM3UActivity.java 源代码,内容仅作参考
package com.toptvone.toptviptvbox.view.activity;
import a.b.k.b;
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.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 androidx.appcompat.widget.ActionMenuView;
import androidx.appcompat.widget.Toolbar;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.google.android.material.appbar.AppBarLayout;
import com.toptvone.toptviptvbox.R;
import com.toptvone.toptviptvbox.model.FavouriteM3UModel;
import com.toptvone.toptviptvbox.model.callback.SearchTMDBTVShowsCallback;
import com.toptvone.toptviptvbox.model.callback.TMDBCastsCallback;
import com.toptvone.toptviptvbox.model.callback.TMDBTVShowsInfoCallback;
import com.toptvone.toptviptvbox.model.callback.TMDBTrailerCallback;
import com.toptvone.toptviptvbox.model.database.DatabaseHandler;
import com.toptvone.toptviptvbox.model.database.DatabaseUpdatedStatusDBModel;
import com.toptvone.toptviptvbox.model.database.LiveStreamDBHandler;
import com.toptvone.toptviptvbox.model.database.SharepreferenceDBHandler;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.concurrent.TimeUnit;
import me.zhanghai.android.materialprogressbar.BuildConfig;
public class SeriesDetailM3UActivity extends a.b.k.c implements View.OnClickListener, c.k.a.i.f.j {
public static String f25959d;
public static String f25960e;
public LiveStreamDBHandler A;
public DatabaseHandler M;
public PopupWindow N;
public Button O;
public String P;
public String Q;
public TextView R;
public TextView S;
public TextView T;
public MenuItem U;
public Menu V;
public Button W;
public c.k.a.h.f Y;
public String Z;
@BindView
public AppBarLayout appbarToolbar;
public SimpleDateFormat f0;
public DateFormat g0;
public Date h0;
public String i0;
@BindView
public ImageView ivFavourite;
@BindView
public ImageView ivMovieImage;
@BindView
public LinearLayout llCastBox;
@BindView
public LinearLayout llCastBoxInfo;
@BindView
public LinearLayout llDetailLeftSide;
@BindView
public LinearLayout llDetailProgressBar;
@BindView
public LinearLayout llDetailRightSide;
@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 ImageView logo;
@BindView
public RatingBar ratingBar;
@BindView
public RelativeLayout rlAccountInfo;
@BindView
public RelativeLayout rlTransparent;
@BindView
public ScrollView scrollView;
@BindView
public Toolbar toolbar;
@BindView
public TextView tvAccountInfo;
@BindView
public TextView tvAddToFav;
@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 tvReadMoreGenre;
@BindView
public TextView tvReleaseDate;
@BindView
public TextView tvReleaseDateInfo;
@BindView
public TextView tvWatchTrailer;
@BindView
public TextView tv_genre_info;
@BindView
public TextView tvdetailbackbutton;
@BindView
public ProgressBar tvdetailprogressbar;
public ImageView v;
public Context w;
public ProgressDialog x;
public SharedPreferences y;
public SharedPreferences z;
public String f25961f = BuildConfig.FLAVOR;
public String f25962g = BuildConfig.FLAVOR;
public String f25963h = BuildConfig.FLAVOR;
public String f25964i = BuildConfig.FLAVOR;
public String f25965j = BuildConfig.FLAVOR;
public String f25966k = BuildConfig.FLAVOR;
public String f25967l = BuildConfig.FLAVOR;
public String f25968m = BuildConfig.FLAVOR;
public String f25969n = BuildConfig.FLAVOR;
public String f25970o = BuildConfig.FLAVOR;
public String p = BuildConfig.FLAVOR;
public String q = BuildConfig.FLAVOR;
public String r = BuildConfig.FLAVOR;
public String s = BuildConfig.FLAVOR;
public String t = BuildConfig.FLAVOR;
public String u = BuildConfig.FLAVOR;
public DatabaseUpdatedStatusDBModel B = new DatabaseUpdatedStatusDBModel();
public DatabaseUpdatedStatusDBModel C = new DatabaseUpdatedStatusDBModel();
public String D = BuildConfig.FLAVOR;
public String E = BuildConfig.FLAVOR;
public String F = BuildConfig.FLAVOR;
public String G = BuildConfig.FLAVOR;
public String H = BuildConfig.FLAVOR;
public String I = BuildConfig.FLAVOR;
public String J = BuildConfig.FLAVOR;
public int K = -1;
public String L = BuildConfig.FLAVOR;
public String X = BuildConfig.FLAVOR;
public Boolean j0 = Boolean.TRUE;
public class a implements View.OnClickListener {
public a() {
}
@Override
public void onClick(View view) {
SeriesDetailM3UActivity.this.N.dismiss();
}
}
public class b implements View.OnClickListener {
public b() {
}
@Override
public void onClick(View view) {
SeriesDetailM3UActivity.this.N.dismiss();
}
}
public class c implements View.OnClickListener {
public c() {
}
@Override
public void onClick(View view) {
SeriesDetailM3UActivity.this.N.dismiss();
}
}
public class d implements View.OnClickListener {
public d() {
}
@Override
public void onClick(View view) {
SeriesDetailM3UActivity.this.N.dismiss();
}
}
public class e implements View.OnClickListener {
public e() {
}
@Override
public void onClick(View view) {
c.k.a.g.n.e.a(SeriesDetailM3UActivity.this.w);
}
}
public class f extends c.d.a.r.h.g<Bitmap> {
public f() {
}
@Override
public void b(Bitmap bitmap, c.d.a.r.g.c cVar) {
SeriesDetailM3UActivity.this.appbarToolbar.setBackground(new BitmapDrawable(bitmap));
SeriesDetailM3UActivity seriesDetailM3UActivity = SeriesDetailM3UActivity.this;
seriesDetailM3UActivity.rlTransparent.setBackgroundColor(seriesDetailM3UActivity.getResources().getColor(R.color.trasparent_black));
SeriesDetailM3UActivity seriesDetailM3UActivity2 = SeriesDetailM3UActivity.this;
seriesDetailM3UActivity2.toolbar.setBackgroundColor(seriesDetailM3UActivity2.getResources().getColor(R.color.trasparent_black));
}
}
public class g extends c.d.a.r.h.g<Bitmap> {
public g() {
}
@Override
public void b(Bitmap bitmap, c.d.a.r.g.c cVar) {
SeriesDetailM3UActivity.this.ivMovieImage.setBackground(new BitmapDrawable(bitmap));
}
}
public class h implements DialogInterface.OnClickListener {
public h() {
}
@Override
public void onClick(DialogInterface dialogInterface, int i2) {
dialogInterface.dismiss();
}
}
public class i implements DialogInterface.OnClickListener {
public i() {
}
@Override
public void onClick(DialogInterface dialogInterface, int i2) {
c.k.a.g.n.e.N(SeriesDetailM3UActivity.this.w);
}
}
public class j implements DialogInterface.OnClickListener {
public j() {
}
@Override
public void onClick(DialogInterface dialogInterface, int i2) {
c.k.a.g.n.e.M(SeriesDetailM3UActivity.this.w);
}
}
public class k implements DialogInterface.OnClickListener {
public k() {
}
@Override
public void onClick(DialogInterface dialogInterface, int i2) {
dialogInterface.cancel();
}
}
public class l implements DialogInterface.OnClickListener {
public l() {
}
@Override
public void onClick(DialogInterface dialogInterface, int i2) {
}
}
public class m implements DialogInterface.OnClickListener {
public m() {
}
@Override
public void onClick(DialogInterface dialogInterface, int i2) {
dialogInterface.cancel();
}
}
public class n implements View.OnFocusChangeListener {
public final View f25984b;
public n(View view) {
this.f25984b = view;
}
public final void a(float f2) {
ObjectAnimator ofFloat = ObjectAnimator.ofFloat(this.f25984b, "scaleX", f2);
ofFloat.setDuration(150L);
ofFloat.start();
}
public final void b(float f2) {
ObjectAnimator ofFloat = ObjectAnimator.ofFloat(this.f25984b, "scaleY", f2);
ofFloat.setDuration(150L);
ofFloat.start();
}
@Override
@SuppressLint({"ResourceType"})
public void onFocusChange(View view, boolean z) {
float f2;
int i2;
if (!z) {
if (z) {
return;
}
f2 = z ? 1.09f : 1.0f;
a(f2);
b(f2);
boolean equals = this.f25984b.getTag().equals("1");
i2 = R.drawable.black_button_dark;
if (!equals && !this.f25984b.getTag().equals("2") && !this.f25984b.getTag().equals("3") && !this.f25984b.getTag().equals("5")) {
if (this.f25984b.getTag() == null || !this.f25984b.getTag().equals("8")) {
return;
}
SeriesDetailM3UActivity.this.W.setBackgroundResource(i2);
}
this.f25984b.setBackgroundResource(i2);
}
f2 = z ? 1.05f : 1.0f;
Log.e("id is", BuildConfig.FLAVOR + this.f25984b.getTag());
boolean equals2 = this.f25984b.getTag().equals("1");
i2 = R.drawable.back_btn_effect;
if (equals2) {
a(f2);
b(f2);
this.f25984b.setBackgroundResource(i2);
} else if (this.f25984b.getTag().equals("2")) {
a(f2);
b(f2);
this.f25984b.setBackgroundResource(R.drawable.logout_btn_effect);
} else if (this.f25984b.getTag().equals("3") || this.f25984b.getTag().equals("5")) {
a(f2);
b(f2);
this.f25984b.setBackgroundResource(R.drawable.blue_btn_effect);
} else {
View view2 = this.f25984b;
if (view2 == null || view2.getTag() == null || !this.f25984b.getTag().equals("8")) {
a(1.15f);
b(1.15f);
return;
}
a(f2);
b(f2);
SeriesDetailM3UActivity.this.W.setBackgroundResource(i2);
}
}
}
public static long w0(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 x0(Context context) {
return String.valueOf(context.getApplicationInfo().loadLabel(context.getPackageManager()));
}
@Override
public void A(TMDBTrailerCallback tMDBTrailerCallback) {
if (tMDBTrailerCallback == null || 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.f25970o = tMDBTrailerCallback.a().get(i2).a();
TextView textView = this.tvWatchTrailer;
if (textView != null) {
textView.setVisibility(0);
return;
}
return;
}
}
}
public final void A0() {
this.A.J0(this.u, SharepreferenceDBHandler.A(this.w));
this.tvAddToFav.setText(getResources().getString(R.string.add_to_favourite));
this.ivFavourite.setVisibility(4);
}
public final void B0(SeriesDetailM3UActivity seriesDetailM3UActivity) {
View inflate = ((LayoutInflater) seriesDetailM3UActivity.getSystemService("layout_inflater")).inflate(R.layout.layout_cast_details, (RelativeLayout) seriesDetailM3UActivity.findViewById(R.id.rl_password_verification));
this.R = (TextView) inflate.findViewById(R.id.tv_casts_info_popup);
TextView textView = (TextView) inflate.findViewById(R.id.tv_parental_password);
this.T = textView;
textView.setText(getResources().getString(R.string.plot_without_col));
this.R.setText(this.P);
PopupWindow popupWindow = new PopupWindow(seriesDetailM3UActivity);
this.N = popupWindow;
popupWindow.setContentView(inflate);
this.N.setWidth(-1);
this.N.setHeight(-1);
this.N.setFocusable(true);
this.N.showAtLocation(inflate, 17, 0, 0);
Button button = (Button) inflate.findViewById(R.id.bt_close);
this.O = button;
if (button != null) {
button.setOnFocusChangeListener(new n(button));
}
this.O.setOnClickListener(new a());
}
public final void C0(SeriesDetailM3UActivity seriesDetailM3UActivity) {
View inflate = ((LayoutInflater) seriesDetailM3UActivity.getSystemService("layout_inflater")).inflate(R.layout.layout_genre_details, (RelativeLayout) seriesDetailM3UActivity.findViewById(R.id.rl_password_verification));
TextView textView = (TextView) inflate.findViewById(R.id.tv_genre_info_popup);
this.S = textView;
textView.setText(this.Q);
PopupWindow popupWindow = new PopupWindow(seriesDetailM3UActivity);
this.N = popupWindow;
popupWindow.setContentView(inflate);
this.N.setWidth(-1);
this.N.setHeight(-1);
this.N.setFocusable(true);
this.N.showAtLocation(inflate, 17, 0, 0);
Button button = (Button) inflate.findViewById(R.id.bt_close);
this.O = button;
if (button != null) {
button.setOnFocusChangeListener(new n(button));
}
this.O.setOnClickListener(new b());
}
public final void D0(Context context, String str, String str2) {
ImageView imageView;
TextView textView;
String str3;
this.Y = new c.k.a.h.f(this, context);
int i2 = 0;
this.scrollView.setVisibility(0);
Intent intent = getIntent();
if (intent != null) {
this.f25961f = intent.getStringExtra("episode_name");
this.s = intent.getStringExtra("series_name");
this.t = intent.getStringExtra("series_icon");
this.u = intent.getStringExtra("episode_url");
this.J = intent.getStringExtra("series_num");
this.f25968m = intent.getStringExtra("series_categoryId");
if (this.A.V(this.u, SharepreferenceDBHandler.A(context)).size() > 0) {
this.tvAddToFav.setText(getResources().getString(R.string.remove_from_favourite));
imageView = this.ivFavourite;
} else {
this.tvAddToFav.setText(getResources().getString(R.string.add_to_favourite));
imageView = this.ivFavourite;
i2 = 4;
}
imageView.setVisibility(i2);
if (context != null && (str3 = this.t) != null && !str3.isEmpty()) {
c.d.a.g.u(context).q(this.t).J().m(new g());
}
if (this.F != null && (textView = this.tvMovieName) != null) {
textView.setText(this.f25961f);
}
this.Y.d(this.s);
}
}
@Override
public void J(TMDBTVShowsInfoCallback tMDBTVShowsInfoCallback) {
TextView textView;
TextView textView2;
if (tMDBTVShowsInfoCallback == null || tMDBTVShowsInfoCallback.a() == null || tMDBTVShowsInfoCallback.a().size() <= 0) {
LinearLayout linearLayout = this.llDirectorBox;
if (linearLayout != null) {
linearLayout.setVisibility(0);
}
LinearLayout linearLayout2 = this.llDirectorBoxInfo;
if (linearLayout2 != null) {
linearLayout2.setVisibility(0);
}
textView = this.tvDirectorInfo;
} else {
StringBuilder sb = new StringBuilder();
for (int i2 = 0; i2 < tMDBTVShowsInfoCallback.a().size(); i2++) {
sb.append(tMDBTVShowsInfoCallback.a().get(i2).a());
sb.append(",");
}
String substring = sb.substring(0, sb.toString().lastIndexOf(44));
if (this.tvDirectorInfo == null || this.llDirectorBoxInfo == null || this.llDirectorBox == null || substring.isEmpty()) {
LinearLayout linearLayout3 = this.llDirectorBox;
if (linearLayout3 != null) {
linearLayout3.setVisibility(0);
}
LinearLayout linearLayout4 = this.llDirectorBoxInfo;
if (linearLayout4 != null) {
linearLayout4.setVisibility(0);
}
textView = this.tvDirectorInfo;
} else {
this.llDirectorBox.setVisibility(0);
this.llDirectorBoxInfo.setVisibility(0);
this.tvDirectorInfo.setText(substring);
}
}
if (tMDBTVShowsInfoCallback == null || tMDBTVShowsInfoCallback.b() == null || tMDBTVShowsInfoCallback.b().size() <= 0) {
LinearLayout linearLayout5 = this.llGenreBox;
if (linearLayout5 != null) {
linearLayout5.setVisibility(0);
}
LinearLayout linearLayout6 = this.llGenreBoxInfo;
if (linearLayout6 != null) {
linearLayout6.setVisibility(0);
}
TextView textView3 = this.tvReadMoreGenre;
if (textView3 != null) {
textView3.setVisibility(8);
}
textView2 = this.tv_genre_info;
} else {
StringBuilder sb2 = new StringBuilder();
for (int i3 = 0; i3 < tMDBTVShowsInfoCallback.b().size(); i3++) {
sb2.append(tMDBTVShowsInfoCallback.b().get(i3).a());
sb2.append(" / ");
}
String substring2 = sb2.substring(0, sb2.toString().lastIndexOf(47));
this.Q = substring2;
if (this.llGenreBox == null || this.llGenreBoxInfo == null || this.tv_genre_info == null || substring2.isEmpty()) {
LinearLayout linearLayout7 = this.llGenreBox;
if (linearLayout7 != null) {
linearLayout7.setVisibility(0);
}
LinearLayout linearLayout8 = this.llGenreBoxInfo;
if (linearLayout8 != null) {
linearLayout8.setVisibility(0);
}
TextView textView4 = this.tvReadMoreGenre;
if (textView4 != null) {
textView4.setVisibility(8);
}
textView2 = this.tv_genre_info;
} else {
this.llGenreBox.setVisibility(0);
this.llGenreBoxInfo.setVisibility(0);
if (substring2.length() > 40) {
this.tv_genre_info.setText(substring2);
this.tvReadMoreGenre.setVisibility(0);
} else {
this.tv_genre_info.setText(substring2);
this.tvReadMoreGenre.setVisibility(8);
}
}
}
this.llDetailProgressBar.setVisibility(8);
this.llDetailRightSide.setVisibility(0);
}
@Override
public void S(TMDBCastsCallback tMDBCastsCallback) {
}
@Override
public void a() {
}
@Override
public void b() {
ProgressDialog progressDialog = this.x;
if (progressDialog != null) {
progressDialog.dismiss();
}
}
@Override
public void c(String str) {
this.llDetailProgressBar.setVisibility(8);
this.llDetailRightSide.setVisibility(0);
}
@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 i(SearchTMDBTVShowsCallback searchTMDBTVShowsCallback) {
TextView textView;
StringBuilder sb;
String str;
if (searchTMDBTVShowsCallback != null && searchTMDBTVShowsCallback.b() != null) {
if (searchTMDBTVShowsCallback.b().equals(1) && searchTMDBTVShowsCallback.a() != null && searchTMDBTVShowsCallback.a().get(0) != null) {
int intValue = searchTMDBTVShowsCallback.a().get(0).c().intValue();
this.Y.c(intValue);
this.Y.e(intValue);
String b2 = searchTMDBTVShowsCallback.a().get(0).b();
Double g2 = searchTMDBTVShowsCallback.a().get(0).g();
this.f25962g = searchTMDBTVShowsCallback.a().get(0).f();
String a2 = searchTMDBTVShowsCallback.a().get(0).a();
if (new c.k.a.i.d.a.a(this.w).z().equals(c.k.a.g.n.a.s0)) {
sb = new StringBuilder();
str = "https://image.tmdb.org/t/p/w1280/";
} else {
sb = new StringBuilder();
str = "https://image.tmdb.org/t/p/w500/";
}
sb.append(str);
sb.append(a2);
String sb2 = sb.toString();
if (this.appbarToolbar != null && a2 != null) {
c.d.a.g.u(getApplicationContext()).q(sb2).J().m(new f());
}
if (this.llReleasedBox == null || this.llReleasedBoxInfo == null || this.tvReleaseDateInfo == null || b2 == null || b2.isEmpty() || b2.equals("n/A")) {
LinearLayout linearLayout = this.llReleasedBox;
if (linearLayout != null) {
linearLayout.setVisibility(0);
}
LinearLayout linearLayout2 = this.llReleasedBoxInfo;
if (linearLayout2 != null) {
linearLayout2.setVisibility(0);
}
TextView textView2 = this.tvReleaseDateInfo;
if (textView2 != null) {
textView2.setText("N/A");
}
} else {
this.llReleasedBox.setVisibility(0);
this.llReleasedBoxInfo.setVisibility(0);
this.tvReleaseDateInfo.setText(b2);
}
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);
}
}
String str2 = this.f25962g;
this.P = str2;
if (this.llCastBox != null && this.llCastBoxInfo != null && this.tvCastInfo != null && str2 != null && !str2.isEmpty()) {
this.llCastBox.setVisibility(0);
this.llCastBoxInfo.setVisibility(0);
boolean z = this.f25962g.length() > 150;
TextView textView3 = this.tvCastInfo;
if (z) {
textView3.setText(this.f25962g);
this.tvReadMore.setVisibility(0);
return;
}
textView3.setText(this.f25962g);
this.tvReadMore.setVisibility(8);
return;
}
LinearLayout linearLayout3 = this.llCastBox;
if (linearLayout3 != null) {
linearLayout3.setVisibility(0);
}
LinearLayout linearLayout4 = this.llCastBoxInfo;
if (linearLayout4 != null) {
linearLayout4.setVisibility(0);
}
TextView textView4 = this.tvReadMore;
if (textView4 != null) {
textView4.setVisibility(8);
}
TextView textView5 = this.tvCastInfo;
if (textView5 != null) {
textView5.setText("N/A");
return;
}
return;
}
}
String str3 = this.f25961f;
if (str3 != null && (textView = this.tvMovieName) != null) {
textView.setText(str3);
}
TextView textView6 = this.tvMovieDurationInfo;
if (textView6 != null) {
textView6.setText("N/A");
}
TextView textView7 = this.tvCastInfo;
if (textView7 != null) {
textView7.setText("N/A");
}
TextView textView8 = this.tvDirectorInfo;
if (textView8 != null) {
textView8.setText("N/A");
}
TextView textView9 = this.tvReleaseDateInfo;
if (textView9 != null) {
textView9.setText("N/A");
}
TextView textView10 = this.tvReadMoreGenre;
if (textView10 != null) {
textView10.setVisibility(8);
}
TextView textView11 = this.tv_genre_info;
if (textView11 != null) {
textView11.setText("N/A");
}
TextView textView12 = this.tvReadMore;
if (textView12 != null) {
textView12.setVisibility(8);
}
this.llDetailProgressBar.setVisibility(8);
this.llDetailRightSide.setVisibility(0);
}
@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) {
super.onCreate(bundle);
setContentView(R.layout.activity_series_detail_m3u);
ButterKnife.a(this);
overridePendingTransition(R.anim.fade_out, R.anim.fade_in);
this.w = this;
AppBarLayout appBarLayout = this.appbarToolbar;
if (appBarLayout != null) {
appBarLayout.setBackground(getResources().getDrawable(R.drawable.dashboard_background));
}
TextView textView = this.tvPlay;
if (textView != null) {
textView.setOnFocusChangeListener(new n(textView));
this.tvPlay.requestFocus();
this.tvPlay.setFocusable(true);
}
TextView textView2 = this.tvAddToFav;
if (textView2 != null) {
textView2.setOnFocusChangeListener(new n(textView2));
}
TextView textView3 = this.tvdetailbackbutton;
if (textView3 != null) {
textView3.setOnFocusChangeListener(new n(textView3));
}
TextView textView4 = this.tvReadMore;
if (textView4 != null) {
textView4.setOnFocusChangeListener(new n(textView4));
}
TextView textView5 = this.tvReadMoreGenre;
if (textView5 != null) {
textView5.setOnFocusChangeListener(new n(textView5));
}
TextView textView6 = this.tvWatchTrailer;
if (textView6 != null) {
textView6.setOnFocusChangeListener(new n(textView6));
}
this.Z = c.k.a.g.n.e.m0(c.k.a.i.d.c.a.a.a());
Locale locale = Locale.US;
this.f0 = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss", locale);
this.h0 = new Date();
this.g0 = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss", locale);
f25959d = getApplicationContext().getPackageName();
this.i0 = c.k.a.g.n.e.m0(c.k.a.i.d.c.a.e.d());
f25960e = x0(this.w);
getWindow().setFlags(1024, 1024);
p0((Toolbar) findViewById(R.id.toolbar));
v0();
SharepreferenceDBHandler.O("m3u", this.w);
this.A = new LiveStreamDBHandler(this.w);
this.logo.setOnClickListener(new e());
y0();
SharedPreferences sharedPreferences = this.w.getSharedPreferences("selectedPlayer", 0);
this.z = sharedPreferences;
this.G = sharedPreferences.getString("selectedPlayer", BuildConfig.FLAVOR);
ImageView imageView = this.v;
if (imageView != null) {
imageView.setOnClickListener(this);
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
this.toolbar.x(R.menu.menu_text_icon);
this.V = menu;
this.U = menu.getItem(1).getSubMenu().findItem(R.id.empty);
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.V;
if (menu != null) {
menu.performIdentifierAction(R.id.empty, 0);
return true;
}
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem menuItem) {
Context context;
this.U = 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.w) != 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 i()).g(getResources().getString(R.string.no), new h()).n();
}
if (itemId == R.id.menu_load_channels_vod) {
b.a aVar = new b.a(this);
aVar.setTitle(this.w.getResources().getString(R.string.confirm_to_refresh));
aVar.f(this.w.getResources().getString(R.string.do_you_want_toproceed));
aVar.d(R.drawable.questionmark);
aVar.j(this.w.getResources().getString(R.string.yes), new j());
aVar.g(this.w.getResources().getString(R.string.no), new k());
aVar.n();
}
if (itemId == R.id.menu_load_tv_guide) {
b.a aVar2 = new b.a(this);
aVar2.setTitle(this.w.getResources().getString(R.string.confirm_to_refresh));
aVar2.f(this.w.getResources().getString(R.string.do_you_want_toproceed));
aVar2.d(R.drawable.questionmark);
aVar2.j(this.w.getResources().getString(R.string.yes), new l());
aVar2.g(this.w.getResources().getString(R.string.no), new m());
aVar2.n();
}
return super.onOptionsItemSelected(menuItem);
}
@Override
public void onResume() {
super.onResume();
c.k.a.g.n.e.f(this.w);
SharedPreferences sharedPreferences = getSharedPreferences("loginPrefs", 0);
this.y = sharedPreferences;
if (sharedPreferences.getString("username", BuildConfig.FLAVOR).equals(BuildConfig.FLAVOR) && this.y.getString("password", BuildConfig.FLAVOR).equals(BuildConfig.FLAVOR)) {
startActivity(new Intent(this, LoginActivity.class));
} else if (this.w != null) {
b();
}
}
@OnClick
public void onViewClicked(View view) {
String str;
String str2;
switch (view.getId()) {
case R.id.tv_add_to_fav:
if (this.A.V(this.u, SharepreferenceDBHandler.A(this.w)).size() > 0) {
A0();
return;
} else {
u0();
return;
}
case R.id.tv_detail_back_btn:
case R.id.tv_watch_trailer:
String str3 = this.f25970o;
if (str3 == null || str3.isEmpty()) {
z0(this);
return;
} else {
startActivity(new Intent(this, YouTubePlayerActivity.class).putExtra("you_tube_trailer", this.f25970o));
return;
}
case R.id.tv_play:
SharedPreferences sharedPreferences = this.w.getSharedPreferences("selectedPlayer", 0);
this.z = sharedPreferences;
String string = sharedPreferences.getString("selectedPlayer", BuildConfig.FLAVOR);
SimpleDateFormat simpleDateFormat = this.f0;
if (w0(simpleDateFormat, simpleDateFormat.format(new Date(c.k.a.i.d.c.a.f.a(this.w))), this.g0.format(this.h0)) >= c.k.a.i.d.c.a.d.p() && (str = this.Z) != null && this.i0 != null && (!f25960e.equals(str) || (this.Z != null && (str2 = this.i0) != null && !f25959d.equals(str2)))) {
this.j0 = Boolean.FALSE;
}
if (this.j0.booleanValue()) {
try {
c.k.a.g.n.e.U(this.w, string, 0, "series", BuildConfig.FLAVOR, this.J, this.f25961f, null, this.u);
return;
} catch (Exception unused) {
return;
}
}
return;
case R.id.tv_readmore:
B0(this);
return;
case R.id.tv_readmore_genre:
C0(this);
return;
default:
return;
}
}
public final void u0() {
FavouriteM3UModel favouriteM3UModel = new FavouriteM3UModel();
favouriteM3UModel.h(this.u);
favouriteM3UModel.i(SharepreferenceDBHandler.A(this.w));
favouriteM3UModel.g(this.f25961f);
favouriteM3UModel.e(this.f25968m);
this.A.R(favouriteM3UModel);
this.tvAddToFav.setText(getResources().getString(R.string.remove_from_favourite));
this.ivFavourite.setVisibility(0);
}
public final void v0() {
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));
}
}
public final void y0() {
this.w = this;
this.M = new DatabaseHandler(this.w);
SharedPreferences sharedPreferences = getSharedPreferences("loginPrefs", 0);
this.y = sharedPreferences;
String string = sharedPreferences.getString("username", BuildConfig.FLAVOR);
String string2 = this.y.getString("password", BuildConfig.FLAVOR);
if (string == null || string2 == null || string.isEmpty() || string2.isEmpty()) {
startActivity(new Intent(this, LoginActivity.class));
} else {
D0(this.w, string, string2);
}
}
public final void z0(SeriesDetailM3UActivity seriesDetailM3UActivity) {
View inflate = ((LayoutInflater) seriesDetailM3UActivity.getSystemService("layout_inflater")).inflate(R.layout.layout_movie_trailer, (RelativeLayout) seriesDetailM3UActivity.findViewById(R.id.rl_password_verification));
PopupWindow popupWindow = new PopupWindow(seriesDetailM3UActivity);
this.N = popupWindow;
popupWindow.setContentView(inflate);
this.N.setWidth(-1);
this.N.setHeight(-1);
this.N.setFocusable(true);
this.N.setBackgroundDrawable(new BitmapDrawable());
this.N.showAtLocation(inflate, 17, 0, 0);
this.W = (Button) inflate.findViewById(R.id.bt_save_password);
this.O = (Button) inflate.findViewById(R.id.bt_close);
((TextView) inflate.findViewById(R.id.et_password)).setText("Series trailer is not available");
Button button = this.W;
if (button != null) {
button.setOnFocusChangeListener(new n(button));
}
Button button2 = this.O;
if (button2 != null) {
button2.setOnFocusChangeListener(new n(button2));
}
this.O.setOnClickListener(new c());
this.W.setOnClickListener(new d());
}
}