CCIPTV PRO v3.0.9.1版本的 MD5 值为:e78d4d980447be4a9f823314f45bbf03
以下内容为反编译后的 SeriesDetailM3UActivity.java 源代码,内容仅作参考
package boxbr.apksrebrand.smarters.view.activity;
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 boxbr.apksrebrand.smarters.model.callback.SearchTMDBTVShowsCallback;
import boxbr.apksrebrand.smarters.model.callback.TMDBCastsCallback;
import boxbr.apksrebrand.smarters.model.callback.TMDBTVShowsInfoCallback;
import boxbr.apksrebrand.smarters.model.callback.TMDBTrailerCallback;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.google.android.material.appbar.AppBarLayout;
import com.iptvsmarters.cciptv.R;
import d.a.k.b;
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.SingleCircularProgressDrawable;
import org.joda.time.chrono.BasicChronology;
public class SeriesDetailM3UActivity extends d.a.k.c implements View.OnClickListener, f.j.a.k.f.j {
public static String W;
public static String X;
public ProgressDialog A;
public SharedPreferences B;
public SharedPreferences C;
public f.j.a.i.p.e D;
public PopupWindow G;
public Button H;
public String I;
public String J;
public TextView K;
public TextView L;
public TextView M;
public Menu N;
public Button O;
public f.j.a.j.f P;
public String Q;
public SimpleDateFormat R;
public DateFormat S;
public Date T;
public String U;
@BindView
public AppBarLayout appbarToolbar;
@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 y;
public Context z;
public String r = "";
public String s = "";
public String t = "";
public String u = "";
public String v = "";
public String w = "";
public String x = "";
public String E = "";
public String F = "";
public Boolean V = Boolean.TRUE;
public class a implements View.OnClickListener {
public a() {
}
@Override
public void onClick(View view) {
SeriesDetailM3UActivity.this.G.dismiss();
}
}
public class b implements View.OnClickListener {
public b() {
}
@Override
public void onClick(View view) {
SeriesDetailM3UActivity.this.G.dismiss();
}
}
public class c implements View.OnClickListener {
public c() {
}
@Override
public void onClick(View view) {
SeriesDetailM3UActivity.this.G.dismiss();
}
}
public class d implements View.OnClickListener {
public d() {
}
@Override
public void onClick(View view) {
SeriesDetailM3UActivity.this.G.dismiss();
}
}
public class e implements View.OnClickListener {
public e() {
}
@Override
public void onClick(View view) {
f.j.a.h.i.e.a(SeriesDetailM3UActivity.this.z);
}
}
public class f extends f.c.a.r.h.g<Bitmap> {
public f() {
}
@Override
public void b(Bitmap bitmap, f.c.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 f.c.a.r.h.g<Bitmap> {
public g() {
}
@Override
public void b(Bitmap bitmap, f.c.a.r.g.c cVar) {
SeriesDetailM3UActivity.this.ivMovieImage.setBackground(new BitmapDrawable(bitmap));
}
}
public class h implements DialogInterface.OnClickListener {
public h(SeriesDetailM3UActivity seriesDetailM3UActivity) {
}
@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) {
f.j.a.h.i.e.N(SeriesDetailM3UActivity.this.z);
}
}
public class j implements DialogInterface.OnClickListener {
public j() {
}
@Override
public void onClick(DialogInterface dialogInterface, int i2) {
f.j.a.h.i.e.M(SeriesDetailM3UActivity.this.z);
}
}
public class k implements DialogInterface.OnClickListener {
public k(SeriesDetailM3UActivity seriesDetailM3UActivity) {
}
@Override
public void onClick(DialogInterface dialogInterface, int i2) {
dialogInterface.cancel();
}
}
public class l implements DialogInterface.OnClickListener {
public l(SeriesDetailM3UActivity seriesDetailM3UActivity) {
}
@Override
public void onClick(DialogInterface dialogInterface, int i2) {
}
}
public class m implements DialogInterface.OnClickListener {
public m(SeriesDetailM3UActivity seriesDetailM3UActivity) {
}
@Override
public void onClick(DialogInterface dialogInterface, int i2) {
dialogInterface.cancel();
}
}
public class n implements View.OnFocusChangeListener {
public final View b;
public n(View view) {
this.b = view;
}
public final void a(float f2) {
ObjectAnimator ofFloat = ObjectAnimator.ofFloat(this.b, "scaleX", f2);
ofFloat.setDuration(150L);
ofFloat.start();
}
public final void b(float f2) {
ObjectAnimator ofFloat = ObjectAnimator.ofFloat(this.b, "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.b.getTag().equals("1");
i2 = R.drawable.black_button_dark;
if (!equals && !this.b.getTag().equals("2") && !this.b.getTag().equals("3") && !this.b.getTag().equals("5")) {
if (this.b.getTag() == null || !this.b.getTag().equals("8")) {
return;
}
SeriesDetailM3UActivity.this.O.setBackgroundResource(i2);
}
this.b.setBackgroundResource(i2);
}
f2 = z ? 1.05f : 1.0f;
Log.e("id is", "" + this.b.getTag());
boolean equals2 = this.b.getTag().equals("1");
i2 = R.drawable.back_btn_effect;
if (equals2) {
a(f2);
b(f2);
this.b.setBackgroundResource(i2);
} else if (this.b.getTag().equals("2")) {
a(f2);
b(f2);
this.b.setBackgroundResource(R.drawable.logout_btn_effect);
} else if (this.b.getTag().equals("3") || this.b.getTag().equals("5")) {
a(f2);
b(f2);
this.b.setBackgroundResource(R.drawable.blue_btn_effect);
} else {
View view2 = this.b;
if (view2 == null || view2.getTag() == null || !this.b.getTag().equals("8")) {
a(1.15f);
b(1.15f);
return;
}
a(f2);
b(f2);
SeriesDetailM3UActivity.this.O.setBackgroundResource(i2);
}
}
}
public static long R0(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 S0(Context context) {
return String.valueOf(context.getApplicationInfo().loadLabel(context.getPackageManager()));
}
@Override
public void B(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.u = tMDBTrailerCallback.a().get(i2).a();
TextView textView = this.tvWatchTrailer;
if (textView != null) {
textView.setVisibility(0);
return;
}
return;
}
}
}
public final void P0() {
f.j.a.i.c cVar = new f.j.a.i.c();
cVar.h(this.x);
cVar.i(f.j.a.i.p.l.z(this.z));
cVar.g(this.r);
cVar.e(this.t);
this.D.l0(cVar);
this.tvAddToFav.setText(getResources().getString(R.string.remove_from_favourite));
this.ivFavourite.setVisibility(0);
}
public final void Q0() {
Window window = getWindow();
if (Build.VERSION.SDK_INT >= 19) {
window.clearFlags(67108864);
}
if (Build.VERSION.SDK_INT >= 21) {
window.addFlags(Integer.MIN_VALUE);
}
if (Build.VERSION.SDK_INT >= 21) {
window.setStatusBarColor(d.h.i.b.d(this, R.color.colorPrimaryDark));
}
}
public final void T0() {
this.z = this;
new f.j.a.i.p.a(this.z);
SharedPreferences sharedPreferences = getSharedPreferences("loginPrefs", 0);
this.B = sharedPreferences;
String string = sharedPreferences.getString("username", "");
String string2 = this.B.getString("password", "");
if (string == null || string2 == null || string.isEmpty() || string2.isEmpty()) {
startActivity(new Intent(this, LoginActivity.class));
} else {
Y0(this.z, string, string2);
}
}
public final void U0(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.G = popupWindow;
popupWindow.setContentView(inflate);
this.G.setWidth(-1);
this.G.setHeight(-1);
this.G.setFocusable(true);
this.G.setBackgroundDrawable(new BitmapDrawable());
this.G.showAtLocation(inflate, 17, 0, 0);
this.O = (Button) inflate.findViewById(R.id.bt_save_password);
this.H = (Button) inflate.findViewById(R.id.bt_close);
((TextView) inflate.findViewById(R.id.et_password)).setText("Series trailer is not available");
Button button = this.O;
if (button != null) {
button.setOnFocusChangeListener(new n(button));
}
Button button2 = this.H;
if (button2 != null) {
button2.setOnFocusChangeListener(new n(button2));
}
this.H.setOnClickListener(new c());
this.O.setOnClickListener(new d());
}
public final void V0() {
this.D.y0(this.x, f.j.a.i.p.l.z(this.z));
this.tvAddToFav.setText(getResources().getString(R.string.add_to_favourite));
this.ivFavourite.setVisibility(4);
}
public final void W0(SeriesDetailM3UActivity seriesDetailM3UActivity) {
View inflate = ((LayoutInflater) seriesDetailM3UActivity.getSystemService("layout_inflater")).inflate(R.layout.layout_cast_details, (RelativeLayout) seriesDetailM3UActivity.findViewById(R.id.rl_password_verification));
this.K = (TextView) inflate.findViewById(R.id.tv_casts_info_popup);
TextView textView = (TextView) inflate.findViewById(R.id.tv_parental_password);
this.M = textView;
textView.setText(getResources().getString(R.string.plot_without_col));
this.K.setText(this.I);
PopupWindow popupWindow = new PopupWindow(seriesDetailM3UActivity);
this.G = popupWindow;
popupWindow.setContentView(inflate);
this.G.setWidth(-1);
this.G.setHeight(-1);
this.G.setFocusable(true);
this.G.showAtLocation(inflate, 17, 0, 0);
Button button = (Button) inflate.findViewById(R.id.bt_close);
this.H = button;
if (button != null) {
button.setOnFocusChangeListener(new n(button));
}
this.H.setOnClickListener(new a());
}
public final void X0(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.L = textView;
textView.setText(this.J);
PopupWindow popupWindow = new PopupWindow(seriesDetailM3UActivity);
this.G = popupWindow;
popupWindow.setContentView(inflate);
this.G.setWidth(-1);
this.G.setHeight(-1);
this.G.setFocusable(true);
this.G.showAtLocation(inflate, 17, 0, 0);
Button button = (Button) inflate.findViewById(R.id.bt_close);
this.H = button;
if (button != null) {
button.setOnFocusChangeListener(new n(button));
}
this.H.setOnClickListener(new b());
}
public final void Y0(Context context, String str, String str2) {
ImageView imageView;
TextView textView;
String str3;
this.P = new f.j.a.j.f(this, context);
int i2 = 0;
this.scrollView.setVisibility(0);
Intent intent = getIntent();
if (intent != null) {
this.r = intent.getStringExtra("episode_name");
this.v = intent.getStringExtra("series_name");
this.w = intent.getStringExtra("series_icon");
this.x = intent.getStringExtra("episode_url");
this.F = intent.getStringExtra("series_num");
this.t = intent.getStringExtra("series_categoryId");
if (this.D.m0(this.x, f.j.a.i.p.l.z(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.w) != null && !str3.isEmpty()) {
f.c.a.g.u(context).q(this.w).O().l(new g());
}
if (this.E != null && (textView = this.tvMovieName) != null) {
textView.setText(this.r);
}
this.P.d(this.v);
}
}
@Override
public void a() {
}
@Override
public void b() {
ProgressDialog progressDialog = this.A;
if (progressDialog != null) {
progressDialog.dismiss();
}
}
@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 e(String str) {
this.llDetailProgressBar.setVisibility(8);
this.llDetailRightSide.setVisibility(0);
}
@Override
public void l(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.J = 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 m0(TMDBCastsCallback tMDBCastsCallback) {
}
@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.z = 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.Q = f.j.a.h.i.e.m0(f.j.a.k.d.c.a.a.a());
this.R = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss", Locale.US);
this.T = new Date();
this.S = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss", Locale.US);
W = getApplicationContext().getPackageName();
this.U = f.j.a.h.i.e.m0(f.j.a.k.d.c.a.e.d());
X = S0(this.z);
getWindow().setFlags(BasicChronology.CACHE_SIZE, BasicChronology.CACHE_SIZE);
K0((Toolbar) findViewById(R.id.toolbar));
Q0();
f.j.a.i.p.l.N("m3u", this.z);
this.D = new f.j.a.i.p.e(this.z);
this.logo.setOnClickListener(new e());
T0();
SharedPreferences sharedPreferences = this.z.getSharedPreferences("selectedPlayer", 0);
this.C = sharedPreferences;
sharedPreferences.getString("selectedPlayer", "");
ImageView imageView = this.y;
if (imageView != null) {
imageView.setOnClickListener(this);
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
this.toolbar.x(R.menu.menu_text_icon);
this.N = menu;
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()).a = 16;
}
}
return true;
}
@Override
public boolean onKeyUp(int i2, KeyEvent keyEvent) {
if (i2 != 82) {
return super.onKeyUp(i2, keyEvent);
}
Menu menu = this.N;
if (menu != null) {
menu.performIdentifierAction(R.id.empty, 0);
return true;
}
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem menuItem) {
Context context;
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.z) != null) {
b.a aVar = new b.a(context, R.style.AlertDialogCustom);
aVar.q(getResources().getString(R.string.logout_title));
aVar.h(getResources().getString(R.string.logout_message));
aVar.n(getResources().getString(R.string.yes), new i());
aVar.j(getResources().getString(R.string.no), new h(this));
aVar.s();
}
if (itemId == R.id.menu_load_channels_vod) {
b.a aVar2 = new b.a(this);
aVar2.q(this.z.getResources().getString(R.string.confirm_to_refresh));
aVar2.h(this.z.getResources().getString(R.string.do_you_want_toproceed));
aVar2.f(R.drawable.questionmark);
aVar2.n(this.z.getResources().getString(R.string.yes), new j());
aVar2.j(this.z.getResources().getString(R.string.no), new k(this));
aVar2.s();
}
if (itemId == R.id.menu_load_tv_guide) {
b.a aVar3 = new b.a(this);
aVar3.q(this.z.getResources().getString(R.string.confirm_to_refresh));
aVar3.h(this.z.getResources().getString(R.string.do_you_want_toproceed));
aVar3.f(R.drawable.questionmark);
aVar3.n(this.z.getResources().getString(R.string.yes), new l(this));
aVar3.j(this.z.getResources().getString(R.string.no), new m(this));
aVar3.s();
}
return super.onOptionsItemSelected(menuItem);
}
@Override
public void onResume() {
super.onResume();
f.j.a.h.i.e.f(this.z);
SharedPreferences sharedPreferences = getSharedPreferences("loginPrefs", 0);
this.B = sharedPreferences;
if (sharedPreferences.getString("username", "").equals("") && this.B.getString("password", "").equals("")) {
startActivity(new Intent(this, LoginActivity.class));
} else if (this.z != null) {
b();
}
}
@OnClick
public void onViewClicked(View view) {
String str;
String str2;
switch (view.getId()) {
case R.id.tv_add_to_fav:
if (this.D.m0(this.x, f.j.a.i.p.l.z(this.z)).size() > 0) {
V0();
return;
} else {
P0();
return;
}
case R.id.tv_detail_back_btn:
case R.id.tv_watch_trailer:
String str3 = this.u;
if (str3 == null || str3.isEmpty()) {
U0(this);
return;
} else {
startActivity(new Intent(this, YouTubePlayerActivity.class).putExtra("you_tube_trailer", this.u));
return;
}
case R.id.tv_play:
SharedPreferences sharedPreferences = this.z.getSharedPreferences("selectedPlayer", 0);
this.C = sharedPreferences;
String string = sharedPreferences.getString("selectedPlayer", "");
SimpleDateFormat simpleDateFormat = this.R;
if (R0(simpleDateFormat, simpleDateFormat.format(new Date(f.j.a.k.d.c.a.f.a(this.z))), this.S.format(this.T)) >= f.j.a.k.d.c.a.d.p() && (str = this.Q) != null && this.U != null && (!X.equals(str) || (this.Q != null && (str2 = this.U) != null && !W.equals(str2)))) {
this.V = Boolean.FALSE;
}
if (this.V.booleanValue()) {
try {
f.j.a.h.i.e.U(this.z, string, 0, "series", "", this.F, this.r, null, this.x);
return;
} catch (Exception unused) {
return;
}
}
return;
case R.id.tv_readmore:
W0(this);
return;
case R.id.tv_readmore_genre:
X0(this);
return;
default:
return;
}
}
@Override
public void q(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.P.c(intValue);
this.P.e(intValue);
String b2 = searchTMDBTVShowsCallback.a().get(0).b();
Double g2 = searchTMDBTVShowsCallback.a().get(0).g();
this.s = searchTMDBTVShowsCallback.a().get(0).f();
String a2 = searchTMDBTVShowsCallback.a().get(0).a();
if (new f.j.a.k.d.a.a(this.z).w().equals(f.j.a.h.i.a.i0)) {
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) {
f.c.a.g.u(getApplicationContext()).q(sb2).O().l(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(SingleCircularProgressDrawable.START_ANGLE_MAX_NORMAL);
}
}
String str2 = this.s;
this.I = 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.s.length() > 150;
TextView textView3 = this.tvCastInfo;
if (z) {
textView3.setText(this.s);
this.tvReadMore.setVisibility(0);
return;
}
textView3.setText(this.s);
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.r;
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);
}
}