正在查看: Vi App v10.18.0 应用的 FusionViliteMainActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Vi App v10.18.0 应用的 FusionViliteMainActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.yupptv.ott;
import android.app.ActivityManager;
import android.app.Dialog;
import android.app.KeyguardManager;
import android.app.PendingIntent;
import android.app.PictureInPictureParams;
import android.app.RemoteAction;
import android.content.ActivityNotFoundException;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.PorterDuff;
import android.graphics.Typeface;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.Icon;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.PowerManager;
import android.text.Html;
import android.text.TextUtils;
import android.transition.Fade;
import android.util.Base64;
import android.util.SparseArray;
import android.view.ContextThemeWrapper;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.activity.OnBackPressedCallback;
import androidx.activity.result.ActivityResultCallback;
import androidx.activity.result.ActivityResultLauncher;
import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.ActionBarDrawerToggle;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.appcompat.widget.AppCompatButton;
import androidx.appcompat.widget.AppCompatImageView;
import androidx.appcompat.widget.AppCompatTextView;
import androidx.appcompat.widget.LinearLayoutCompat;
import androidx.appcompat.widget.Toolbar;
import androidx.cardview.widget.CardView;
import androidx.core.content.ContextCompat;
import androidx.core.content.res.ResourcesCompat;
import androidx.core.graphics.drawable.DrawableCompat;
import androidx.core.graphics.drawable.RoundedBitmapDrawable;
import androidx.core.graphics.drawable.RoundedBitmapDrawableFactory;
import androidx.core.view.WindowInsetsControllerCompat;
import androidx.core.view.z1;
import androidx.core.widget.NestedScrollView;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import androidx.recyclerview.widget.DefaultItemAnimator;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.airbnb.lottie.LottieComposition;
import com.airbnb.lottie.LottieCompositionFactory;
import com.airbnb.lottie.LottieDrawable;
import com.airbnb.lottie.LottieListener;
import com.airbnb.lottie.LottieTask;
import com.bumptech.glide.Glide;
import com.bumptech.glide.RequestBuilder;
import com.bumptech.glide.load.DataSource;
import com.bumptech.glide.load.Transformation;
import com.bumptech.glide.load.engine.GlideException;
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions;
import com.bumptech.glide.request.RequestListener;
import com.bumptech.glide.request.target.BitmapImageViewTarget;
import com.bumptech.glide.request.target.SimpleTarget;
import com.bumptech.glide.request.target.Target;
import com.bumptech.glide.request.transition.Transition;
import com.clevertap.android.sdk.CTInboxListener;
import com.clevertap.android.sdk.CleverTapAPI;
import com.clevertap.android.sdk.InAppNotificationButtonListener;
import com.clevertap.android.sdk.InAppNotificationListener;
import com.clevertap.android.sdk.InboxMessageButtonListener;
import com.clevertap.android.sdk.inapp.CTInAppNotification;
import com.google.ads.interactivemedia.pal.ConsentSettings;
import com.google.ads.interactivemedia.pal.NonceLoader;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.offline.DownloadService;
import com.google.android.gms.ads.AdError;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdSize;
import com.google.android.gms.ads.FullScreenContentCallback;
import com.google.android.gms.ads.LoadAdError;
import com.google.android.gms.ads.admanager.AdManagerAdView;
import com.google.android.gms.ads.identifier.AdvertisingIdClient;
import com.google.android.gms.ads.interstitial.InterstitialAd;
import com.google.android.gms.ads.interstitial.InterstitialAdLoadCallback;
import com.google.android.gms.cast.MediaStatus;
import com.google.android.gms.cast.framework.CastButtonFactory;
import com.google.android.gms.cast.framework.CastContext;
import com.google.android.gms.cast.framework.CastSession;
import com.google.android.gms.cast.framework.Session;
import com.google.android.gms.cast.framework.SessionManager;
import com.google.android.gms.cast.framework.SessionManagerListener;
import com.google.android.gms.cast.framework.media.RemoteMediaClient;
import com.google.android.gms.common.GooglePlayServicesNotAvailableException;
import com.google.android.gms.common.GooglePlayServicesRepairableException;
import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.navigation.NavigationView;
import com.google.android.material.tabs.TabLayout;
import com.google.gson.Gson;
import com.journeyapps.barcodescanner.ScanContract;
import com.journeyapps.barcodescanner.ScanIntentResult;
import com.journeyapps.barcodescanner.ScanOptions;
import com.yupptv.ott.FusionViliteMainActivity;
import com.yupptv.ott.activity.BaseActivity;
import com.yupptv.ott.activity.LoadScreenActivity;
import com.yupptv.ott.adapters.InterstitialStaticPopupAdapter;
import com.yupptv.ott.adapters.RecyclerViewAdapter;
import com.yupptv.ott.adapters.SearchAdapter;
import com.yupptv.ott.analytics.AnalyticsUtils;
import com.yupptv.ott.analytics.AnalyticsV2;
import com.yupptv.ott.analytics.MyRecoManager;
import com.yupptv.ott.enums.AdsType;
import com.yupptv.ott.enums.ButtonType;
import com.yupptv.ott.enums.DialogType;
import com.yupptv.ott.enums.ListType;
import com.yupptv.ott.enums.PageType;
import com.yupptv.ott.enums.ScreenType;
import com.yupptv.ott.epg.EPGFiltersFragment;
import com.yupptv.ott.epg.EPGFragment;
import com.yupptv.ott.fragments.ActivateDeviceFragment;
import com.yupptv.ott.fragments.DetailsFragment;
import com.yupptv.ott.fragments.ErrorFragment;
import com.yupptv.ott.fragments.GridFragment;
import com.yupptv.ott.fragments.HomeFragment;
import com.yupptv.ott.fragments.LinearFragment;
import com.yupptv.ott.fragments.SearchFragment;
import com.yupptv.ott.fragments.SearchFragmentNew;
import com.yupptv.ott.fragments.ShowFilterFragment;
import com.yupptv.ott.fragments.ViewPagerFragment;
import com.yupptv.ott.fragments.WebViewFragment;
import com.yupptv.ott.fragments.account.ListFragment;
import com.yupptv.ott.fragments.payment.PaymentGateWaysFragment;
import com.yupptv.ott.interfaces.AppRecyclerViewScrollListener;
import com.yupptv.ott.interfaces.BannerAdStatusListener;
import com.yupptv.ott.interfaces.BottomButtonsActionListener;
import com.yupptv.ott.interfaces.CardItemCallback;
import com.yupptv.ott.interfaces.DialogListener;
import com.yupptv.ott.interfaces.FiltersSelectionListener;
import com.yupptv.ott.interfaces.FragmentCallback;
import com.yupptv.ott.interfaces.FragmentHost;
import com.yupptv.ott.interfaces.OfflinePlayingCallBack;
import com.yupptv.ott.interfaces.SearchCallback;
import com.yupptv.ott.interfaces.VideoDownloadCallBack;
import com.yupptv.ott.models.AdsResponse;
import com.yupptv.ott.models.BottomDataModel;
import com.yupptv.ott.models.MockTestList;
import com.yupptv.ott.player.ExoPlayerFragment;
import com.yupptv.ott.player.PlayerControlView;
import com.yupptv.ott.player.detail.UpNextFragment;
import com.yupptv.ott.player.offlinedownload.DownloadTracker;
import com.yupptv.ott.player.offlinedownload.MediaDownloadService;
import com.yupptv.ott.player.offlinedownload.OfflineDownloadData;
import com.yupptv.ott.player.offlinedownload.OfflineDownloadListFragment;
import com.yupptv.ott.utils.APIUtils;
import com.yupptv.ott.utils.ChromeCastUtils;
import com.yupptv.ott.utils.CleverTap;
import com.yupptv.ott.utils.Configurations;
import com.yupptv.ott.utils.Constants;
import com.yupptv.ott.utils.CustomLog;
import com.yupptv.ott.utils.DateHelper;
import com.yupptv.ott.utils.JuspayUtility;
import com.yupptv.ott.utils.NavigationConstants;
import com.yupptv.ott.utils.NavigationUtils;
import com.yupptv.ott.utils.OrientationUtils;
import com.yupptv.ott.utils.Preferences;
import com.yupptv.ott.utils.UiUtils;
import com.yupptv.ott.utils.Utils;
import com.yupptv.ott.utils.UtilsBase;
import com.yupptv.ott.viewmodels.AutoplayPosterModel;
import com.yupptv.ott.viewmodels.PartnerAutoplayBannerModel;
import com.yupptv.ott.views.Carousel;
import com.yupptv.ott.views.CustomMaterialSearchView;
import com.yupptv.ott.views.LineSpinFadeLoaderView;
import com.yupptv.ott.views.WatchWhileLayout;
import com.yupptv.ottsdk.OttSDK;
import com.yupptv.ottsdk.managers.Application.AppManager;
import com.yupptv.ottsdk.managers.MediaCatalog.MediaCatalogManager;
import com.yupptv.ottsdk.managers.Payment.PaymentManager;
import com.yupptv.ottsdk.managers.Preferences.PreferenceManager;
import com.yupptv.ottsdk.managers.User.UserManager;
import com.yupptv.ottsdk.model.AppLaunchPopupConfig;
import com.yupptv.ottsdk.model.BottomTemplateInfo;
import com.yupptv.ottsdk.model.Card;
import com.yupptv.ottsdk.model.Content;
import com.yupptv.ottsdk.model.ContentPage;
import com.yupptv.ottsdk.model.EPG;
import com.yupptv.ottsdk.model.EPGProgramsData;
import com.yupptv.ottsdk.model.EPGUserChannels;
import com.yupptv.ottsdk.model.Error;
import com.yupptv.ottsdk.model.Filter;
import com.yupptv.ottsdk.model.Menu;
import com.yupptv.ottsdk.model.PageData;
import com.yupptv.ottsdk.model.PageInfo;
import com.yupptv.ottsdk.model.Params;
import com.yupptv.ottsdk.model.Section;
import com.yupptv.ottsdk.model.SubMenu;
import com.yupptv.ottsdk.model.User;
import com.yupptv.ottsdk.model.ads.AdUrlResponse;
import com.yupptv.ottsdk.model.ads.AdUrlType;
import com.yupptv.ottsdk.model.payments.ActivePackagesResponse;
import com.yupptv.ottsdk.model.payments.InitiateJuspay;
import com.yupptv.ottsdk.model.payments.JuspayConfig;
import com.yupptv.ottsdk.model.systemfeatures.Fields;
import com.yupptv.ottsdk.model.user.Configs;
import com.yupptv.ottsdk.model.user.ContentLanguage;
import com.yupptv.ottsdk.model.user.FilterItemsList;
import com.yupptv.ottsdk.model.user.SubscriptionAnimationConfig;
import com.yupptv.ottsdk.model.user.UserSubscriptionOffer;
import com.yupptv.ottsdk.rest.network.RestAdapter;
import com.yupptv.ottsdk.utils.OttLog;
import in.juspay.hyper.constants.Labels;
import in.juspay.hyper.constants.LogSubCategory;
import in.juspay.hypersdk.analytics.LogConstants;
import in.juspay.hypersdk.core.PaymentConstants;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import org.json.JSONException;
import org.json.JSONObject;
public class FusionViliteMainActivity extends BaseActivity implements WatchWhileLayout.Listener, FragmentHost, View.OnClickListener, SearchCallback, FragmentCallback, CardItemCallback, DownloadTracker.Listener, BannerAdStatusListener, FiltersSelectionListener, AppRecyclerViewScrollListener, InAppNotificationButtonListener, InAppNotificationListener, InboxMessageButtonListener, CTInboxListener {
public static String disply_lang;
public static boolean enterPIPMode = false;
public static FrameLayout frameSetasDefault;
private static boolean isActivityRestarted;
public static boolean isFragmentSelected;
private static boolean isGdprDialogShown;
public static boolean isShowCaseToolTipShown;
private static JSONObject mCastObject;
private static String userId;
private RelativeLayout accountHeaderLayout;
public SearchAdapter adapter;
private AppBarLayout appBarLayout;
private AutoplayPosterModel autoplayPosterModel;
private OnBackPressedCallback backPressedCallback;
private int bannerAdsBottomMargin;
private AppCompatButton callButton;
public MenuItem chromecastMneu;
private ViewPagerClickListener clickListener;
private CollapsingToolbarLayout collapsingToolbarLayout;
private ConsentSettings consentSettings;
private RelativeLayout container_lottie;
private FrameLayout contentFrameLayout;
private FrameLayout contentframeLayout;
public Fragment currentSelectedFragment;
private ImageView detailBackgroundImage;
private NestedScrollView detailHeaderLayout;
private LinearLayout detailHeaderRootLayout;
private LinearLayoutCompat detailInfoRelativeLayout;
private ImageView detailPosterImage;
private View detatilGradientView;
private Dialog dialog;
private int dimen_110dp;
private AppCompatImageView downloadLottieAnimationView;
private DownloadTracker downloadTracker;
private RelativeLayout download_container_lottie;
private LineSpinFadeLoaderView drawerProgressBar;
private EPG epgData;
private AppCompatButton favActionButton;
public RelativeLayout favouritesActionMenuLayout;
public MenuItem filter;
private FixedAspectRatioRelativeLayout fixedAspectRatioRL;
private boolean footerAdLoaded;
private RelativeLayout gif_container;
private AppCompatImageView gif_view;
public Handler handler;
private AppCompatButton homePageTestButton;
private ImageView iV_Gradient_top;
private ImageView imgBack;
private Intent intent_mainActivity;
private InterstitialAd interstitialAd;
private boolean isComingFromChromeCast;
private boolean isDrawerOpeningState;
private Object itemObjTemp;
private Object itemObject;
public LineSpinFadeLoaderView jp_progressbar;
private ImageView languageImage;
private Typeface latoRegular;
private ImageView leftArrowIv;
private RelativeLayout leftArrowLayout;
private LinearLayout linear_home;
private LinearLayout linear_tablayout;
private View loggedInLayout;
private AppCompatImageView loggedInLayoutArrow;
private ImageView loggedin_nav_back;
private View loginLayout;
private ImageView lottieAnimationView;
private RecyclerViewAdapter mAdapter;
private AlertDialog mAlertDialog;
private AdManagerAdView mBannerAdView;
private CastContext mCastContext;
private CastSession mCastSession;
private DrawerLayout mDrawerLayout;
private EPGProgramsData mEPGProgramsData;
private EPGUserChannels mEPGUserChannels;
private Drawable mExternalRouteEnabledDrawable;
private float mLastAlpha;
private LottieDrawable mLottieDrawable;
private LottieDrawable mLottieDrawable2;
public List<Menu> mMenuList;
private OrientationUtils mOrientationUtils;
private BroadcastReceiver mPIPReceiver;
private Carousel mPartnerRecyclerView;
public Fragment mPlayerFragment;
private FrameLayout mPlayerFragmentContainer;
private Carousel mRecyclerView;
private boolean mRegistered;
private SessionManager mSessionManager;
private OfflineDownloadData mTargetPath;
private UpNextFragment mUpNextFragment;
private FrameLayout mViewAllFragmentContainer;
public WatchWhileLayout mWatchWhileLayout;
private RelativeLayout main_layout;
private CustomMaterialSearchView materialSearchView;
private RelativeLayout mbottomLayout;
private RecyclerView menuListRecyclerView;
private ImageView navBackImage;
private ImageView navMenuUserProfileIcon;
public NonceLoader nonceLoader;
private PartnerAutoplayBannerModel partnerAutoplayBannerModel;
private AppCompatButton payButton;
private ImageView payImage;
@RequiresApi
public PictureInPictureParams.Builder pictureInPictureParamsBuilder;
public PreferenceManager preferenceManager;
private String previousSelectedTab;
private ImageView rightArrow;
private Fragment searchFragment;
private Preferences sharedPref;
private AppCompatButton signoutButton;
private List<SubMenu> subMenuList1;
private AppCompatImageView subscribe_button_iv;
private ImageView subscribedLottieAnimationView;
private AppCompatImageView subscribed_button_iv;
private RelativeLayout subscribed_container_lottie;
private ImageView subscriber_menu;
private ImageView swagUpload;
public TabLayout tabLayout;
private ActionBarDrawerToggle toggle;
private TextView toobar_payText;
public Toolbar toolbar;
private RelativeLayout toolbarLogoLayout;
private ImageView toolbarSearchIcon;
private TextView toolbar_languageText;
private AppCompatImageView toolbar_logo;
private TextView toolbar_title;
private LinearLayout torcai_footer_adRL;
private TextView tv_profile;
private TextView userEmailTV;
private ImageView userIcon;
private TextView userIconText;
private TextView userNameTV;
private ImageView userProfileIcon;
private LinearLayout userProfilesLayout;
private TextView user_name;
private TextView versionTextView;
private ViewPagerFragment viewPagerFragment;
public Card item = null;
public Context context = null;
public String bottomTabSelected = "home";
public boolean isViewPagerFragment = false;
public int bottomTabSelectedPosition = -1;
public int subTabSelectedPosition = -1;
public boolean isFavouriteClicked = false;
public boolean isDetailsPage = false;
private int playerCurrentState = 0;
private boolean isfromSignup = false;
private String myBingeList = "My BingeList";
private ButtonType mButtonType = ButtonType.NONE;
private List<String> unfavList = new ArrayList();
public boolean isDetailsFragment = false;
public String currentItemtargerPath = "";
public boolean isViewAllBottomSheetDisplayed = false;
public String navigationFrom = "";
public boolean doSectionsRefresh = false;
public boolean doListRefresh = false;
public boolean doViewpagerCacheRefresh = false;
public boolean doEPGCacheRefresh = false;
public boolean doEPGRefreshOnChangeInPlayer = false;
public boolean isEPGRefreshed = false;
public boolean backToExit = false;
private HashMap<String, Boolean> epgDataTracker = new HashMap<>();
private final SessionManagerListener mSessionManagerListener = new SessionManagerListenerImpl();
private boolean hasPlayServices = false;
public boolean isSessionEnding = false;
private long seekValue = 0;
private boolean isSearchClicked = false;
private String queryString = "";
private String currentSelectedTab = AnalyticsUtils.ATTRIBUTE_VALUE_SOURCE_HOME_PAGE;
public String playerScreenSource = "";
private boolean isClicked = false;
private String isNowPlayingPath = "";
public String selectedTab = "home";
public String selectedTabForCT = "home";
private boolean isChromeCastMinimized = false;
private boolean isLanguageFilterApplied = false;
private String mStreamPollKey = "";
public int mPortraitWidthInPixels = 0;
public boolean signinPopupVisible = false;
private boolean isComingFromNotification = false;
private boolean isComingFromCancelNotification = false;
public boolean selectHomeOnPopFromWebView = false;
public String tabname = "";
private boolean isSubMenuTab = false;
public int bottomTabPosition = 0;
private String partnerpage_path = "";
private String mPlay = "play";
private String mPause = "pause";
private String bannerAdUnit = "";
private HashMap<String, AdUrlResponse> adsHashMap = new HashMap<>();
private boolean canceledPinDialog = false;
public boolean isProfilesOpen = false;
public boolean isBackgroundRequestCompleted = true;
public boolean isBannerAvailable = false;
private int numtaps = 0;
private Long lastTimeTapMs = 0L;
private String sectionCode = "";
public boolean exitButtonClicked = false;
public String templateCode = "";
public boolean exitPopupEnabled = false;
public boolean playerClosed = false;
private String weblink = "";
private boolean isPrepaidRenewLottieVisible = false;
private boolean lowerDevices = false;
private TabLayout.OnTabSelectedListener bottomMenuTabListener = new TabLayout.OnTabSelectedListener() {
public void onTabReselected(TabLayout.Tab tab) {
CustomLog.e("onTabSelectListener2", "onTabReselected");
if (!(FusionViliteMainActivity.this.getSupportFragmentManager().findFragmentById(R.id.contentframe) instanceof ViewPagerFragment) || FusionViliteMainActivity.this.viewPagerFragment == null) {
return;
}
FusionViliteMainActivity.this.viewPagerFragment.setCurrentTab(FusionViliteMainActivity.this.getMenuPosition("home"));
}
public void onTabSelected(TabLayout.Tab tab) {
List<Menu> list;
List<Menu> list2;
OTTApplication.FAV_FROM_TAB = false;
boolean z = !TextUtils.isEmpty(FusionViliteMainActivity.this.previousSelectedTab);
if (tab != null && tab.getTag() != null) {
FusionViliteMainActivity.this.setVisibilityOfTabIndicator(tab, 0);
FusionViliteMainActivity.this.restrictBackgroundActions(true);
FusionViliteMainActivity.this.main_layout.setBackgroundColor(FusionViliteMainActivity.this.getResources().getColor(R.color.home_bg_color));
String obj = tab.getTag().toString();
FusionViliteMainActivity fusionViliteMainActivity = FusionViliteMainActivity.this;
fusionViliteMainActivity.previousSelectedTab = fusionViliteMainActivity.bottomTabSelected;
FusionViliteMainActivity fusionViliteMainActivity2 = FusionViliteMainActivity.this;
fusionViliteMainActivity2.bottomTabSelected = OTTApplication.tabName;
fusionViliteMainActivity2.bottomTabSelectedPosition = tab.getPosition();
int menuPosition = FusionViliteMainActivity.this.getMenuPosition(obj);
UiUtils.isNetworkConnected(FusionViliteMainActivity.this);
FusionViliteMainActivity.this.enableToolBarLogo(false);
if (FusionViliteMainActivity.this.lowerDevices && !tab.getTag().toString().equalsIgnoreCase("plans")) {
FusionViliteMainActivity.this.tabLayout.getTabAt(menuPosition).getIcon().setColorFilter(FusionViliteMainActivity.this.getResources().getColor(R.color.vi_lsdk_brand_color), PorterDuff.Mode.SRC_IN);
((TextView) FusionViliteMainActivity.this.tabLayout.getTabAt(menuPosition).getCustomView().findViewById(R.id.tabContent)).setTextColor(ContextCompat.getColor(FusionViliteMainActivity.this, R.color.white));
}
View customView = tab.getCustomView();
int i2 = R.id.tab_icon;
((ImageView) customView.findViewById(i2)).setColorFilter(FusionViliteMainActivity.this.getResources().getColor(R.color.vi_lsdk_brand_color));
View customView2 = FusionViliteMainActivity.this.tabLayout.getTabAt(menuPosition).getCustomView();
int i3 = R.id.tabContent;
TextView textView = (TextView) customView2.findViewById(i3);
InAppNotificationListener inAppNotificationListener = FusionViliteMainActivity.this;
int i4 = R.color.white;
textView.setTextColor(ContextCompat.getColor(inAppNotificationListener, i4));
if (tab.getTag().toString().equalsIgnoreCase("after_dark")) {
((ImageView) tab.getCustomView().findViewById(i2)).setImageDrawable(FusionViliteMainActivity.this.getResources().getDrawable(R.drawable.ic_after_dark));
((ImageView) tab.getCustomView().findViewById(i2)).setColorFilter((ColorFilter) null);
}
if (tab.getTag().toString().equalsIgnoreCase("plans")) {
((ImageView) tab.getCustomView().findViewById(i2)).setColorFilter((ColorFilter) null);
((TextView) tab.getCustomView().findViewById(i3)).setTextColor(ContextCompat.getColor(FusionViliteMainActivity.this, i4));
}
List<Menu> list3 = FusionViliteMainActivity.this.mMenuList;
if (list3 != null && list3.get(menuPosition) != null && FusionViliteMainActivity.this.mMenuList.get(menuPosition).getDisplayText() != null) {
MyRecoManager.getInstance().setTAB_NAME(FusionViliteMainActivity.this.bottomTabSelected);
}
if (!Configurations.showMenuWebView || (list2 = FusionViliteMainActivity.this.mMenuList) == null || list2.get(menuPosition) == null || FusionViliteMainActivity.this.mMenuList.get(menuPosition).getParams() == null || FusionViliteMainActivity.this.mMenuList.get(menuPosition).getParams().getTargetType() == null || !(FusionViliteMainActivity.this.mMenuList.get(menuPosition).getParams().getTargetType().equalsIgnoreCase("externalbrowser") || FusionViliteMainActivity.this.mMenuList.get(menuPosition).getParams().getTargetType().equalsIgnoreCase("internalbrowser"))) {
if (Configurations.showMenuWebView && (list = FusionViliteMainActivity.this.mMenuList) != null) {
list.get(menuPosition);
}
obj.getClass();
switch (obj) {
case "account_m":
case "account":
case "settings":
FusionViliteMainActivity.this.launchAccountPage();
if (FusionViliteMainActivity.this.currentSelectedTab != null && !FusionViliteMainActivity.this.currentSelectedTab.equalsIgnoreCase(AnalyticsUtils.ATTRIBUTE_VALUE_SOURCE_ACCOUNT_PAGE)) {
HashMap hashMap = new HashMap();
hashMap.put(AnalyticsUtils.ATTRIBUTE_SOURCE_MENU, FusionViliteMainActivity.this.currentSelectedTab);
CustomLog.e("TAG", "#ATTRIBUTE_SOURCE_MENU : " + FusionViliteMainActivity.this.currentSelectedTab);
AnalyticsUtils.getInstance().trackAnalyticsEvent(ScreenType.HOME, null, null, null, AnalyticsUtils.EVENT_PAGE_ACCOUNT, null, hashMap);
}
FusionViliteMainActivity.this.currentSelectedTab = AnalyticsUtils.ATTRIBUTE_VALUE_SOURCE_ACCOUNT_PAGE;
break;
case "home_m":
case "home_mobile":
case "home":
if (z) {
CleverTap.moviesEventTabViewed("Home");
}
if (FusionViliteMainActivity.this.isSubMenusAvailable(obj)) {
if (FusionViliteMainActivity.this.iV_Gradient_top != null) {
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) FusionViliteMainActivity.this.iV_Gradient_top.getLayoutParams();
layoutParams.topMargin = (int) FusionViliteMainActivity.this.getResources().getDimension(R.dimen._40sdp);
FusionViliteMainActivity.this.iV_Gradient_top.setLayoutParams(layoutParams);
}
MyRecoManager.getInstance().setTAB_NAME("");
FusionViliteMainActivity.this.viewPagerFragment = new ViewPagerFragment();
FusionViliteMainActivity fusionViliteMainActivity3 = FusionViliteMainActivity.this;
fusionViliteMainActivity3.clickListener = fusionViliteMainActivity3.viewPagerFragment;
FusionViliteMainActivity fusionViliteMainActivity4 = FusionViliteMainActivity.this;
fusionViliteMainActivity4.loadFragment(fusionViliteMainActivity4.viewPagerFragment, obj);
} else {
Fragment findFragmentByTag = FusionViliteMainActivity.this.getSupportFragmentManager().findFragmentByTag("HomeFragment".concat(obj));
if (findFragmentByTag != null) {
FusionViliteMainActivity.isFragmentSelected = true;
FusionViliteMainActivity.this.loadFragment(findFragmentByTag, obj);
} else {
Bundle bundle = new Bundle();
HomeFragment homeFragment = new HomeFragment();
homeFragment.setViewScrollListener(FusionViliteMainActivity.this);
bundle.putString(NavigationConstants.TITLE, tab.getText() != null ? tab.getText().toString() : "");
bundle.putString(NavigationConstants.MENU_ITEM_CODE, FusionViliteMainActivity.this.getBottoMenuTargetPath(obj));
bundle.putInt(NavigationConstants.MENU_ITEM_POSITION, menuPosition);
bundle.putString(NavigationConstants.NAV_FROM_PATH, tab.getText() != null ? tab.getText().toString() : "");
homeFragment.setArguments(bundle);
FusionViliteMainActivity.this.loadFragment(homeFragment, obj);
}
}
if (FusionViliteMainActivity.this.currentSelectedTab != null && !FusionViliteMainActivity.this.currentSelectedTab.equalsIgnoreCase(AnalyticsUtils.ATTRIBUTE_VALUE_SOURCE_HOME_PAGE)) {
HashMap hashMap2 = new HashMap();
hashMap2.put(AnalyticsUtils.ATTRIBUTE_SOURCE_MENU, FusionViliteMainActivity.this.currentSelectedTab);
CustomLog.e("TAG", "#ATTRIBUTE_SOURCE_MENU : " + FusionViliteMainActivity.this.currentSelectedTab);
AnalyticsUtils.getInstance().trackAnalyticsEvent(ScreenType.HOME, null, null, null, AnalyticsUtils.EVENT_PAGE_HOME, null, hashMap2);
}
FusionViliteMainActivity.this.currentSelectedTab = AnalyticsUtils.ATTRIBUTE_VALUE_SOURCE_HOME_PAGE;
break;
case "tvguide":
case "guide":
case "tv_guide":
Bundle bundle2 = new Bundle();
EPGFragment ePGFragment = new EPGFragment();
bundle2.putString(NavigationConstants.TITLE, tab.getText() != null ? tab.getText().toString() : "");
bundle2.putString(NavigationConstants.MENU_ITEM_CODE, FusionViliteMainActivity.this.getBottoMenuTargetPath(obj));
bundle2.putInt(NavigationConstants.MENU_ITEM_POSITION, menuPosition);
bundle2.putString(NavigationConstants.NAV_FROM_PATH, tab.getText() != null ? tab.getText().toString() : "");
ePGFragment.setArguments(bundle2);
FusionViliteMainActivity.this.loadFragment(ePGFragment, obj);
if (FusionViliteMainActivity.this.currentSelectedTab != null && !FusionViliteMainActivity.this.currentSelectedTab.equalsIgnoreCase(AnalyticsUtils.ATTRIBUTE_VALUE_SOURCE_GUIDE_PAGE)) {
HashMap hashMap3 = new HashMap();
hashMap3.put(AnalyticsUtils.ATTRIBUTE_SOURCE_MENU, FusionViliteMainActivity.this.currentSelectedTab);
CustomLog.e("TAG", "#ATTRIBUTE_SOURCE_MENU : " + FusionViliteMainActivity.this.currentSelectedTab);
AnalyticsUtils.getInstance().trackAnalyticsEvent(ScreenType.GUIDE, null, null, null, AnalyticsUtils.EVENT_PAGE_GUIDE, null, hashMap3);
}
FusionViliteMainActivity.this.currentSelectedTab = AnalyticsUtils.ATTRIBUTE_VALUE_SOURCE_GUIDE_PAGE;
break;
case "search":
case "lsdk_search":
MyRecoManager.getInstance().setTAB_NAME("");
if (FusionViliteMainActivity.this.viewPagerFragment != null) {
FusionViliteMainActivity.this.viewPagerFragment.anytabselected = "";
}
FusionViliteMainActivity.this.bottomTabSelected = "Search";
CleverTap.moviesEventTabViewed("Search");
MyRecoManager.getInstance().setTAB_NAME("Search");
FusionViliteMainActivity.this.isSearchClicked = true;
FusionViliteMainActivity.this.searchPageNavigation();
break;
case "plans":
String targetPath = FusionViliteMainActivity.this.mMenuList.get(menuPosition).getTargetPath();
FusionViliteMainActivity fusionViliteMainActivity5 = FusionViliteMainActivity.this;
fusionViliteMainActivity5.selectHomeOnPopFromWebView = true;
fusionViliteMainActivity5.launchWebviewPlansPage(null, targetPath, "hamburger menu subscribe");
break;
case "catchup":
if (FusionViliteMainActivity.this.currentSelectedTab != null && !FusionViliteMainActivity.this.currentSelectedTab.equalsIgnoreCase(AnalyticsUtils.ATTRIBUTE_VALUE_SOURCE_CATCHUP_PAGE)) {
HashMap hashMap4 = new HashMap();
hashMap4.put(AnalyticsUtils.ATTRIBUTE_SOURCE_MENU, FusionViliteMainActivity.this.currentSelectedTab);
CustomLog.e("TAG", "#ATTRIBUTE_SOURCE_MENU : " + FusionViliteMainActivity.this.currentSelectedTab);
AnalyticsUtils.getInstance().trackAnalyticsEvent(ScreenType.CATCHUP, null, null, null, AnalyticsUtils.EVENT_PAGE_CATCHUP, null, hashMap4);
}
FusionViliteMainActivity.this.currentSelectedTab = AnalyticsUtils.ATTRIBUTE_VALUE_SOURCE_CATCHUP_PAGE;
if (!FusionViliteMainActivity.this.isSubMenusAvailable(obj)) {
Fragment findFragmentByTag2 = FusionViliteMainActivity.this.getSupportFragmentManager().findFragmentByTag("HomeFragment".concat(obj));
if (findFragmentByTag2 == null) {
Bundle bundle3 = new Bundle();
HomeFragment homeFragment2 = new HomeFragment();
homeFragment2.setViewScrollListener(FusionViliteMainActivity.this);
bundle3.putString(NavigationConstants.TITLE, tab.getText() != null ? tab.getText().toString() : "");
bundle3.putString(NavigationConstants.MENU_ITEM_CODE, FusionViliteMainActivity.this.getBottoMenuTargetPath(obj));
bundle3.putInt(NavigationConstants.MENU_ITEM_POSITION, menuPosition);
bundle3.putString(NavigationConstants.NAV_FROM_PATH, tab.getText() != null ? tab.getText().toString() : "");
homeFragment2.setArguments(bundle3);
FusionViliteMainActivity.this.loadFragment(homeFragment2, obj);
break;
} else {
FusionViliteMainActivity.this.loadFragment(findFragmentByTag2, obj);
break;
}
} else {
if (FusionViliteMainActivity.this.iV_Gradient_top != null) {
RelativeLayout.LayoutParams layoutParams2 = (RelativeLayout.LayoutParams) FusionViliteMainActivity.this.iV_Gradient_top.getLayoutParams();
layoutParams2.topMargin = (int) FusionViliteMainActivity.this.getResources().getDimension(R.dimen._40sdp);
FusionViliteMainActivity.this.iV_Gradient_top.setLayoutParams(layoutParams2);
}
FusionViliteMainActivity.this.viewPagerFragment = new ViewPagerFragment();
FusionViliteMainActivity fusionViliteMainActivity6 = FusionViliteMainActivity.this;
fusionViliteMainActivity6.clickListener = fusionViliteMainActivity6.viewPagerFragment;
FusionViliteMainActivity fusionViliteMainActivity7 = FusionViliteMainActivity.this;
fusionViliteMainActivity7.loadFragment(fusionViliteMainActivity7.viewPagerFragment, obj);
break;
}
break;
case "favourites":
MyRecoManager.getInstance().setTAB_NAME("");
case "after_dark":
if (FusionViliteMainActivity.this.currentSelectedTab != null && !FusionViliteMainActivity.this.currentSelectedTab.equalsIgnoreCase(AnalyticsUtils.ATTRIBUTE_VALUE_SOURCE_AFTER_DARK)) {
HashMap hashMap5 = new HashMap();
hashMap5.put(AnalyticsUtils.ATTRIBUTE_SOURCE_MENU, FusionViliteMainActivity.this.currentSelectedTab);
CustomLog.e("TAG", "#ATTRIBUTE_SOURCE_MENU : " + FusionViliteMainActivity.this.currentSelectedTab);
AnalyticsUtils.getInstance().trackAnalyticsEvent(ScreenType.AFTER_DARK, null, null, null, AnalyticsUtils.EVENT_PAGE_AFTER_DARK, null, hashMap5);
}
FusionViliteMainActivity.this.currentSelectedTab = AnalyticsUtils.ATTRIBUTE_VALUE_SOURCE_AFTER_DARK;
Bundle bundle4 = new Bundle();
HomeFragment homeFragment3 = new HomeFragment();
homeFragment3.setViewScrollListener(FusionViliteMainActivity.this);
bundle4.putString(NavigationConstants.TITLE, "" + ((Object) tab.getText()));
bundle4.putString(NavigationConstants.MENU_ITEM_CODE, FusionViliteMainActivity.this.getBottoMenuTargetPath(obj));
bundle4.putInt(NavigationConstants.MENU_ITEM_POSITION, menuPosition);
bundle4.putString(NavigationConstants.NAV_FROM_PATH, "" + ((Object) tab.getText()));
homeFragment3.setArguments(bundle4);
FusionViliteMainActivity.this.loadFragment(homeFragment3, obj);
break;
default:
if (obj.equalsIgnoreCase("favourites_mobile") || obj.equalsIgnoreCase("favourites")) {
OTTApplication.FAV_FROM_TAB = true;
}
FusionViliteMainActivity fusionViliteMainActivity8 = FusionViliteMainActivity.this;
fusionViliteMainActivity8.selectedTabForCT = obj;
if (fusionViliteMainActivity8.isSubMenusAvailable(tab.getTag().toString())) {
if (FusionViliteMainActivity.this.iV_Gradient_top != null) {
RelativeLayout.LayoutParams layoutParams3 = (RelativeLayout.LayoutParams) FusionViliteMainActivity.this.iV_Gradient_top.getLayoutParams();
layoutParams3.topMargin = (int) FusionViliteMainActivity.this.getResources().getDimension(R.dimen._40sdp);
FusionViliteMainActivity.this.iV_Gradient_top.setLayoutParams(layoutParams3);
}
FusionViliteMainActivity.isFragmentSelected = false;
FusionViliteMainActivity.this.viewPagerFragment = new ViewPagerFragment();
FusionViliteMainActivity fusionViliteMainActivity9 = FusionViliteMainActivity.this;
fusionViliteMainActivity9.clickListener = fusionViliteMainActivity9.viewPagerFragment;
FusionViliteMainActivity fusionViliteMainActivity10 = FusionViliteMainActivity.this;
fusionViliteMainActivity10.loadFragment(fusionViliteMainActivity10.viewPagerFragment, obj);
} else {
Fragment findFragmentByTag3 = FusionViliteMainActivity.this.getSupportFragmentManager().findFragmentByTag("HomeFragment".concat(obj));
FusionViliteMainActivity.isFragmentSelected = true;
if (OTTApplication.FAV_FROM_TAB || findFragmentByTag3 == null) {
Bundle bundle5 = new Bundle();
HomeFragment homeFragment4 = new HomeFragment();
homeFragment4.setViewScrollListener(FusionViliteMainActivity.this);
bundle5.putString(NavigationConstants.TITLE, "" + ((Object) tab.getText()));
bundle5.putString(NavigationConstants.MENU_ITEM_CODE, FusionViliteMainActivity.this.getBottoMenuTargetPath(obj));
bundle5.putInt(NavigationConstants.MENU_ITEM_POSITION, menuPosition);
bundle5.putString(NavigationConstants.NAV_FROM_PATH, "" + ((Object) tab.getText()));
homeFragment4.setArguments(bundle5);
FusionViliteMainActivity.this.loadFragment(homeFragment4, obj);
} else {
FusionViliteMainActivity.this.loadFragment(findFragmentByTag3, obj);
}
}
if (FusionViliteMainActivity.this.currentSelectedTab != null) {
if (!FusionViliteMainActivity.this.currentSelectedTab.equalsIgnoreCase(AnalyticsUtils.ATTRIBUTE_VALUE_SOURCE_DEFAULT + "_" + tab.getTag().toString())) {
HashMap hashMap6 = new HashMap();
hashMap6.put(AnalyticsUtils.ATTRIBUTE_SOURCE_MENU, FusionViliteMainActivity.this.currentSelectedTab);
CustomLog.e("TAG", "#ATTRIBUTE_SOURCE_MENU : " + FusionViliteMainActivity.this.currentSelectedTab);
AnalyticsUtils.getInstance().trackAnalyticsEvent(ScreenType.NONE, null, null, null, AnalyticsUtils.EVENT_PAGE_DEFAULT, null, hashMap6);
}
}
FusionViliteMainActivity.this.currentSelectedTab = AnalyticsUtils.ATTRIBUTE_VALUE_SOURCE_DEFAULT + "_" + tab.getTag().toString();
break;
}
} else {
Bundle bundle6 = new Bundle();
WebViewFragment webViewFragment = new WebViewFragment();
bundle6.putParcelable("Params", FusionViliteMainActivity.this.mMenuList.get(menuPosition).getParams());
webViewFragment.setArguments(bundle6);
FusionViliteMainActivity.this.loadFragment(webViewFragment, "");
}
}
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
FusionViliteMainActivity.this.restrictBackgroundActions(false);
}
}, 100L);
}
public void onTabUnselected(TabLayout.Tab tab) {
FusionViliteMainActivity.this.setVisibilityOfTabIndicator(tab, 4);
if (tab.getTag().toString().equalsIgnoreCase("plans")) {
((TextView) tab.getCustomView().findViewById(R.id.tabContent)).setTextColor(FusionViliteMainActivity.this.getResources().getColor(R.color.white));
return;
}
View customView = tab.getCustomView();
int i2 = R.id.tab_icon;
ImageView imageView = (ImageView) customView.findViewById(i2);
Resources resources = FusionViliteMainActivity.this.getResources();
int i3 = R.color.tab_un_selected_color;
imageView.setColorFilter(resources.getColor(i3));
View customView2 = tab.getCustomView();
int i4 = R.id.tabContent;
((TextView) customView2.findViewById(i4)).setTextColor(FusionViliteMainActivity.this.getResources().getColor(i3));
if (tab.getTag().toString().equalsIgnoreCase("after_dark")) {
((ImageView) tab.getCustomView().findViewById(i2)).setImageDrawable(FusionViliteMainActivity.this.getResources().getDrawable(R.drawable.ic_after_dark));
((TextView) tab.getCustomView().findViewById(i4)).setTextColor(FusionViliteMainActivity.this.getResources().getColor(i3));
}
}
};
private boolean isClick = false;
public Handler clickHandler = new Handler();
public Runnable isClickedRunnable = new Runnable() {
@Override
public void run() {
FusionViliteMainActivity.this.isClick = false;
}
};
private ExoPlayerFragment.VideoListener mVideoListner = new ExoPlayerFragment.VideoListener() {
@Override
public void onVideoStarted() {
FusionViliteMainActivity fusionViliteMainActivity = FusionViliteMainActivity.this;
fusionViliteMainActivity.updatePictureInPictureActions(R.drawable.ic_player_pause, fusionViliteMainActivity.mPause, 2, 2);
}
@Override
public void onVideoStopped() {
FusionViliteMainActivity fusionViliteMainActivity = FusionViliteMainActivity.this;
fusionViliteMainActivity.updatePictureInPictureActions(R.drawable.ic_player_play, fusionViliteMainActivity.mPlay, 1, 1);
}
};
public ActivityResultLauncher<ScanOptions> barcodeLauncher = registerForActivityResult(new ScanContract(), new ActivityResultCallback() {
public final void onActivityResult(Object obj) {
FusionViliteMainActivity.this.lambda$new$34((ScanIntentResult) obj);
}
});
public class AnonymousClass14 implements Runnable {
public final String val$finalLottieUrl;
public final Handler val$mHandler;
public AnonymousClass14(String str, Handler handler) {
this.val$finalLottieUrl = str;
this.val$mHandler = handler;
}
public void lambda$run$0(LottieComposition lottieComposition) {
if (lottieComposition != null) {
FusionViliteMainActivity.this.mLottieDrawable2.setComposition(lottieComposition);
}
}
@Override
public void run() {
final LottieComposition lottieComposition = (LottieComposition) LottieCompositionFactory.fromUrlSync(FusionViliteMainActivity.this, this.val$finalLottieUrl).getValue();
this.val$mHandler.postDelayed(new Runnable() {
@Override
public final void run() {
FusionViliteMainActivity.AnonymousClass14.this.lambda$run$0(lottieComposition);
}
}, 200L);
}
}
public class AnonymousClass34 implements MediaCatalogManager.MediaCatalogCallback<BottomTemplateInfo> {
public AnonymousClass34() {
}
public void lambda$onSuccess$0(LottieComposition lottieComposition) {
if (lottieComposition == null || FusionViliteMainActivity.this.mLottieDrawable == null) {
return;
}
FusionViliteMainActivity.this.mLottieDrawable.setComposition(lottieComposition);
}
public static void lambda$onSuccess$1(Throwable th) {
CustomLog.e("LottieError", "Failed to load Lottie composition" + th);
}
public void lambda$onSuccess$2(LottieTask lottieTask) {
if (lottieTask != null) {
lottieTask.addListener(new LottieListener() {
public final void onResult(Object obj) {
FusionViliteMainActivity.AnonymousClass34.this.lambda$onSuccess$0((LottieComposition) obj);
}
}).addFailureListener(new LottieListener() {
public final void onResult(Object obj) {
FusionViliteMainActivity.AnonymousClass34.lambda$onSuccess$1((Throwable) obj);
}
});
}
}
public void lambda$onSuccess$3(String str, Handler handler) {
final LottieTask fromUrl = LottieCompositionFactory.fromUrl(OTTApplication.getContext(), str, (String) null);
handler.postDelayed(new Runnable() {
@Override
public final void run() {
FusionViliteMainActivity.AnonymousClass34.this.lambda$onSuccess$2(fromUrl);
}
}, 200L);
}
public void lambda$onSuccess$4(final String str) {
if (FusionViliteMainActivity.this.mLottieDrawable != null) {
FusionViliteMainActivity.this.mLottieDrawable.cancelAnimation();
}
FusionViliteMainActivity.this.mLottieDrawable = new LottieDrawable();
final Handler handler = new Handler();
new Thread(new Runnable() {
@Override
public final void run() {
FusionViliteMainActivity.AnonymousClass34.this.lambda$onSuccess$3(str, handler);
}
}).start();
FusionViliteMainActivity.this.isPrepaidRenewLottieVisible = true;
FusionViliteMainActivity.this.mLottieDrawable.setRepeatCount(-1);
FusionViliteMainActivity.this.lottieAnimationView.setImageDrawable(FusionViliteMainActivity.this.mLottieDrawable);
FusionViliteMainActivity.this.mLottieDrawable.start();
FusionViliteMainActivity.this.container_lottie.setVisibility(0);
FusionViliteMainActivity.this.subscribed_container_lottie.setVisibility(8);
FusionViliteMainActivity.this.download_container_lottie.setVisibility(8);
FusionViliteMainActivity.this.gif_view.setVisibility(8);
}
@Override
public void onFailure(Error error) {
FusionViliteMainActivity.this.isPrepaidRenewLottieVisible = false;
if (error == null || !TextUtils.isEmpty(error.getMessage())) {
return;
}
CustomLog.e("onFailure", error.getMessage().toString());
}
@Override
public void onSuccess(BottomTemplateInfo bottomTemplateInfo) {
if (bottomTemplateInfo != null) {
final String target_button = (bottomTemplateInfo.getData() == null || TextUtils.isEmpty(bottomTemplateInfo.getData().getTarget_button())) ? "" : bottomTemplateInfo.getData().getTarget_button();
if (!TextUtils.isEmpty(bottomTemplateInfo.getData().getTarget_hyperlink()) && bottomTemplateInfo.getData().getTarget_hyperlink().contains(".json")) {
target_button = bottomTemplateInfo.getData().getTarget_hyperlink();
}
if (bottomTemplateInfo.getData() != null && !TextUtils.isEmpty(bottomTemplateInfo.getData().getTarget_subscribe())) {
FusionViliteMainActivity.this.weblink = bottomTemplateInfo.getData().getTarget_subscribe();
}
if (TextUtils.isEmpty(target_button)) {
return;
}
if (target_button.contains(".json")) {
new Handler().post(new Runnable() {
@Override
public final void run() {
FusionViliteMainActivity.AnonymousClass34.this.lambda$onSuccess$4(target_button);
}
});
return;
}
FusionViliteMainActivity.this.isPrepaidRenewLottieVisible = true;
Glide.with(FusionViliteMainActivity.this.getApplicationContext()).load(target_button).into(FusionViliteMainActivity.this.gif_view);
FusionViliteMainActivity.this.gif_container.setVisibility(0);
FusionViliteMainActivity.this.container_lottie.setVisibility(8);
FusionViliteMainActivity.this.download_container_lottie.setVisibility(8);
FusionViliteMainActivity.this.subscribed_container_lottie.setVisibility(8);
}
}
}
public class AnonymousClass53 implements UserManager.UserCallback<User> {
public final FusionViliteMainActivity this$0;
public final OttSDK val$ottSDK;
public final Preferences val$preferences;
@Override
public void onEmptySuccess() {
com.yupptv.ottsdk.managers.User.a.a(this);
}
@Override
public void onFailure(Error error) {
NavigationUtils.logKibanaError("FusionViliteMainActivity", "API", "/service/api/auth/user/info", "NA", "NA", "NA", f.a(error, new StringBuilder("")), error.getMessage());
}
@Override
public void onSuccess(User user) {
Fields fields = this.this$0.preferenceManager.getSystemFeaturesData().getSystemFeatures().getUserfields().getFields();
String age = (fields.getAge() == null || fields.getAge().trim().isEmpty()) ? "" : fields.getAge();
String gender = (fields.getGender() == null || fields.getGender().trim().isEmpty()) ? "" : fields.getGender();
if (((age.trim().isEmpty() || age.equals("0")) && (gender.trim().isEmpty() || gender.equals("0"))) || user == null) {
return;
}
if (user.getGender() == null || user.getGender().equalsIgnoreCase("") || user.getDob() == null || user.getDob().longValue() == 0) {
HashMap hashMap = new HashMap();
hashMap.put("msg1", "To Enjoy uninterrupted services");
hashMap.put("msg2", this.this$0.getResources().getString(R.string.age_gender_sub_title, "age and gender"));
if (user.getGender() == null || user.getGender().equalsIgnoreCase("")) {
hashMap.put("gender", gender);
}
if (user.getDob() == null || user.getDob().longValue() == 0) {
hashMap.put("age", age);
}
if ((age.equals("0") || age.equals("")) && user.getDob() == null && (user.getGender() == null || !user.getGender().isEmpty())) {
return;
}
if ((gender.equals("0") || gender.equals("")) && user.getGender() != null && user.getGender().equals("") && user.getDob() != null) {
return;
}
if (this.val$preferences.getAgeGenderPopUp().booleanValue() || ((age.equals("2") && user.getDob() == null) || (gender.equals("2") && user.getGender().isEmpty()))) {
NavigationUtils.showDialog((FragmentActivity) this.this$0, DialogType.UPDATE_AGE_DOB_DIALOG, hashMap, new DialogListener() {
@Override
public void itemClicked(boolean z, int i2, int i3) {
}
@Override
public void itemClicked(boolean r6, int r7, java.util.HashMap r8) {
throw new UnsupportedOperationException("Method not decompiled: com.yupptv.ott.FusionViliteMainActivity.AnonymousClass53.AnonymousClass1.itemClicked(boolean, int, java.util.HashMap):void");
}
});
}
}
}
}
class AnonymousClass63 implements UserManager.UserCallback<UserSubscriptionOffer> {
public final FusionViliteMainActivity this$0;
@Override
public void onEmptySuccess() {
com.yupptv.ottsdk.managers.User.a.a(this);
}
@Override
public void onFailure(Error error) {
NavigationUtils.logKibanaError("FusionViliteMainActivity", "API", "/service/api/auth/user/offers", "NA", "NA", "NA", f.a(error, new StringBuilder("")), error.getMessage());
this.this$0.hideProgressBar();
}
@Override
public void onSuccess(UserSubscriptionOffer userSubscriptionOffer) {
this.this$0.hideProgressBar();
if (userSubscriptionOffer != null) {
this.this$0.showUserSubscriptionOfferDialog(userSubscriptionOffer);
}
}
}
public static class GetAndroidAdvertisingID extends AsyncTask<Void, Void, Void> {
public Context mContext;
public GetAndroidAdvertisingID(Context context) {
this.mContext = context;
}
@Override
public Void doInBackground(Void... voidArr) {
AdvertisingIdClient.Info info;
String str;
Context context = this.mContext;
if (context != null) {
try {
info = AdvertisingIdClient.getAdvertisingIdInfo(context);
} catch (GooglePlayServicesNotAvailableException | GooglePlayServicesRepairableException | Exception unused) {
info = null;
}
if (!info.isLimitAdTrackingEnabled()) {
str = info.getId();
Preferences.instance(this.mContext).setStringPreference("pref_key_advertising_id", str);
}
str = null;
Preferences.instance(this.mContext).setStringPreference("pref_key_advertising_id", str);
}
return null;
}
}
public interface ItemClickListener {
void onClick(View view, int i2, Object obj, int i3, List<Menu> list);
}
public class MyRunnableList implements Runnable {
public List<String> strings;
public final FusionViliteMainActivity this$0;
@Override
public void run() {
this.this$0.adapter.updateData(this.strings);
this.this$0.materialSearchView.setAdapter(this.this$0.adapter);
}
}
public class SessionManagerListenerImpl implements SessionManagerListener {
private SessionManagerListenerImpl() {
}
public void onSessionEnded(Session session, int i2) {
CustomLog.e("TAG" + session.isDisconnected(), "onSessionEnded " + i2);
try {
if (FusionViliteMainActivity.this.mPlayerFragment instanceof ExoPlayerFragment) {
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
((ExoPlayerFragment) FusionViliteMainActivity.this.mPlayerFragment).onDismissChromeCast();
}
}, 500L);
}
} catch (Exception unused) {
}
}
public void onSessionEnding(Session session) {
CustomLog.e("chromeCast" + session.isDisconnected(), "onSessionEnding ");
FusionViliteMainActivity fusionViliteMainActivity = FusionViliteMainActivity.this;
fusionViliteMainActivity.isSessionEnding = true;
fusionViliteMainActivity.setButtonType(ButtonType.NONE);
FusionViliteMainActivity.this.updateLocalPlayer();
}
public void onSessionResumeFailed(Session session, int i2) {
CustomLog.e("chromeCast", "onSessionResumeFailed");
if (FusionViliteMainActivity.this.viewPagerFragment != null) {
FusionViliteMainActivity.this.viewPagerFragment.updateBottomPadding(0);
}
}
public void onSessionResumed(Session session, boolean z) {
FusionViliteMainActivity.this.invalidateOptionsMenu();
FusionViliteMainActivity.this.addCastSessionListener();
}
public void onSessionResuming(Session session, String str) {
}
public void onSessionStartFailed(Session session, int i2) {
CustomLog.e("chromeCast" + session.isDisconnected(), "onSessionStartFailed ");
}
public void onSessionStarted(Session session, String str) {
CustomLog.e("chromeCast", "onSessionStarted");
FusionViliteMainActivity.this.invalidateOptionsMenu();
FusionViliteMainActivity fusionViliteMainActivity = FusionViliteMainActivity.this;
fusionViliteMainActivity.mCastSession = fusionViliteMainActivity.mCastContext.getSessionManager().getCurrentCastSession();
if (FusionViliteMainActivity.this.mCastSession.isConnected()) {
FusionViliteMainActivity.this.exitMiniPlayer();
Fragment fragment = FusionViliteMainActivity.this.mPlayerFragment;
if (fragment != null) {
((ExoPlayerFragment) fragment).hideDocPlayer();
}
FusionViliteMainActivity.this.showCastMiniController(true);
}
FusionViliteMainActivity fusionViliteMainActivity2 = FusionViliteMainActivity.this;
fusionViliteMainActivity2.isSessionEnding = false;
fusionViliteMainActivity2.addCastSessionListener();
}
public void onSessionStarting(Session session) {
}
public void onSessionSuspended(Session session, int i2) {
CustomLog.e("chromeCast", "onSessionSuspended");
}
}
public interface ViewPagerClickListener {
void onClick(View view, int i2, Object obj);
}
static {
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
isActivityRestarted = false;
isShowCaseToolTipShown = false;
disply_lang = "";
userId = "";
}
public void Refresh() {
OTTApplication.getInstance(this).launchViLite();
finish();
}
private void UnFavouriteSelectedItems() {
List<String> list = this.unfavList;
if (list == null || list.size() <= 0) {
return;
}
showProgressBar();
String str = "";
for (int i2 = 0; i2 < this.unfavList.size(); i2++) {
StringBuilder a = a.a(str);
a.append(this.unfavList.get(i2));
str = a.toString();
if (i2 != this.unfavList.size() - 1) {
str = str + ",";
}
}
if (OttSDK.getInstance() != null) {
OttSDK.getInstance().getUserManager().removeUserFavourite(str, new UserManager.UserCallback<String>() {
@Override
public void onEmptySuccess() {
com.yupptv.ottsdk.managers.User.a.a(this);
}
@Override
public void onFailure(Error error) {
NavigationUtils.logKibanaError("FusionViliteMainActivity", "API", "/service/api/auth/user/favourite/item", "NA", "NA", "NA", f.a(error, new StringBuilder("")), error.getMessage());
FusionViliteMainActivity.this.hideProgressBar();
if (FusionViliteMainActivity.this == null) {
return;
}
CustomLog.e("HomeFragment", error.getMessage());
}
@Override
public void onSuccess(String str2) {
FusionViliteMainActivity fusionViliteMainActivity = FusionViliteMainActivity.this;
if (fusionViliteMainActivity == null) {
return;
}
fusionViliteMainActivity.trackEvents(AnalyticsUtils.EVENT_FAVOURITES, 0, null);
FusionViliteMainActivity.this.hideProgressBar();
CustomLog.e("HomeFragment", FusionViliteMainActivity.this.getResources().getString(R.string.favourite_add_success));
FusionViliteMainActivity.this.unfavList.clear();
FusionViliteMainActivity.this.favouritesActionMenuLayout.setVisibility(8);
FusionViliteMainActivity.this.refreshWatchlist();
}
});
}
}
private void actionAfterSubscription() {
if (OTTApplication.SUBSCRIPTION_STATUS_SUCCESS || OTTApplication.IS_FROM_AFTER_WEB_VIEW_FINISH) {
if (!OTTApplication.IS_FROM_DETAILS_PAGE) {
OTTApplication.SUBSCRIPTION_STATUS_SUCCESS = false;
OTTApplication.IS_FROM_AFTER_WEB_VIEW_FINISH = false;
finish();
OTTApplication.getInstance(this).refreshAfterSubscription();
return;
}
if (!(OTTApplication.item instanceof Card)) {
updateSliderMenu();
return;
}
OTTApplication.IS_FROM_DETAILS_PAGE = false;
OTTApplication.SUBSCRIPTION_STATUS_SUCCESS = false;
finish();
OTTApplication.getInstance(this).launchContentDeeplink(OTTApplication.context, ((Card) OTTApplication.item).getTarget().getPath());
}
}
private void activateProfile(final User.ProfileParentalDetails profileParentalDetails) {
if (OTTApplication.getContext() != null) {
AnalyticsUtils.getInstance().updateProfileToCleverTap(OTTApplication.getContext());
}
if (isClicked()) {
return;
}
setClicked(true);
this.clickHandler.postDelayed(this.isClickedRunnable, 1000L);
if (profileParentalDetails.getProfileLockActive() == null || !profileParentalDetails.getProfileLockActive().booleanValue()) {
showProgressBar();
if (OttSDK.getInstance() != null) {
OttSDK.getInstance().getUserManager().activateUserProfile(profileParentalDetails.getProfileId().intValue(), null, new UserManager.UserCallback<String>() {
@Override
public void onEmptySuccess() {
com.yupptv.ottsdk.managers.User.a.a(this);
}
@Override
public void onFailure(Error error) {
NavigationUtils.logKibanaError("FusionViliteMainActivity", "API", "/service/api/auth/activate/user/profile", "NA", "NA", "NA", f.a(error, new StringBuilder("")), error.getMessage());
CustomLog.d("DEBUG", "activate profile error : " + error.getMessage());
Toast.makeText((Context) this, (CharSequence) ("" + error.getMessage()), 1).show();
FusionViliteMainActivity.this.hideProgressBar();
}
@Override
public void onSuccess(String str) {
g.a("activate profile success : ", str, "DEBUG");
this.completeRefresher();
FusionViliteMainActivity.this.hideProgressBar();
}
});
return;
}
return;
}
HashMap hashMap = new HashMap();
hashMap.put("imageUrl", profileParentalDetails.getImageUrl() != null ? profileParentalDetails.getImageUrl() : "");
hashMap.put("profileName", profileParentalDetails.getName() != null ? profileParentalDetails.getName() : "");
NavigationUtils.showDialog((FragmentActivity) this, DialogType.USER_PROFILE_PASSCODE_DIALOG, hashMap, new DialogListener() {
@Override
public void itemClicked(boolean z, int i2, int i3) {
}
@Override
public void itemClicked(boolean z, int i2, HashMap hashMap2) {
if (z) {
String str = null;
if (hashMap2 != null && hashMap2.containsKey("PassCode")) {
str = (String) hashMap2.get("PassCode");
}
if (OttSDK.getInstance() != null) {
OttSDK.getInstance().getUserManager().activateUserProfile(profileParentalDetails.getProfileId().intValue(), str, new UserManager.UserCallback<String>() {
@Override
public void onEmptySuccess() {
com.yupptv.ottsdk.managers.User.a.a(this);
}
@Override
public void onFailure(Error error) {
NavigationUtils.logKibanaError("FusionViliteMainActivity", "API", "/service/api/auth/activate/user/profile", "NA", "NA", "NA", f.a(error, new StringBuilder("")), error.getMessage());
CustomLog.d("DEBUG", "activate profile error : " + error.getMessage());
Toast.makeText((Context) this, (CharSequence) ("" + error.getMessage()), 1).show();
}
@Override
public void onSuccess(String str2) {
g.a("activate profile success : ", str2, "DEBUG");
this.completeRefresher();
}
});
}
}
}
});
}
public void addCastSessionListener() {
CastSession currentCastSession = this.mSessionManager.getCurrentCastSession();
this.mCastSession = currentCastSession;
if (currentCastSession == null || currentCastSession.getRemoteMediaClient() == null) {
return;
}
this.mCastSession.getRemoteMediaClient().registerCallback(getRemoteMediaCallBack());
}
private void checkAndShowUserProfileDropdown() {
if (Constants.IS_USER_PROFILES_SUPPORTED) {
Fragment findFragmentById = getSupportFragmentManager().findFragmentById(R.id.contentframe);
if (findFragmentById instanceof ListFragment) {
((ListFragment) findFragmentById).showHideProfiles();
this.isProfilesOpen = !this.isProfilesOpen;
setArrowImage();
}
}
}
private void closeDrawerLayout(String str) {
if (this.preferenceManager == null) {
getPreferenceManager();
}
PreferenceManager preferenceManager = this.preferenceManager;
if (preferenceManager == null || preferenceManager.getLoggedUser() == null) {
return;
}
if (this.preferenceManager.getLoggedUser() == null && str != null && str.equalsIgnoreCase("my_library")) {
this.clickHandler.postDelayed(this.isClickedRunnable, 1000L);
return;
}
DrawerLayout drawerLayout = this.mDrawerLayout;
if (drawerLayout != null) {
drawerLayout.closeDrawers();
}
}
private void createDetailInfoDataRows(List<Content.DataRow> list, boolean z) {
char c;
this.detailInfoRelativeLayout.removeAllViews();
enableToolBarLogo(false);
for (int i2 = 0; i2 < list.size() + 1; i2++) {
LinearLayoutCompat linearLayoutCompat = new LinearLayoutCompat(this);
LinearLayoutCompat.LayoutParams layoutParams = new LinearLayoutCompat.LayoutParams(-1, -2);
layoutParams.setMargins(0, 0, 0, 0);
linearLayoutCompat.setLayoutParams(layoutParams);
linearLayoutCompat.setGravity(17);
linearLayoutCompat.setVisibility(4);
if (i2 == 0) {
linearLayoutCompat.addView(getDetailsTitleLayout(z));
this.detailInfoRelativeLayout.addView(linearLayoutCompat, i2);
} else {
List<Content.Elements> elements = list.get(i2 - 1).getElements();
int i3 = 0;
for (int i4 = 0; i4 < elements.size(); i4++) {
Content.Elements elements2 = elements.get(i4);
if (!elements2.getElementType().equalsIgnoreCase("text") || elements2.getElementSubtype().equalsIgnoreCase("title") || elements2.getElementSubtype().equalsIgnoreCase("rentalinfo") || elements2.getElementSubtype().equalsIgnoreCase("cast") || elements2.getElementSubtype().equalsIgnoreCase("crew") || elements2.getElementSubtype().equalsIgnoreCase("languageDisplayText") || elements2.getElementSubtype().equalsIgnoreCase("pgrating") || elements2.getElementSubtype().equalsIgnoreCase("imdb") || elements2.getElementSubtype().equalsIgnoreCase("availableIn")) {
if (elements2.getElementType().equalsIgnoreCase("marker")) {
if (elements2.getElementSubtype().equalsIgnoreCase("rating")) {
TextView textView = new TextView(this);
textView.setText(elements2.getData());
textView.setClickable(elements2.getIsClickable().booleanValue());
textView.setTextColor(ContextCompat.getColor(this, z ? R.color.details_header_movietext_color : R.color.details_header_othertext_color));
textView.setTypeface(ResourcesCompat.getFont(this, R.font.font_style_gotham_bold));
Resources resources = getResources();
int i5 = R.dimen.detail_text_padding_left;
textView.setPadding(UiUtils.getDimension(resources, i5), 0, UiUtils.getDimension(getResources(), i5), 0);
textView.setCompoundDrawablesWithIntrinsicBounds(R.drawable.rating_star, 0, 0, 0);
textView.setCompoundDrawablePadding(10);
textView.setTextSize(UiUtils.getDimension(getResources(), R.dimen.detail_rating_size));
textView.setGravity(17);
linearLayoutCompat.addView(textView, i3);
} else if (elements2.getElementSubtype().equalsIgnoreCase("hd")) {
ImageView imageView = new ImageView(this);
imageView.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.hd_icon));
imageView.setPadding(UiUtils.getDimension(getResources(), R.dimen.detail_text_padding_left), 0, 0, 0);
linearLayoutCompat.addView(imageView, i3);
} else if (elements2.getElementSubtype().equalsIgnoreCase("cc")) {
ImageView imageView2 = new ImageView(this);
imageView2.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.cc_icon));
imageView2.setPadding(UiUtils.getDimension(getResources(), R.dimen.detail_text_padding_left), 0, 0, 0);
linearLayoutCompat.addView(imageView2, i3);
} else if (elements2.getElementSubtype().equalsIgnoreCase("duration")) {
TextView textView2 = new TextView(this);
textView2.setText(elements2.getData());
textView2.setClickable(elements2.getIsClickable().booleanValue());
textView2.setTextColor(ContextCompat.getColor(this, z ? R.color.details_header_movietext_color : R.color.details_header_othertext_color));
textView2.setTypeface(ResourcesCompat.getFont(this, R.font.font_style_gotham_bold));
Resources resources2 = getResources();
int i6 = R.dimen.detail_text_padding_left;
textView2.setPadding(UiUtils.getDimension(resources2, i6), 0, UiUtils.getDimension(getResources(), i6), 0);
textView2.setCompoundDrawablesWithIntrinsicBounds(R.drawable.clock, 0, 0, 0);
textView2.setCompoundDrawablePadding(10);
textView2.setTextSize(UiUtils.getDimension(getResources(), R.dimen.detail_subtitle_size));
c = 17;
textView2.setGravity(17);
linearLayoutCompat.addView(textView2, i3);
i3++;
}
}
c = 17;
} else {
TextView textView3 = new TextView(this);
textView3.setClickable(elements2.getIsClickable().booleanValue());
if (elements2.getElementSubtype().equalsIgnoreCase("expiryInfo")) {
String[] split = elements2.getData().split("@");
if (split.length == 2) {
textView3.setText(Html.fromHtml("<font color=red>" + split[0] + "</font> <font color=white>" + split[1] + "</font>"));
} else {
textView3.setText(elements2.getData());
textView3.setTextColor(ContextCompat.getColor(this, R.color.red));
}
} else {
textView3.setText(elements2.getData().replace("|", "|"));
textView3.setTextColor(ContextCompat.getColor(this, z ? R.color.details_header_movietext_color : R.color.details_header_othertext_color));
}
textView3.setTypeface(ResourcesCompat.getFont(this, R.font.font_style_gotham_regular));
if (elements2.getElementSubtype().equalsIgnoreCase("expiryInfo")) {
textView3.setTextSize(UiUtils.getDimension(getResources(), R.dimen.textsize_14sp));
} else {
textView3.setTextSize(UiUtils.getDimension(getResources(), R.dimen.textsize_12sp));
}
textView3.setMaxLines(5);
textView3.setGravity(17);
Resources resources3 = getResources();
int i7 = R.dimen.detail_text_padding_left;
textView3.setPadding(UiUtils.getDimension(resources3, i7), 0, UiUtils.getDimension(getResources(), i7), 0);
linearLayoutCompat.addView(textView3, i3);
}
i3++;
c = 17;
}
this.detailInfoRelativeLayout.addView(linearLayoutCompat, i2);
}
}
}
private void createExitDialog() {
try {
MediaCatalogManager[] mediaCatalogManagerArr = {APIUtils.getmMediaManager(getApplicationContext())};
RestAdapter.enableCache(false);
mediaCatalogManagerArr[0].getBottomTemplateInfo(this.templateCode, "home", new MediaCatalogManager.MediaCatalogCallback<BottomTemplateInfo>() {
@Override
public void onFailure(Error error) {
}
@Override
public void onSuccess(BottomTemplateInfo bottomTemplateInfo) {
if (bottomTemplateInfo == null || bottomTemplateInfo.getTemplateResponseJson() == null) {
return;
}
OTTApplication.popupObject = bottomTemplateInfo.getTemplateResponseJson();
try {
if (bottomTemplateInfo.getTemplateResponseJson().has("target_details") && !TextUtils.isEmpty(bottomTemplateInfo.getTemplateResponseJson().getString("target_details"))) {
FusionViliteMainActivity.this.sectionCode = bottomTemplateInfo.getTemplateResponseJson().getString("target_details");
}
} catch (Exception unused) {
}
if (TextUtils.isEmpty(FusionViliteMainActivity.this.sectionCode)) {
return;
}
FusionViliteMainActivity fusionViliteMainActivity = FusionViliteMainActivity.this;
fusionViliteMainActivity.requestContent(fusionViliteMainActivity.sectionCode);
}
});
} catch (Exception unused) {
}
}
private void ctEventPopup(String str, String str2, String str3, String str4) {
CleverTap.moviesEventPopUp("no", str, str3, str2, str4, "", "", "", "", "", "launch", null, this.bottomTabSelected, "", "", -1, -1, null, "");
}
public void downloadVIMobileApp(String str) {
boolean isVimtvAppInstalledOrNot = Utils.isVimtvAppInstalledOrNot(OTTApplication.getContext(), "com.vodafone.vodafoneplay");
if (!TextUtils.isEmpty(str)) {
startActivity(new Intent("android.intent.action.VIEW", Uri.parse(str)));
} else if (!isVimtvAppInstalledOrNot) {
startActivity(new Intent("android.intent.action.VIEW", Uri.parse("https://play.google.com/store/apps/details?id=com.vodafone.vodafoneplay")));
} else if (APIUtils.getUtilAppConfigurations(OTTApplication.getContext()).getVimtvdeeplinkbaseurl() != null) {
startActivity(new Intent("android.intent.action.VIEW", Uri.parse(APIUtils.getUtilAppConfigurations(OTTApplication.getContext()).getVimtvdeeplinkbaseurl())));
}
}
private void enableHomeToolbar(boolean z) {
this.collapsingToolbarLayout.setVisibility(z ? 0 : 8);
}
private static int evaluateColorAlpha(float f2, int i2, int i3) {
int i4 = (i3 >> 8) & 255;
return ((((int) ((i4 - r2) * f2)) + ((i2 >> 8) & 255)) << 8) | (((i2 >>> 24) + ((int) (((i3 >>> 24) - r0) * f2))) << 24) | ((((i2 >> 16) & 255) + ((int) ((((i3 >> 16) & 255) - r1) * f2))) << 16) | ((i2 & 255) + ((int) (((i3 & 255) - r7) * f2)));
}
private void expandToolbar(boolean z, boolean z2) {
this.appBarLayout.setExpanded(z, false);
}
private void generateProfileTV(String str) {
String str2 = "";
if (str == null || str.trim().length() < 1) {
this.tv_profile.setText("");
return;
}
if (!str.contains(" ")) {
this.tv_profile.setText("" + str.charAt(0));
return;
}
String[] split = str.split(" ");
if (split.length > 0) {
for (int i2 = 0; i2 < split.length; i2++) {
if (split[i2].length() > 0) {
StringBuilder a = a.a(str2);
a.append(split[i2].charAt(0));
str2 = a.toString();
}
if (str2.length() == 2) {
break;
}
}
}
this.tv_profile.setText(str2);
}
public String getBottoMenuTargetPath(String str) {
List<Menu> list = this.mMenuList;
if (list != null) {
int size = list.size();
for (int i2 = 0; i2 < size; i2++) {
if (str.equalsIgnoreCase(this.mMenuList.get(i2).getCode())) {
return this.mMenuList.get(i2).getTargetPath() != null ? this.mMenuList.get(i2).getTargetPath().trim() : "";
}
}
}
return "";
}
public void getConfigurationData() {
APIUtils.getUtilApplicationManager(getApplicationContext()).getConfigurationData(null, new AppManager.AppManagerCallback<JSONObject>() {
@Override
public void onFailure(Error error) {
NavigationUtils.logKibanaError("FusionViliteMainActivity", "API", "/service/api/v1/system/config", "NA", "NA", "NA", f.a(error, new StringBuilder("")), error.getMessage());
InAppNotificationListener inAppNotificationListener = FusionViliteMainActivity.this;
if (inAppNotificationListener == null || inAppNotificationListener.isFinishing()) {
return;
}
FusionViliteMainActivity.this.restartActivity();
FusionViliteMainActivity.this.restrictBackgroundActions(false);
}
@Override
public void onSuccess(JSONObject jSONObject) {
InAppNotificationListener inAppNotificationListener = FusionViliteMainActivity.this;
if (inAppNotificationListener == null || inAppNotificationListener.isFinishing()) {
return;
}
if (FusionViliteMainActivity.this.playerCurrentState == 2) {
FusionViliteMainActivity.this.closePlayer();
}
FusionViliteMainActivity.this.restartActivity();
FusionViliteMainActivity.this.restrictBackgroundActions(false);
}
});
}
private TextView getDetailsTitleLayout(boolean z) {
TextView textView = new TextView(this);
textView.setText(this.toolbar_title.getText());
textView.setTextColor(ContextCompat.getColor(this, R.color.details_header_othertext_color));
textView.setTypeface(ResourcesCompat.getFont(this, R.font.font_style_gotham_regular));
textView.setTextSize(UiUtils.getDimension(getResources(), R.dimen.textsize_20sp));
if (!TextUtils.isEmpty(this.toolbar_title.getText())) {
this.toolbar_logo.setVisibility(8);
this.toolbar.setVisibility(8);
}
return textView;
}
public void getLocalCurrentTime() {
APIUtils.getmMediaManager(getApplicationContext()).getDateTime(new MediaCatalogManager.MediaCatalogCallback<String>() {
@Override
public void onFailure(Error error) {
NavigationUtils.logKibanaError("FusionViliteMainActivity", "API", "/service/api/ping", "NA", "NA", "NA", f.a(error, new StringBuilder("")), error.getMessage());
}
@Override
public void onSuccess(String str) {
InAppNotificationListener inAppNotificationListener = FusionViliteMainActivity.this;
if (inAppNotificationListener == null || inAppNotificationListener.isFinishing()) {
return;
}
DateHelper.getInstance().setCurrentLocalTime(str);
}
});
}
public Drawable getMediaRouteButtonDrawable(Context context) {
TypedArray obtainStyledAttributes = new ContextThemeWrapper(context, R.style.Theme_MediaRouter).obtainStyledAttributes(null, R.styleable.MediaRouteButton, R.attr.mediaRouteButtonStyle, 0);
Drawable drawable = obtainStyledAttributes.getDrawable(R.styleable.MediaRouteButton_externalRouteEnabledDrawable);
obtainStyledAttributes.recycle();
return DrawableCompat.wrap(drawable);
}
public int getMenuPosition(String str) {
List<Menu> list = this.mMenuList;
if (list != null) {
int size = list.size();
if (size > 5) {
size = 5;
}
for (int i2 = 0; i2 < size; i2++) {
if (str.equalsIgnoreCase(this.mMenuList.get(i2).getCode())) {
return i2;
}
if (this.mMenuList.get(i2).getSubMenus() != null && this.mMenuList.get(i2).getSubMenus().size() > 0) {
this.subMenuList1 = this.mMenuList.get(i2).getSubMenus();
}
}
List<SubMenu> list2 = this.subMenuList1;
if (list2 != null && list2.size() > 0) {
int size2 = this.subMenuList1.size();
for (int i3 = 0; i3 < size2; i3++) {
if (!TextUtils.isEmpty(this.subMenuList1.get(i3).getCode()) && this.subMenuList1.get(i3).getCode().equalsIgnoreCase(this.selectedTab)) {
return i3;
}
}
}
}
return 0;
}
public void getPreferenceManager() {
this.preferenceManager = APIUtils.getUtilPreferenceManager(getApplicationContext());
}
private RemoteMediaClient.Callback getRemoteMediaCallBack() {
return new RemoteMediaClient.Callback() {
public void onMetadataUpdated() {
FusionViliteMainActivity.this.updateCastPlayer(false);
if (FusionViliteMainActivity.this.mCastSession != null) {
CustomLog.e("Chromecast", "onMetadataUpdated" + FusionViliteMainActivity.this.mCastSession.isConnected());
if (!FusionViliteMainActivity.this.mCastSession.isConnected()) {
FusionViliteMainActivity.this.mbottomLayout.setVisibility(8);
return;
}
FusionViliteMainActivity.this.mbottomLayout.setVisibility(0);
if (FusionViliteMainActivity.this.mCastSession.getRemoteMediaClient() != null) {
CustomLog.e("Chromecast", "onMetadataUpdated content is playing" + FusionViliteMainActivity.this.mCastSession.isConnected());
FusionViliteMainActivity fusionViliteMainActivity = FusionViliteMainActivity.this;
fusionViliteMainActivity.updateUI(fusionViliteMainActivity.dimen_110dp);
}
}
}
public void onPreloadStatusUpdated() {
super.onPreloadStatusUpdated();
}
public void onQueueStatusUpdated() {
super.onQueueStatusUpdated();
}
public void onSendingRemoteMediaRequest() {
super.onSendingRemoteMediaRequest();
}
public void onStatusUpdated() {
MediaStatus mediaStatus;
super.onStatusUpdated();
if (FusionViliteMainActivity.this.mCastSession == null || FusionViliteMainActivity.this.mCastSession.getRemoteMediaClient() == null || (mediaStatus = FusionViliteMainActivity.this.mCastSession.getRemoteMediaClient().getMediaStatus()) == null) {
return;
}
if (mediaStatus.getPlayerState() == 1 || mediaStatus.getPlayerState() == 0) {
if (mediaStatus.getIdleReason() == 0) {
CustomLog.e("mediaStatus", "IDLE_REASON_NONE");
} else if (mediaStatus.getIdleReason() == 4 || mediaStatus.getIdleReason() == 3) {
CustomLog.e("mediaStatus", " Error or interrupted");
FusionViliteMainActivity.this.showChromecastLoading(false);
}
}
}
};
}
private void goToAfterDark() {
TabLayout tabLayout;
if (this.viewPagerFragment == null || (tabLayout = this.tabLayout) == null || tabLayout.getSelectedTabPosition() == 0) {
return;
}
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
FusionViliteMainActivity.this.viewPagerFragment.setCurrentTab(FusionViliteMainActivity.this.getMenuPosition("after_dark"));
FusionViliteMainActivity.this.refreshAfterDark();
}
}, 10L);
}
private void goToDialScreen() {
Configs utilAppConfigurations;
if (APIUtils.getUtilApplicationManager(getApplicationContext()) == null || (utilAppConfigurations = APIUtils.getUtilAppConfigurations(getApplicationContext())) == null || utilAppConfigurations.getCallingNumber() == null) {
return;
}
String callingNumber = utilAppConfigurations.getCallingNumber();
Intent intent = new Intent("android.intent.action.DIAL");
try {
intent.setData(Uri.parse("tel:" + callingNumber));
startActivity(intent);
} catch (ActivityNotFoundException unused) {
}
}
private boolean handleBackStack() {
int backStackEntryCount = getSupportFragmentManager().getBackStackEntryCount();
FragmentManager supportFragmentManager = getSupportFragmentManager();
int i2 = R.id.contentframe;
Fragment findFragmentById = supportFragmentManager.findFragmentById(i2);
if (findFragmentById == null || isDestroyed() || !findFragmentById.isAdded()) {
return false;
}
FragmentManager supportFragmentManager2 = getSupportFragmentManager();
int i3 = R.id.error_frame_container;
Fragment findFragmentById2 = supportFragmentManager2.findFragmentById(i3);
if (findFragmentById2 != null && (findFragmentById2 instanceof ErrorFragment)) {
((FrameLayout) findViewById(i3)).setVisibility(8);
getSupportFragmentManager().popBackStackImmediate();
if (findFragmentById instanceof HomeFragment) {
showBottomBar(true);
}
return true;
}
if ((findFragmentById instanceof ViewPagerFragment) || (findFragmentById instanceof HomeFragment) || (findFragmentById instanceof DetailsFragment) || (findFragmentById instanceof GridFragment) || (findFragmentById instanceof SearchFragmentNew)) {
OTTApplication.playerPresent = OTTApplication.is_Nav_fav || (findFragmentById instanceof DetailsFragment) || (findFragmentById instanceof GridFragment);
NavigationUtils.sendAutoPlayResumeBroadCast(this);
NavigationUtils.sendStartAutoScrollBroadCast(this);
}
if (findFragmentById instanceof PaymentGateWaysFragment) {
restrictBackgroundActions(false);
} else if ((findFragmentById instanceof OfflineDownloadListFragment) && UiUtils.isNetworkConnected(this)) {
showBottomBar(true);
} else if (findFragmentById instanceof DetailsFragment) {
toggleBackButton(true);
updateToolbarItems(true, false);
enableHomeToolbar(true);
this.toolbar.setVisibility(8);
OTTApplication.is_Nav_meta = false;
} else if (findFragmentById instanceof GridFragment) {
if (OTTApplication.is_Nav_fav_from_grid && OTTApplication.is_Nav_meta) {
OTTApplication.isPlayerPage = false;
OTTApplication.is_Nav_fav_from_grid = false;
OTTApplication.is_Nav_fav = true;
} else if (OTTApplication.favFromGrid && OTTApplication.is_Nav_meta) {
OTTApplication.is_Nav_Tab_fav = true;
OTTApplication.favFromGrid = false;
} else if (OTTApplication.is_Nav_fav_from_grid && !OTTApplication.FAV_FROM_TAB) {
OTTApplication.is_Nav_fav_from_grid = false;
OTTApplication.isDrawerOpen = true;
}
}
if (findFragmentById instanceof HomeFragment) {
NavigationUtils.sendStartAutoScrollBroadCast(this.context);
}
int i4 = this.playerCurrentState;
if (i4 == 0) {
this.isNowPlayingPath = "";
if (OTTApplication.is_Nav_fav && !OTTApplication.FAV_FROM_TAB) {
OTTApplication.is_nav_home = true;
OTTApplication.isDrawerOpen = true;
}
if (backStackEntryCount == 1) {
try {
Fragment findFragmentById3 = getSupportFragmentManager().findFragmentById(i2);
if (findFragmentById3 == null || !(findFragmentById3 instanceof OfflineDownloadListFragment)) {
if (!OTTApplication.is_Nav_fav) {
showBottomBar(true);
}
} else if (!UiUtils.isNetworkConnected(this)) {
if (this.backToExit) {
finish();
return true;
}
this.backToExit = true;
Toast.makeText((Context) this, (CharSequence) getResources().getString(R.string.back_to_exit), 0).show();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
FusionViliteMainActivity.this.backToExit = false;
}
}, 3000L);
return false;
}
} catch (Exception unused) {
}
}
if (backStackEntryCount > 1) {
showBottomBar(false);
}
if (backStackEntryCount == 1 && this.doSectionsRefresh) {
refreshPager();
}
if (backStackEntryCount >= 1) {
getSupportFragmentManager().popBackStack();
return true;
}
return false;
}
if (i4 == 1) {
OTTApplication.exitPopupContentClicked = false;
OTTApplication.isDrawerOpen = false;
showSystemUI();
onVideoFullscreen(false);
Fragment fragment = this.mPlayerFragment;
if (fragment instanceof ExoPlayerFragment) {
((ExoPlayerFragment) fragment).switchFullscreen(false);
}
this.mWatchWhileLayout.minimize(true);
if (isBottomBarVisible()) {
this.bannerAdsBottomMargin = (int) getResources().getDimension(R.dimen.banner_ad_bottom_margin_bottom_bar_and_dock_player);
} else {
this.bannerAdsBottomMargin = (int) getResources().getDimension(R.dimen.banner_ad_bottom_margin_dock_player_only);
}
setBannerAdsMargin();
WatchWhileLayout watchWhileLayout = this.mWatchWhileLayout;
if (watchWhileLayout.mIsFullscreen) {
watchWhileLayout.exitFullscreenToMinimize();
}
Fragment findFragmentById4 = getSupportFragmentManager().findFragmentById(i2);
if (findFragmentById4 != null && (findFragmentById4 instanceof OfflineDownloadListFragment)) {
showBottomBar(false);
}
if (findFragmentById4 != null && (findFragmentById4 instanceof HomeFragment) && !OTTApplication.is_Nav_fav) {
if (((HomeFragment) findFragmentById4).isTitleAvailable) {
showBottomBar(false);
} else {
showBottomBar(true);
}
}
return true;
}
if (i4 != 2) {
return false;
}
OTTApplication.exitPopupContentClicked = false;
OTTApplication.isDrawerOpen = false;
if (backStackEntryCount == 1) {
try {
Fragment findFragmentById5 = getSupportFragmentManager().findFragmentById(i2);
if (findFragmentById5 == null || !(findFragmentById5 instanceof OfflineDownloadListFragment)) {
if (!OTTApplication.is_Nav_fav) {
showBottomBar(true);
}
} else if (!UiUtils.isNetworkConnected(this)) {
((ExoPlayerFragment) this.mPlayerFragment).currentSpeedIndex = 2;
this.mWatchWhileLayout.slideHorizontal(true);
return true;
}
} catch (Exception unused2) {
}
}
if (backStackEntryCount > 1) {
showBottomBar(false);
}
if (backStackEntryCount == 1) {
if (this.doSectionsRefresh) {
refreshPager();
} else {
ViewPagerFragment viewPagerFragment = this.viewPagerFragment;
if (viewPagerFragment != null) {
viewPagerFragment.refreshData();
}
}
}
if (backStackEntryCount >= 1) {
getSupportFragmentManager().popBackStack();
return true;
}
((ExoPlayerFragment) this.mPlayerFragment).currentSpeedIndex = 2;
this.mWatchWhileLayout.slideHorizontal(true);
return true;
}
public boolean handleHamBurgerMenu(boolean z) {
if (getSupportFragmentManager().getBackStackEntryCount() >= 1) {
return handleBackStack();
}
DrawerLayout findViewById = findViewById(R.id.drawer_layout);
if (!z) {
return handleBackStack();
}
if (findViewById.isDrawerOpen(8388611)) {
findViewById.closeDrawer(8388611);
return false;
}
findViewById.openDrawer(8388611);
updateSliderMenu();
return true;
}
private void handleInappButtonClick(HashMap<String, String> hashMap, String str) {
String str2;
if (hashMap == null || !hashMap.containsKey("launchurl") || (str2 = hashMap.get("launchurl")) == null) {
return;
}
if (!str2.startsWith("http") && !str2.startsWith("https")) {
NavigationUtils.performItemClickNavigation(null, this, str2, NavigationConstants.NAV_FROM_INAPP);
return;
}
if (hashMap.containsKey("isExternal") && hashMap.containsKey("isExternal") && hashMap.get("isExternal") != null && hashMap.get("isExternal").equalsIgnoreCase("True")) {
startActivity(new Intent("android.intent.action.VIEW", Uri.parse(str2)));
} else {
NavigationUtils.onBoardWebViewNavigation(this, NavigationConstants.NAV_FROM_INAPP, str2, "");
}
}
private void initPALSdk(boolean z) {
this.consentSettings = ConsentSettings.builder().allowStorage(Boolean.valueOf(z)).build();
this.nonceLoader = new NonceLoader(this, this.consentSettings);
}
private void initUIelements() {
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
if (FusionViliteMainActivity.this.isFinishing()) {
return;
}
List<Menu> menuList = APIUtils.getUtilApplicationManager(FusionViliteMainActivity.this.getApplicationContext()).getMenuList();
if (menuList == null || menuList.size() == 0) {
FusionViliteMainActivity.this.getConfigurationData();
return;
}
FusionViliteMainActivity.this.updateTabItemsNew(menuList);
FusionViliteMainActivity.this.updateSliderMenu();
FusionViliteMainActivity.this.tabLayout.setVisibility(0);
FusionViliteMainActivity.this.linear_tablayout.setVisibility(0);
FusionViliteMainActivity.this.mUpNextFragment = new UpNextFragment();
FusionViliteMainActivity.this.getSupportFragmentManager().beginTransaction().replace(R.id.up_next_fragment_container, FusionViliteMainActivity.this.mUpNextFragment, "UpNextFragment").commitNowAllowingStateLoss();
FusionViliteMainActivity.this.mPlayerFragment = new ExoPlayerFragment();
FusionViliteMainActivity.this.getSupportFragmentManager().beginTransaction().replace(R.id.player_fragment_container, FusionViliteMainActivity.this.mPlayerFragment, "ExoPlayerFragment").commitNowAllowingStateLoss();
?? r0 = FusionViliteMainActivity.this;
r0.mWatchWhileLayout = (WatchWhileLayout) r0.findViewById(R.id.watch_while_layout);
FusionViliteMainActivity fusionViliteMainActivity = FusionViliteMainActivity.this;
fusionViliteMainActivity.mWatchWhileLayout.setListener(fusionViliteMainActivity);
FusionViliteMainActivity.this.menuListRecyclerView.setAdapter(FusionViliteMainActivity.this.mAdapter);
FusionViliteMainActivity.this.getLocalCurrentTime();
NavigationUtils.itemClickActionInProgress = false;
CustomLog.e("FusionViliteMainActivity", "step 14");
?? r02 = FusionViliteMainActivity.this;
((FusionViliteMainActivity) r02).mExternalRouteEnabledDrawable = r02.getMediaRouteButtonDrawable(r02);
FusionViliteMainActivity.this.performDeeplinkOperation();
}
}, 50L);
}
private void installOpenAppPopup(AppLaunchPopupConfig appLaunchPopupConfig, boolean z) {
final Dialog dialog;
AppLaunchPopupConfig.AppNotInstalledPopup appNotInstalledPopup;
boolean z2;
char c;
AppLaunchPopupConfig.AppInstalledPopup appInstalledPopup;
OTTApplication.SHOW_APP_OPEN_POPUP = false;
Dialog dialog2 = new Dialog(this);
dialog2.setContentView(R.layout.install_open_app_popup_new);
dialog2.getWindow().setLayout(-1, -2);
dialog2.getWindow().setBackgroundDrawableResource(android.R.color.transparent);
dialog2.setCanceledOnTouchOutside(false);
boolean isVimtvAppInstalledOrNot = Utils.isVimtvAppInstalledOrNot(this, "com.vodafone.vodafoneplay");
final String[] strArr = {"vimtv redirection"};
final String str = !z ? "pro user vimtv app promotion" : "non subscribed user popup";
final MaterialButton findViewById = dialog2.findViewById(R.id.install_open_popup_button);
ImageView imageView = (ImageView) dialog2.findViewById(R.id.popup_cancel_image);
ImageView imageView2 = (ImageView) dialog2.findViewById(R.id.install_open_popup_poster_image);
TextView textView = (TextView) dialog2.findViewById(R.id.install_open_popup_title);
TextView textView2 = (TextView) dialog2.findViewById(R.id.install_open_popup_subtitle);
final RelativeLayout relativeLayout = (RelativeLayout) dialog2.findViewById(R.id.install_open_popup_root);
textView.setVisibility(8);
textView2.setVisibility(8);
if (!isVimtvAppInstalledOrNot) {
dialog = dialog2;
if (appLaunchPopupConfig != null && appLaunchPopupConfig.getAppNotInstalledPopup() != null && (appNotInstalledPopup = appLaunchPopupConfig.getAppNotInstalledPopup()) != null) {
z2 = !TextUtils.isEmpty(appNotInstalledPopup.getImageUrlV2());
Glide.with(getApplicationContext()).load(appNotInstalledPopup.getImageUrlV2()).listener(new RequestListener<Drawable>() {
public boolean onLoadFailed(@Nullable GlideException glideException, Object obj, Target<Drawable> target, boolean z3) {
return false;
}
public boolean onResourceReady(Object obj, Object obj2, Target target, DataSource dataSource, boolean z3) {
return onResourceReady((Drawable) obj, obj2, (Target<Drawable>) target, dataSource, z3);
}
public boolean onResourceReady(Drawable drawable, Object obj, Target<Drawable> target, DataSource dataSource, boolean z3) {
relativeLayout.setVisibility(0);
return false;
}
}).into(imageView2);
final AppLaunchPopupConfig.Button button = appNotInstalledPopup.getButton().get(0);
findViewById.setText(button.getTitle());
final String target = button.getTarget();
if (!TextUtils.isEmpty(button.getBgColor()) && button.getBgColor().length() >= 7) {
findViewById.setBackgroundColor(Color.parseColor(button.getBgColor()));
}
if (!TextUtils.isEmpty(button.getTextColor()) && button.getTextColor().length() >= 7) {
findViewById.setTextColor(Color.parseColor(button.getTextColor()));
}
if (!TextUtils.isEmpty(button.getTargetType()) && button.getTargetType().equalsIgnoreCase("external_browser")) {
strArr[0] = "external redirection";
} else if (!TextUtils.isEmpty(button.getTargetType()) && button.getTargetType().equalsIgnoreCase("viapp_deeplink")) {
strArr[0] = "vi app redirection";
} else if (!TextUtils.isEmpty(button.getTargetType()) && button.getTargetType().equalsIgnoreCase(Labels.Android.WEBVIEW)) {
strArr[0] = "webview redirection";
} else if (!TextUtils.isEmpty(button.getTargetType()) && button.getTargetType().equalsIgnoreCase("vimtv_deeplink")) {
strArr[0] = "content redirection";
} else if (target.contains("://")) {
strArr[0] = "vimtv redirection";
} else {
strArr[0] = "content redirection";
}
findViewById.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
FusionViliteMainActivity.this.lambda$installOpenAppPopup$36(dialog, findViewById, button, str, strArr, target, view);
}
});
c = 0;
}
c = 0;
z2 = false;
} else if (appLaunchPopupConfig == null || appLaunchPopupConfig.getAppInstalledPopup() == null || (appInstalledPopup = appLaunchPopupConfig.getAppInstalledPopup()) == null) {
dialog = dialog2;
c = 0;
z2 = false;
} else {
z2 = !TextUtils.isEmpty(appInstalledPopup.getImageUrlV2());
dialog = dialog2;
Glide.with(getApplicationContext()).load(appInstalledPopup.getImageUrlV2()).listener(new RequestListener<Drawable>() {
public boolean onLoadFailed(@Nullable GlideException glideException, Object obj, Target<Drawable> target2, boolean z3) {
return false;
}
public boolean onResourceReady(Object obj, Object obj2, Target target2, DataSource dataSource, boolean z3) {
return onResourceReady((Drawable) obj, obj2, (Target<Drawable>) target2, dataSource, z3);
}
public boolean onResourceReady(Drawable drawable, Object obj, Target<Drawable> target2, DataSource dataSource, boolean z3) {
relativeLayout.setVisibility(0);
return false;
}
}).into(imageView2);
final AppLaunchPopupConfig.Button button2 = appInstalledPopup.getButton().get(0);
final String target2 = button2.getTarget();
findViewById.setText(button2.getTitle());
if (!TextUtils.isEmpty(button2.getBgColor()) && button2.getBgColor().length() >= 7) {
findViewById.setBackgroundColor(Color.parseColor(button2.getBgColor()));
}
if (!TextUtils.isEmpty(button2.getTextColor()) && button2.getTextColor().length() >= 7) {
findViewById.setTextColor(Color.parseColor(button2.getTextColor()));
}
if (!TextUtils.isEmpty(button2.getTargetType()) && button2.getTargetType().equalsIgnoreCase("external_browser")) {
strArr[0] = "external redirection";
} else if (!TextUtils.isEmpty(button2.getTargetType()) && button2.getTargetType().equalsIgnoreCase("viapp_deeplink")) {
strArr[0] = "vi app redirection";
} else if (!TextUtils.isEmpty(button2.getTargetType()) && button2.getTargetType().equalsIgnoreCase(Labels.Android.WEBVIEW)) {
strArr[0] = "webview redirection";
} else if (!TextUtils.isEmpty(button2.getTargetType()) && button2.getTargetType().equalsIgnoreCase("vimtv_deeplink")) {
strArr[0] = "content redirection";
} else if (target2.contains("://")) {
strArr[0] = "vimtv redirection";
} else {
strArr[0] = "content redirection";
}
findViewById.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
FusionViliteMainActivity.this.lambda$installOpenAppPopup$35(dialog, findViewById, button2, str, strArr, target2, view);
}
});
c = 0;
}
final String str2 = strArr[c];
final Dialog dialog3 = dialog;
imageView.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
FusionViliteMainActivity.this.lambda$installOpenAppPopup$37(str, str2, dialog3, view);
}
});
if (z2) {
dialog3.show();
final String str3 = strArr[c];
new Handler().postDelayed(new Runnable() {
@Override
public final void run() {
FusionViliteMainActivity.this.lambda$installOpenAppPopup$38(str, str3);
}
}, 1000L);
}
}
public boolean isSubMenusAvailable(String str) {
List<Menu> list = this.mMenuList;
if (list != null) {
int size = list.size();
for (int i2 = 0; i2 < size; i2++) {
if (str.equalsIgnoreCase(this.mMenuList.get(i2).getCode())) {
if (this.mMenuList.get(i2).getSubMenus() == null || this.mMenuList.get(i2).getSubMenus().size() <= 0) {
return false;
}
enableToolBarLogo(true);
return true;
}
}
}
return false;
}
private boolean isTabDeeplink(String str) {
List<SubMenu> arrayList = new ArrayList<>();
for (Menu menu : APIUtils.getUtilApplicationManager(getApplicationContext()).getMenuList()) {
if (menu.getTargetPath().equalsIgnoreCase(str)) {
this.isSubMenuTab = false;
return true;
}
if (menu.getSubMenus() != null && menu.getSubMenus().size() > 0) {
arrayList = menu.getSubMenus();
}
}
for (SubMenu subMenu : arrayList) {
if (subMenu != null && subMenu.getTargetPath() != null && subMenu.getTargetPath().equalsIgnoreCase(str)) {
this.isSubMenuTab = true;
return true;
}
}
return false;
}
private boolean isValidStreamingContent(Object obj) {
Fragment fragment;
Object currentPlayingItem;
if (obj != null && (fragment = this.mPlayerFragment) != null && (fragment instanceof ExoPlayerFragment) && (currentPlayingItem = ((ExoPlayerFragment) fragment).getCurrentPlayingItem()) != null && (currentPlayingItem instanceof ContentPage)) {
if (obj instanceof ContentPage) {
ContentPage contentPage = (ContentPage) obj;
return contentPage.getPageInfo() != null && ((ContentPage) currentPlayingItem).getPageInfo().getPath().equalsIgnoreCase(contentPage.getPageInfo().getPath());
}
if (obj instanceof Card) {
return ((Card) obj).getTarget().getPath().equalsIgnoreCase(((ContentPage) currentPlayingItem).getPageInfo().getPath());
}
if ((obj instanceof String) && ((String) obj).equalsIgnoreCase(((ContentPage) currentPlayingItem).getPageInfo().getPath())) {
return true;
}
}
return false;
}
public void lambda$goToDetail$32(Object obj) {
boolean z;
boolean z2;
if (obj != null && (((z = obj instanceof Card)) || (obj instanceof String))) {
if (this.mPlayerFragment instanceof ExoPlayerFragment) {
if (z) {
Card card = (Card) obj;
if (card.getTarget().getPageType().equalsIgnoreCase("details")) {
if (!z || card.getDisplay() == null || card.getDisplay().getMarkers() == null) {
z2 = true;
} else {
z2 = true;
for (int i2 = 0; i2 < c.a(card); i2++) {
if (((Card.PosterDisplay.Marker) d.a(card, i2)).getMarkerType() != null && ((Card.PosterDisplay.Marker) d.a(card, i2)).getMarkerType().equalsIgnoreCase("special") && ((Card.PosterDisplay.Marker) d.a(card, i2)).getValue() != null && ((Card.PosterDisplay.Marker) d.a(card, i2)).getValue().equalsIgnoreCase("targetPlayerPage")) {
z2 = false;
}
}
}
if (isClicked()) {
return;
}
setClicked(true);
this.clickHandler.postDelayed(this.isClickedRunnable, 1000L);
if (z2) {
onVideoCollapse();
}
String str = AnalyticsUtils.ATTRIBUTE_VALUE_SOURCE_DETAILS_PAGE;
if (MyRecoManager.getInstance() != null && MyRecoManager.getInstance().getOriginSource() != null && MyRecoManager.getInstance().getOriginSource().equalsIgnoreCase("Notification")) {
str = NavigationConstants.NAV_FROM_NOTIFICATION;
}
ExoPlayerFragment exoPlayerFragment = (ExoPlayerFragment) this.mPlayerFragment;
NavigationUtils.performItemClickNavigation(exoPlayerFragment, exoPlayerFragment.getActivity(), obj, str, "");
return;
}
}
String path = obj instanceof String ? (String) obj : ((Card) obj).getTarget().getPath();
this.isNowPlayingPath = path;
((ExoPlayerFragment) this.mPlayerFragment).fetchData(path, this.seekValue, this, this.mButtonType);
return;
}
return;
}
this.mWatchWhileLayout.maximize(true);
if (this.isComingFromChromeCast) {
this.isComingFromChromeCast = false;
} else if (obj instanceof ContentPage) {
ContentPage contentPage = (ContentPage) obj;
if (contentPage.getStreamStatus() == null || contentPage.getStreamStatus().getSeekPositionInMillis() == null || contentPage.getStreamStatus().getSeekPositionInMillis().longValue() == 0) {
this.seekValue = 0L;
} else {
this.seekValue = contentPage.getStreamStatus().getSeekPositionInMillis().longValue();
if (this.mButtonType == ButtonType.NONE) {
this.mButtonType = ButtonType.RESUME;
}
}
} else if (obj instanceof OfflineDownloadData) {
this.seekValue = 0L;
}
if (this.mPlayerFragment instanceof ExoPlayerFragment) {
boolean z3 = obj instanceof ContentPage;
if (z3) {
this.isNowPlayingPath = ((ContentPage) obj).getPageInfo().getPath();
} else if (obj instanceof OfflineDownloadData) {
this.isNowPlayingPath = ((OfflineDownloadData) obj).getPath();
}
this.currentItemtargerPath = this.isNowPlayingPath;
trackPlayerEvents(AnalyticsUtils.EVENT_PLAYER, this.playerScreenSource, obj);
this.isDetailsPage = false;
if (z3) {
ContentPage contentPage2 = (ContentPage) obj;
if (contentPage2.getPageInfo() != null && contentPage2.getPageInfo().getPageType() != null && PageType.getType(contentPage2.getPageInfo().getPageType()).equals(PageType.Details)) {
this.isDetailsPage = true;
}
}
((ExoPlayerFragment) this.mPlayerFragment).startPlay(obj, this.seekValue, this.mButtonType);
if (this.isDetailsPage) {
showSuggestionsLayout(obj);
setRequestedOrientation(1);
}
}
if (this.mUpNextFragment == null || !(obj instanceof OfflineDownloadData)) {
return;
}
showSuggestionsLayout(this.itemObject);
}
public void lambda$goToDetail$33() {
CastSession castSession;
if (this.isChromeCastMinimized && (castSession = this.mCastSession) != null && castSession.isConnected()) {
this.mWatchWhileLayout.minimize(true);
}
}
public void lambda$installOpenAppPopup$35(Dialog dialog, MaterialButton materialButton, AppLaunchPopupConfig.Button button, String str, String[] strArr, String str2, View view) {
if (dialog != null) {
dialog.dismiss();
}
String charSequence = materialButton.getText().toString();
if (!TextUtils.isEmpty(button.getTargetType()) && button.getTargetType().equalsIgnoreCase("external_browser")) {
ctEventPopup(str, strArr[0], "button clicked", charSequence);
try {
startActivity(new Intent("android.intent.action.VIEW", Uri.parse(str2)));
return;
} catch (ActivityNotFoundException unused) {
Toast.makeText((Context) this, (CharSequence) "Activity not found, please try again later", 0).show();
return;
}
}
if (!TextUtils.isEmpty(button.getTargetType()) && button.getTargetType().equalsIgnoreCase("viapp_deeplink")) {
ctEventPopup(str, strArr[0], "button clicked", charSequence);
OTTApplication.getWebLinkCallback().callWebLink(str2);
finish();
return;
}
if (!TextUtils.isEmpty(button.getTargetType()) && button.getTargetType().equalsIgnoreCase(Labels.Android.WEBVIEW)) {
ctEventPopup(str, strArr[0], "button clicked", charSequence);
launchWebviewPlansPage("", str2, "renew subscribe");
return;
}
if (!TextUtils.isEmpty(button.getTargetType()) && button.getTargetType().equalsIgnoreCase("vimtv_deeplink")) {
NavigationUtils.eventCTAppInAppClick(OTTApplication.getContext(), null, null, "", str);
ctEventPopup(str, strArr[0], "button clicked", charSequence);
NavigationUtils.performItemClickNavigation(null, this, str2, "");
return;
}
NavigationUtils.eventCTAppInAppClick(OTTApplication.getContext(), null, null, "", str);
if (!str2.contains("://")) {
ctEventPopup(str, strArr[0], "button clicked", charSequence);
NavigationUtils.performItemClickNavigation(null, this, str2, "");
} else {
ctEventPopup(str, strArr[0], "button clicked", charSequence);
try {
startActivity(new Intent("android.intent.action.VIEW", Uri.parse(str2)));
} catch (ActivityNotFoundException unused2) {
Toast.makeText((Context) this, (CharSequence) "Activity not found, please try again later", 0).show();
}
}
}
public void lambda$installOpenAppPopup$36(Dialog dialog, MaterialButton materialButton, AppLaunchPopupConfig.Button button, String str, String[] strArr, String str2, View view) {
if (dialog != null) {
dialog.dismiss();
}
String charSequence = materialButton.getText().toString();
if (!TextUtils.isEmpty(button.getTargetType()) && button.getTargetType().equalsIgnoreCase("external_browser")) {
ctEventPopup(str, strArr[0], "button clicked", charSequence);
try {
startActivity(new Intent("android.intent.action.VIEW", Uri.parse(str2)));
return;
} catch (ActivityNotFoundException unused) {
Toast.makeText((Context) this, (CharSequence) "Activity not found, please try again later", 0).show();
return;
}
}
if (!TextUtils.isEmpty(button.getTargetType()) && button.getTargetType().equalsIgnoreCase("viapp_deeplink")) {
ctEventPopup(str, strArr[0], "button clicked", charSequence);
OTTApplication.getWebLinkCallback().callWebLink(str2);
finish();
return;
}
if (!TextUtils.isEmpty(button.getTargetType()) && button.getTargetType().equalsIgnoreCase(Labels.Android.WEBVIEW)) {
ctEventPopup(str, strArr[0], "button clicked", charSequence);
launchWebviewPlansPage("", str2, "renew subscribe");
return;
}
if (!TextUtils.isEmpty(button.getTargetType()) && button.getTargetType().equalsIgnoreCase("vimtv_deeplink")) {
NavigationUtils.eventCTAppInAppClick(OTTApplication.getContext(), null, null, "", str);
ctEventPopup(str, strArr[0], "button clicked", charSequence);
NavigationUtils.performItemClickNavigation(null, this, str2, "");
return;
}
NavigationUtils.eventCTAppInAppClick(OTTApplication.getContext(), null, null, "", str);
if (!str2.contains("://")) {
ctEventPopup(str, strArr[0], "button clicked", charSequence);
NavigationUtils.performItemClickNavigation(null, this, str2, "");
} else {
ctEventPopup(str, strArr[0], "button clicked", charSequence);
try {
startActivity(new Intent("android.intent.action.VIEW", Uri.parse(str2)));
} catch (ActivityNotFoundException unused2) {
Toast.makeText((Context) this, (CharSequence) "Activity not found, please try again later", 0).show();
}
}
}
public void lambda$installOpenAppPopup$37(String str, String str2, Dialog dialog, View view) {
ctEventPopup(str, str2, "popup closed", "NA");
dialog.dismiss();
}
public void lambda$installOpenAppPopup$38(String str, String str2) {
ctEventPopup(str, str2, "popup displayed", "");
}
public void lambda$loadUserProfilesData$29(User.ProfileParentalDetails profileParentalDetails, View view) {
activateProfile(profileParentalDetails);
}
public void lambda$loadUserProfilesData$30(View view) {
launchUserProfilesPage();
this.userProfilesLayout.setVisibility(8);
this.isProfilesOpen = false;
}
public void lambda$loadUserProfilesData$31(View view) {
showProgressBar();
this.userProfilesLayout.setVisibility(8);
this.isProfilesOpen = false;
launchWebviewForUsrProfiles();
}
public void lambda$new$34(ScanIntentResult scanIntentResult) {
if (scanIntentResult == null || scanIntentResult.getContents() == null) {
Intent originalIntent = scanIntentResult.getOriginalIntent();
if (originalIntent == null || !originalIntent.hasExtra("MISSING_CAMERA_PERMISSION")) {
return;
}
Toast.makeText((Context) this, (CharSequence) "Please allow camera permissions from device settings to continue", 0).show();
return;
}
String contents = scanIntentResult.getContents();
if (contents.contains("http") || contents.contains("https")) {
try {
String[] split = new URI(contents).getPath().split("/");
contents = split[split.length - 1];
} catch (URISyntaxException unused) {
contents = "";
}
}
startActivityForResult(new Intent((Context) this, (Class<?>) ActivateDeviceFragment.class).putExtra("activationCode", contents).putExtra("popupEvent", true), 53);
}
public void lambda$onCreate$0() {
if (TextUtils.isEmpty(JuspayUtility.getInstance().getInitiateResponse())) {
initiateJuspayCall();
}
}
public void lambda$onCreate$1(View view) {
OTTApplication.item = null;
CleverTap.moviesEventClicked("button", "home subscribe");
if (this.preferenceManager == null) {
getPreferenceManager();
}
PreferenceManager preferenceManager = this.preferenceManager;
if ((preferenceManager == null || preferenceManager.getLoggedUser() != null) && this.preferenceManager.getLoggedUser().getStatus().intValue() != 0) {
launchWebviewPlansPage(null, null, "home subscribe");
} else {
AnalyticsV2.getInstance().trackEvent(AnalyticsV2.EVENT_PAYMENT_SIGNIN);
NavigationUtils.loadScreenActivityForResult((FragmentActivity) this, ScreenType.SIGNIN, NavigationConstants.NAV_FROM_HOME, (String) null, 12, "home subscribe", "");
}
}
public void lambda$onCreate$10(View view) {
trackEvent(AnalyticsV2.EVENT_HOME_CALL);
goToDialScreen();
}
public static void lambda$onCreate$11(View view) {
}
public void lambda$onCreate$12(View view) {
this.isProfilesOpen = !this.isProfilesOpen;
setUserProfilesArrowImage();
if (this.userProfilesLayout.getVisibility() == 0) {
this.userProfilesLayout.setVisibility(8);
} else {
this.userProfilesLayout.setVisibility(0);
}
}
public void lambda$onCreate$13(View view) {
long currentTimeMillis = System.currentTimeMillis();
if (currentTimeMillis - this.lastTimeTapMs.longValue() >= 500) {
this.numtaps = 0;
this.lastTimeTapMs = 0L;
}
if (this.numtaps <= 0 || currentTimeMillis - this.lastTimeTapMs.longValue() >= 500) {
this.numtaps = 1;
} else {
this.numtaps++;
}
this.lastTimeTapMs = Long.valueOf(System.currentTimeMillis());
CustomLog.d("DEBUG", "numtaps " + this.numtaps);
if (this.numtaps >= 5) {
DrawerLayout drawerLayout = this.mDrawerLayout;
if (drawerLayout != null) {
drawerLayout.closeDrawers();
}
NavigationUtils.showDialog((FragmentActivity) this, DialogType.INSERT_PASSWORD_DIALOG, new HashMap(), new DialogListener() {
@Override
public void itemClicked(boolean z, int i2, int i3) {
}
@Override
public void itemClicked(boolean z, int i2, HashMap hashMap) {
}
});
}
}
public void lambda$onCreate$14() {
Object obj;
OTTApplication.playerPresent = true;
int backStackEntryCount = getSupportFragmentManager().getBackStackEntryCount();
Fragment findFragmentById = getSupportFragmentManager().findFragmentById(R.id.contentframe);
ImageView imageView = this.iV_Gradient_top;
if (imageView != null) {
imageView.setVisibility(8);
}
if (findFragmentById instanceof ViewPagerFragment) {
OTTApplication.playerPresent = false;
if (this.isSearchClicked) {
this.isSearchClicked = false;
int menuPosition = getMenuPosition(this.previousSelectedTab);
TabLayout tabLayout = this.tabLayout;
tabLayout.selectTab(tabLayout.getTabAt(menuPosition), true);
if (this.viewPagerFragment != null) {
MyRecoManager.getInstance().setTAB_NAME(this.viewPagerFragment.selectedTab);
}
}
ImageView imageView2 = this.iV_Gradient_top;
if (imageView2 != null) {
imageView2.setVisibility(8);
}
if (OTTApplication.is_Nav_fav) {
toggleBackButton(false);
setToolbarTitle("");
updateToolbarItems(true, true);
enableHomeToolbar(true);
showBottomBar(true);
}
Fragment fragmentFromViewpager = ((ViewPagerFragment) findFragmentById).getFragmentFromViewpager();
if (fragmentFromViewpager != null && (fragmentFromViewpager instanceof HomeFragment) && this.bottomTabSelected.equalsIgnoreCase("Home") && OTTApplication.isContentPlayed) {
fragmentFromViewpager.onResume();
}
}
if ((findFragmentById instanceof SearchFragmentNew) || (findFragmentById instanceof SearchFragment)) {
toggleBackButton(true);
updateToolbarItems(true, true);
enableHomeToolbar(false);
this.toolbar.setVisibility(0);
} else if (findFragmentById instanceof DetailsFragment) {
toggleBackButton(true);
updateToolbarItems(true, false);
enableHomeToolbar(true);
this.toolbar.setVisibility(8);
} else if (findFragmentById instanceof ShowFilterFragment) {
toggleBackButton(false);
updateToolbarItems(true, false);
enableHomeToolbar(false);
this.toolbar.setVisibility(0);
} else if (backStackEntryCount >= 1) {
toggleBackButton(true);
updateToolbarItems(false, true);
enableHomeToolbar(false);
showBottomBar(false);
} else {
toggleBackButton(false);
setToolbarTitle("");
updateToolbarItems(true, true);
enableHomeToolbar(true);
showBottomBar(true);
}
updateSubscribeimage();
if (findFragmentById instanceof HomeFragment) {
if ((OTTApplication.is_Nav_Tab_fav || OTTApplication.is_Nav_fav) && OTTApplication.is_Nav_meta) {
OTTApplication.is_Nav_Tab_fav = false;
OTTApplication.is_Nav_meta = false;
OTTApplication.is_Nav_fav = false;
HomeFragment homeFragment = (HomeFragment) findFragmentById;
if (homeFragment.isFavourites) {
homeFragment.updateFavourites();
}
}
if (Constants.TAB_CLICKED.equalsIgnoreCase("favourites") || Constants.TAB_CLICKED.equalsIgnoreCase("favourites_mobile")) {
OTTApplication.FAV_FROM_TAB = true;
refreshBingeListPage(Constants.TAB_CLICKED);
}
if (this.isSearchClicked) {
this.isSearchClicked = false;
int menuPosition2 = getMenuPosition(this.previousSelectedTab);
TabLayout tabLayout2 = this.tabLayout;
tabLayout2.selectTab(tabLayout2.getTabAt(menuPosition2), true);
if (this.viewPagerFragment != null) {
MyRecoManager.getInstance().setTAB_NAME(this.viewPagerFragment.previousSelectedTab);
}
}
ImageView imageView3 = this.iV_Gradient_top;
if (imageView3 != null) {
imageView3.setVisibility(8);
}
NavigationUtils.sendAutoPlayResumeBroadCast(this);
NavigationUtils.sendStartAutoScrollBroadCast(this);
if (this.isViewAllBottomSheetDisplayed && (obj = OTTApplication.prevItem) != null) {
NavigationUtils.performItemClickNavigation(null, this, obj, "home_tab", "");
OTTApplication.prevItem = null;
this.isViewAllBottomSheetDisplayed = false;
this.mViewAllFragmentContainer.setVisibility(8);
}
}
findFragmentById.onResume();
}
public void lambda$onCreate$15(Configs configs, View view, int i2, Object obj, int i3, List list) {
String str;
if (i3 != 1) {
if (i3 == 2) {
if (((String) obj).equalsIgnoreCase("nav_languages")) {
trackEvent(AnalyticsV2.EVENT_HAMBURGER_LANGUAGES);
trackHamburgerEvents(AnalyticsUtils.EVENT_PAGE_HAMBURGER, "Languages", this.currentSelectedTab);
launchLanguagesScreen(true);
return;
}
return;
}
if (i3 != 3) {
if (i3 == 4 && !this.isClicked) {
this.isClicked = true;
signOutUser();
return;
}
return;
}
if (view.getId() == R.id.langbrazil) {
trackEvent(AnalyticsV2.EVENT_HAMBURGER_DISPlAY_LANGUAGE + disply_lang);
updatePreferences(disply_lang);
return;
}
if (view.getId() == R.id.langenglish) {
trackEvent(AnalyticsV2.EVENT_HAMBURGER_DISPlAY_LANGUAGE + "ENG");
updatePreferences("ENG");
return;
}
return;
}
if (this.mDrawerLayout != null && !((String) obj).equalsIgnoreCase("nav_sign_out")) {
this.mDrawerLayout.closeDrawers();
}
String str2 = (String) obj;
if (str2.equalsIgnoreCase("nav_help") || str2.equalsIgnoreCase("help")) {
trackEvent(AnalyticsV2.EVENT_HAMBURGER_HELP);
trackHamburgerEvents(AnalyticsUtils.EVENT_PAGE_HAMBURGER, "Help", this.currentSelectedTab);
OTTApplication.isDrawerOpen = true;
NavigationUtils.onBoardWebViewNavigation(this, NavigationConstants.NAV_HELP, null);
return;
}
if (str2.equalsIgnoreCase("nav_aboutus")) {
trackEvent(AnalyticsV2.EVENT_HAMBURGER_ABOUTUS);
trackHamburgerEvents(AnalyticsUtils.EVENT_PAGE_HAMBURGER, "About Us", this.currentSelectedTab);
NavigationUtils.onBoardWebViewNavigation(this, NavigationConstants.NAV_ABOUTUS, null);
return;
}
if (str2.equalsIgnoreCase("nav_privacy_policy")) {
trackEvent(AnalyticsV2.EVENT_HAMBURGER_PRIVACY);
trackHamburgerEvents(AnalyticsUtils.EVENT_PAGE_HAMBURGER, "Privacy Policy", this.currentSelectedTab);
NavigationUtils.onBoardWebViewNavigation(this, NavigationConstants.NAV_FROM_HAMBURGER_PRIVACY, null);
return;
}
if (str2.equalsIgnoreCase("nav_terms_conditions")) {
trackEvent(AnalyticsV2.EVENT_HAMBURGER_TERMS);
trackHamburgerEvents(AnalyticsUtils.EVENT_PAGE_HAMBURGER, "Terms and Conditions", this.currentSelectedTab);
NavigationUtils.onBoardWebViewNavigation(this, NavigationConstants.NAV_FROM_HAMBURGER_TERMS, null);
return;
}
String str3 = "mytransactions";
int i4 = 0;
if (str2.equalsIgnoreCase("mytransactions") || str2.equalsIgnoreCase("my_transactions")) {
OTTApplication.isDrawerOpen = true;
trackHamburgerEvents(AnalyticsUtils.EVENT_PAGE_HAMBURGER, "My Transactions", this.currentSelectedTab);
List<Menu> hmenus = APIUtils.getUtilPreferenceManager(this).getHmenus() != null ? APIUtils.getUtilPreferenceManager(this).getHmenus() : null;
if (hmenus != null) {
while (i4 < hmenus.size()) {
if (!TextUtils.isEmpty(hmenus.get(i4).getCode()) && hmenus.get(i4).getCode().equalsIgnoreCase("my_transactions")) {
str3 = hmenus.get(i4).getTargetPath();
}
i4++;
}
}
launchMyTransactionsPage(str3, NavigationConstants.SOURCE_HAMBURGER_MENU);
return;
}
if (str2.equalsIgnoreCase("nav_faq")) {
trackEvent(AnalyticsV2.EVENT_HAMBURGER_FAQ);
trackHamburgerEvents(AnalyticsUtils.EVENT_PAGE_HAMBURGER, "FAQs", this.currentSelectedTab);
NavigationUtils.onBoardWebViewNavigation(this, NavigationConstants.NAV_FROM_HAMBURGER_FAQ, null);
return;
}
if (str2.equalsIgnoreCase("nav_pricing") || str2.equalsIgnoreCase("plans_offers")) {
OTTApplication.isDrawerOpen = true;
trackEvent(AnalyticsV2.EVENT_HAMBURGER_PAY);
trackHamburgerEvents(AnalyticsUtils.EVENT_PAGE_HAMBURGER, "Packages", this.currentSelectedTab);
DrawerLayout drawerLayout = this.mDrawerLayout;
if (drawerLayout != null) {
drawerLayout.closeDrawers();
}
if (this.preferenceManager == null) {
getPreferenceManager();
}
PreferenceManager preferenceManager = this.preferenceManager;
if ((preferenceManager == null || preferenceManager.getLoggedUser() != null) && this.preferenceManager.getLoggedUser().getStatus().intValue() != 0) {
Fragment fragment = this.mPlayerFragment;
if (fragment instanceof ExoPlayerFragment) {
((ExoPlayerFragment) fragment).stopPlayback();
}
this.mWatchWhileLayout.slideHorizontal(true);
launchWebviewPlansPage(null, null, "hamburger menu subscribe");
return;
}
AnalyticsV2.getInstance().trackEvent(AnalyticsV2.EVENT_PAYMENT_SIGNIN);
if (view != null) {
int i5 = R.string.sourceTag;
if (view.getTag(i5) != null && !TextUtils.isEmpty(view.getTag(i5).toString()) && view.getTag(i5).toString().equalsIgnoreCase("hamburger menu subscribe")) {
str = "hamburger menu subscribe";
NavigationUtils.loadScreenActivityForResult((FragmentActivity) this, ScreenType.SIGNIN, NavigationConstants.NAV_FROM_MENU, (String) null, 12, str, "");
return;
}
}
str = "hamburger menu";
NavigationUtils.loadScreenActivityForResult((FragmentActivity) this, ScreenType.SIGNIN, NavigationConstants.NAV_FROM_MENU, (String) null, 12, str, "");
return;
}
if (str2.equalsIgnoreCase("activate_device")) {
OTTApplication.isDrawerOpen = true;
trackEvent(AnalyticsV2.EVENT_HAMBURGER_ACTIVATE_DEVICE);
trackHamburgerEvents(AnalyticsUtils.EVENT_PAGE_HAMBURGER, "Activate Device", this.currentSelectedTab);
NavigationUtils.onBoardNavigation(view.getContext(), ScreenType.ACTIVATE_DEVICE, (Bundle) null);
return;
}
if (str2.equalsIgnoreCase("nav_contact_us")) {
trackEvent(AnalyticsV2.EVENT_HAMBURGER_CONTACT);
trackHamburgerEvents(AnalyticsUtils.EVENT_PAGE_HAMBURGER, "Contact Us", this.currentSelectedTab);
NavigationUtils.onBoardWebViewNavigation(this, NavigationConstants.NAV_FROM_HAMBURGER_CONTACT, null);
return;
}
if (str2.equalsIgnoreCase("nav_sign_out")) {
trackHamburgerEvents(AnalyticsUtils.EVENT_PAGE_HAMBURGER, "Logout", this.currentSelectedTab);
if (APIUtils.getUtilPreferenceManager(getApplicationContext()).getLoggedUser() == null || this.isClicked) {
return;
}
this.isClicked = true;
signOutUser();
return;
}
if (str2.equalsIgnoreCase("nav_favourites") || str2.equalsIgnoreCase("my_favourite")) {
trackEvent(AnalyticsV2.EVENT_HAMBURGER_FAVORITES);
OTTApplication.isDrawerOpen = true;
OTTApplication.is_nav_drawer = true;
trackHamburgerEvents(AnalyticsUtils.EVENT_PAGE_HAMBURGER, "My Bingelist", this.currentSelectedTab);
DrawerLayout drawerLayout2 = this.mDrawerLayout;
if (drawerLayout2 != null) {
drawerLayout2.closeDrawers();
}
if (APIUtils.getUtilPreferenceManager(getApplicationContext()).getLoggedUser() == null) {
if (!TextUtils.isEmpty(configs.getFavbuttontxt())) {
this.myBingeList = configs.getFavbuttontxt();
}
Toast.makeText((Context) view.getContext(), (CharSequence) getResources().getString(R.string.favourites_signin_toview).replace("favourites", this.myBingeList), 1).show();
return;
}
String favouritesTargetPath = APIUtils.getUtilAppConfigurations(getApplicationContext()).getFavouritesTargetPath();
Bundle bundle = new Bundle();
if (list != null) {
while (i4 < list.size()) {
if (!TextUtils.isEmpty(((Menu) list.get(i4)).getCode()) && ((Menu) list.get(i4)).getCode().equalsIgnoreCase("my_favourite")) {
bundle.putString(NavigationConstants.TITLE, ((Menu) list.get(i4)).getDisplayText());
}
i4++;
}
}
bundle.putString(NavigationConstants.PAGE_TYPE, PageType.List.getValue());
String str4 = NavigationConstants.SCREEN_TYPE;
ScreenType screenType = ScreenType.FAVOURITES;
bundle.putString(str4, screenType.getValue());
bundle.putString(NavigationConstants.MENU_ITEM_CODE, favouritesTargetPath);
bundle.putString(NavigationConstants.SCREENSOURCE, favouritesTargetPath);
NavigationUtils.onBoardNavigation(view.getContext(), screenType, bundle);
return;
}
if (str2.equalsIgnoreCase("nav_languages")) {
trackEvent(AnalyticsV2.EVENT_HAMBURGER_LANGUAGES);
trackHamburgerEvents(AnalyticsUtils.EVENT_PAGE_HAMBURGER, "Languages", this.currentSelectedTab);
launchLanguagesScreen(true);
return;
}
if (str2.equalsIgnoreCase("nav_account") || str2.equalsIgnoreCase("app_settings")) {
trackEvent(AnalyticsV2.EVENT_HAMBURGER_LANGUAGES);
OTTApplication.isDrawerOpen = true;
trackHamburgerEvents(AnalyticsUtils.EVENT_PAGE_HAMBURGER, "App Settings", this.currentSelectedTab);
launchWebViewAccountsPage("Account", null);
return;
}
if (str2.equalsIgnoreCase("nav_pricing") || str2.equalsIgnoreCase("plans_offers")) {
trackEvent(AnalyticsV2.EVENT_HAMBURGER_LANGUAGES);
trackHamburgerEvents(AnalyticsUtils.EVENT_PAGE_HAMBURGER, "Pricing", this.currentSelectedTab);
launchWebviewPlansPage(null, null, "hamburger menu subscribe");
return;
}
if (str2.equalsIgnoreCase("nav_profile")) {
trackEvent(AnalyticsV2.EVENT_HAMBURGER_PROFILE);
trackHamburgerEvents(AnalyticsUtils.EVENT_PAGE_PROFILE, "Profile Information", this.currentSelectedTab);
Bundle bundle2 = new Bundle();
bundle2.putString(NavigationConstants.NAV_FROM, NavigationConstants.NAV_FROM_SETTINGS);
NavigationUtils.onBoardNavigation(view.getContext(), ScreenType.USER_PROFILE, bundle2);
return;
}
if (str2.equalsIgnoreCase("nav_video_quality")) {
String str5 = AnalyticsUtils.EVENT_PAGE_VIDEO_QUALITY;
this.currentSelectedTab = str5;
trackHamburgerEvents(str5, getResources().getString(R.string.video_quality), AnalyticsUtils.EVENT_PAGE_HAMBURGER);
NavigationUtils.onBoardNavigation((FragmentActivity) this, ScreenType.VIDEO_QUALITY, (Bundle) null);
DrawerLayout drawerLayout3 = this.mDrawerLayout;
if (drawerLayout3 != null) {
drawerLayout3.closeDrawers();
return;
}
return;
}
if (str2.equalsIgnoreCase("nav_offline_video")) {
String str6 = AnalyticsUtils.EVENT_MYDOWNLOAD;
this.currentSelectedTab = str6;
trackHamburgerEvents(str6, "My Download", AnalyticsUtils.EVENT_PAGE_HAMBURGER);
DrawerLayout drawerLayout4 = this.mDrawerLayout;
if (drawerLayout4 != null) {
drawerLayout4.closeDrawers();
}
setExpandEnabled(false);
if (APIUtils.getUtilPreferenceManager(getApplicationContext()).getLoggedUser() == null) {
Toast.makeText((Context) view.getContext(), (CharSequence) " Please sign in to view your downloads", 1).show();
return;
}
Bundle bundle3 = new Bundle();
bundle3.putString(NavigationConstants.TITLE, "My Downloads");
bundle3.putString(NavigationConstants.PAGE_TYPE, PageType.List.getValue());
String str7 = NavigationConstants.SCREEN_TYPE;
ScreenType screenType2 = ScreenType.OFFLINE_VIDEO;
bundle3.putString(str7, screenType2.getValue());
NavigationUtils.onBoardNavigation(view.getContext(), screenType2, bundle3);
return;
}
if (str2.equalsIgnoreCase("nav_rateapp")) {
this.currentSelectedTab = "Rate App";
trackHamburgerEvents("Rate App", "Rate App", AnalyticsUtils.EVENT_PAGE_HAMBURGER);
UtilsBase.openAppRating(this);
return;
}
if (str2.equalsIgnoreCase("nav_shareapp")) {
this.currentSelectedTab = "Share App";
trackHamburgerEvents("Share App", "Share App", AnalyticsUtils.EVENT_PAGE_HAMBURGER);
UtilsBase.shareApp(this);
return;
}
if (str2.equalsIgnoreCase("nav_feedback")) {
this.currentSelectedTab = "Feedback";
trackHamburgerEvents("Feedback", "Feedback", AnalyticsUtils.EVENT_PAGE_HAMBURGER);
UtilsBase.openAppRating(this);
return;
}
if (str2.equalsIgnoreCase("nav_content_filter")) {
this.currentSelectedTab = "Content Filter";
updateToolBar(false, "", false, null);
Bundle bundle4 = new Bundle();
bundle4.putString(NavigationConstants.TITLE, "Content Filter");
bundle4.putString(NavigationConstants.PAGE_TYPE, PageType.Content.getValue());
String str8 = NavigationConstants.SCREEN_TYPE;
ScreenType screenType3 = ScreenType.CONTENT_FILTER;
bundle4.putString(str8, screenType3.getValue());
NavigationUtils.onBoardNavigation((FragmentActivity) this, screenType3, bundle4);
return;
}
if (str2.equalsIgnoreCase("nav_Fliter_Content") || str2.equalsIgnoreCase("filter_settings")) {
OTTApplication.isDrawerOpen = true;
this.currentSelectedTab = "Filter Settings";
enableToolBarLogo(false);
showBottomBar(false);
Bundle bundle5 = new Bundle();
trackHamburgerEvents(AnalyticsUtils.EVENT_PAGE_HAMBURGER, "Filter Settings", this.currentSelectedTab);
NavigationUtils.onBoardNavigation((FragmentActivity) this, bundle5, ScreenType.FILTER_CONTENT);
return;
}
handleHamBurgerMenu(true);
trackHamburgerEvents(AnalyticsUtils.EVENT_PAGE_HAMBURGER, this.mAdapter.getMenuItem(i2), this.currentSelectedTab);
trackEvent(AnalyticsV2.EVENT_HAMBURGER + this.mAdapter.getMenuItem(i2));
ViewPagerClickListener viewPagerClickListener = this.clickListener;
if (viewPagerClickListener != null) {
viewPagerClickListener.onClick(view, i2, obj);
}
}
public void lambda$onCreate$16() {
CustomLog.d("DEBUG", "CAlling offline download page");
UiUtils.updateConfigFlags();
Configurations.updateClientConfigurations();
NavigationUtils.onBoardNavigation((FragmentActivity) this, ScreenType.OFFLINE_VIDEO, (Bundle) null);
}
public void lambda$onCreate$17() {
MyRecoManager.getInstance().setOriginMedium("Notification");
MyRecoManager.getInstance().setOriginSource("Notification");
goToDetail(this.mTargetPath);
this.mTargetPath = null;
this.isComingFromNotification = false;
}
public void lambda$onCreate$18() {
try {
DownloadTracker downloadTracker = this.downloadTracker;
if (downloadTracker != null) {
downloadTracker.onCancelDownload(getIntent(), this);
}
} catch (Exception unused) {
}
String targetPath = Preferences.instance(this).getTargetPath();
if (targetPath != null && !targetPath.equalsIgnoreCase("")) {
if (this.mTargetPath.getPath().equals(targetPath)) {
NavigationUtils.performItemClickNavigation(this, this.mTargetPath.getPath(), this.currentSelectedTab);
} else {
NavigationUtils.performItemClickNavigation(this, targetPath, this.currentSelectedTab);
}
}
this.isComingFromCancelNotification = false;
}
public void lambda$onCreate$19(View view) {
onBackPressed();
}
public void lambda$onCreate$2(View view) {
OTTApplication.item = null;
if (!TextUtils.isEmpty(this.weblink)) {
CleverTap.moviesEventClicked("button", "renew subscribe");
if (!this.weblink.contains("http") || OTTApplication.getWebLinkCallback() == null) {
launchWebviewPlansPage("", this.weblink, "renew subscribe");
return;
} else {
OTTApplication.getWebLinkCallback().callWebLink(this.weblink);
finish();
return;
}
}
CleverTap.moviesEventClicked("button", "home subscribe");
if (this.preferenceManager == null) {
getPreferenceManager();
}
PreferenceManager preferenceManager = this.preferenceManager;
if ((preferenceManager == null || preferenceManager.getLoggedUser() != null) && this.preferenceManager.getLoggedUser().getStatus().intValue() != 0) {
launchWebviewPlansPage(null, null, "home subscribe");
} else {
AnalyticsV2.getInstance().trackEvent(AnalyticsV2.EVENT_PAYMENT_SIGNIN);
NavigationUtils.loadScreenActivityForResult((FragmentActivity) this, ScreenType.SIGNIN, NavigationConstants.NAV_FROM_HOME, (String) null, 12, "home subscribe", "");
}
}
public void lambda$onCreate$20(View view) {
onBackPressed();
}
public void lambda$onCreate$3(View view) {
OTTApplication.item = null;
if (!TextUtils.isEmpty(this.weblink)) {
CleverTap.moviesEventClicked("button", "renew subscribe");
if (!this.weblink.contains("http") || OTTApplication.getWebLinkCallback() == null) {
launchWebviewPlansPage("", this.weblink, "renew subscribe");
return;
} else {
OTTApplication.getWebLinkCallback().callWebLink(this.weblink);
finish();
return;
}
}
CleverTap.moviesEventClicked("button", "home subscribe");
if (this.preferenceManager == null) {
getPreferenceManager();
}
PreferenceManager preferenceManager = this.preferenceManager;
if ((preferenceManager == null || preferenceManager.getLoggedUser() != null) && this.preferenceManager.getLoggedUser().getStatus().intValue() != 0) {
launchWebviewPlansPage(null, null, "home subscribe");
} else {
AnalyticsV2.getInstance().trackEvent(AnalyticsV2.EVENT_PAYMENT_SIGNIN);
NavigationUtils.loadScreenActivityForResult((FragmentActivity) this, ScreenType.SIGNIN, NavigationConstants.NAV_FROM_HOME, (String) null, 12, "home subscribe", "");
}
}
public void lambda$onCreate$4(View view) {
if (this.preferenceManager == null) {
getPreferenceManager();
}
PreferenceManager preferenceManager = this.preferenceManager;
if (preferenceManager == null || preferenceManager.getLoggedUser() != null) {
checkAndShowUserProfileDropdown();
} else {
launchSigninPage(true, -1);
}
}
public void lambda$onCreate$5(View view) {
launchPaymentsScreen();
}
public void lambda$onCreate$6(View view) {
trackEvent(AnalyticsV2.EVENT_HOME_PAY);
launchPaymentsScreen();
}
public void lambda$onCreate$7(View view) {
CustomLog.e("HomeFragment", "Unfavourite ");
UnFavouriteSelectedItems();
}
public void lambda$onCreate$8(View view) {
launchLanguagesScreen(true);
}
public void lambda$onCreate$9(View view) {
trackEvent(AnalyticsV2.EVENT_HOME_PAY);
launchPaymentsScreen();
}
public static void lambda$setPromotionalPopup$21(View view) {
}
public void lambda$setPromotionalPopup$22(View view) {
this.mAlertDialog.cancel();
}
public void lambda$updateSubscribeimage$23(String str) {
LottieDrawable lottieDrawable = this.mLottieDrawable2;
if (lottieDrawable != null) {
lottieDrawable.cancelAnimation();
}
this.mLottieDrawable2 = new LottieDrawable();
new Thread(new AnonymousClass14(str, new Handler())).start();
this.mLottieDrawable2.setRepeatCount(-1);
this.downloadLottieAnimationView.setImageDrawable(this.mLottieDrawable2);
if (!this.isPrepaidRenewLottieVisible) {
this.gif_container.setVisibility(8);
this.container_lottie.setVisibility(8);
}
this.subscribed_container_lottie.setVisibility(8);
this.download_container_lottie.setVisibility(0);
this.mLottieDrawable2.start();
}
public void lambda$updateSubscribeimage$24(LottieComposition lottieComposition) {
LottieDrawable lottieDrawable;
if (lottieComposition == null || (lottieDrawable = this.mLottieDrawable) == null) {
return;
}
lottieDrawable.setComposition(lottieComposition);
this.mLottieDrawable.setRepeatCount(-1);
this.lottieAnimationView.setImageDrawable(this.mLottieDrawable);
this.mLottieDrawable.start();
this.container_lottie.setVisibility(0);
}
public void lambda$updateSubscribeimage$25(Throwable th) {
this.mLottieDrawable.playAnimation();
CustomLog.e("LottieError", "Failed to load Lottie composition" + th);
}
public void lambda$updateSubscribeimage$26(LottieTask lottieTask) {
if (lottieTask != null) {
lottieTask.addListener(new LottieListener() {
public final void onResult(Object obj) {
FusionViliteMainActivity.this.lambda$updateSubscribeimage$24((LottieComposition) obj);
}
}).addFailureListener(new LottieListener() {
public final void onResult(Object obj) {
FusionViliteMainActivity.this.lambda$updateSubscribeimage$25((Throwable) obj);
}
});
}
}
public void lambda$updateSubscribeimage$27(String str, Handler handler) {
final LottieTask fromUrl = LottieCompositionFactory.fromUrl(OTTApplication.getContext(), str, (String) null);
handler.postDelayed(new Runnable() {
@Override
public final void run() {
FusionViliteMainActivity.this.lambda$updateSubscribeimage$26(fromUrl);
}
}, 200L);
}
public void lambda$updateSubscribeimage$28(final String str) {
LottieDrawable lottieDrawable = this.mLottieDrawable;
if (lottieDrawable != null) {
lottieDrawable.cancelAnimation();
}
this.mLottieDrawable = new LottieDrawable();
final Handler handler = new Handler();
new Thread(new Runnable() {
@Override
public final void run() {
FusionViliteMainActivity.this.lambda$updateSubscribeimage$27(str, handler);
}
}).start();
this.subscribed_button_iv.setVisibility(8);
this.subscribed_container_lottie.setVisibility(8);
this.download_container_lottie.setVisibility(8);
this.subscriber_menu.setVisibility(8);
if (this.isPrepaidRenewLottieVisible) {
return;
}
this.gif_container.setVisibility(8);
}
public void launchAccountPage() {
enableToolBarLogo(false);
Bundle bundle = new Bundle();
ListFragment listFragment = new ListFragment();
bundle.putSerializable("type", ListType.SETTINGS_MENU);
listFragment.setArguments(bundle);
loadFragment(listFragment, "");
}
private void launchPaymentsScreen() {
NavigationUtils.loadScreenActivityForResult((FragmentActivity) this, ScreenType.PAYMENTS, NavigationConstants.NAV_FROM_SETTINGS, 29, "", "");
}
private void launchUserProfilesPage() {
Intent intent = new Intent((Context) this, (Class<?>) LoadScreenActivity.class);
intent.putExtra(NavigationConstants.SCREEN_TYPE, ScreenType.USER_PROFILES);
intent.putExtra(NavigationConstants.NAV_FROM, NavigationConstants.FROM_INTRO);
startActivity(intent);
finish();
}
private void launchWebViewAccountsPage(String str, String str2) {
final ArrayList arrayList = new ArrayList();
if (OttSDK.getInstance() != null) {
OttSDK.getInstance().getPaymentManager().getActivePackages(new PaymentManager.PaymentCallback<List<ActivePackagesResponse>>() {
@Override
public void onFailure(Error error) {
NavigationUtils.logKibanaError("FusionViliteMainActivity", "API", "/service/api/auth/user/activepackages", "NA", "NA", "NA", f.a(error, new StringBuilder("")), error.getMessage());
NavigationUtils.loadScreenActivityForResult((FragmentActivity) FusionViliteMainActivity.this, ListType.ACCOUNT_MENU, arrayList, NavigationConstants.NAV_FROM_SETTINGS, 29, "");
}
@Override
public void onSuccess(List<ActivePackagesResponse> list) {
if (list != null && list.size() > 0) {
List list2 = arrayList;
if (list2 != null && list2.size() > 0) {
arrayList.clear();
}
arrayList.addAll(list);
}
NavigationUtils.loadScreenActivityForResult((FragmentActivity) FusionViliteMainActivity.this, ListType.ACCOUNT_MENU, arrayList, NavigationConstants.NAV_FROM_SETTINGS, 29, "");
}
});
}
}
private void launchWebviewForUsrProfiles() {
Configs utilAppConfigurations = APIUtils.getUtilAppConfigurations(getApplicationContext());
String siteURL = (utilAppConfigurations == null || utilAppConfigurations.getSiteURL() == null) ? "" : utilAppConfigurations.getSiteURL();
if (this.preferenceManager == null) {
getPreferenceManager();
}
PreferenceManager preferenceManager = this.preferenceManager;
if (preferenceManager == null) {
Toast.makeText((Context) this, (CharSequence) "Something went wrong", 0).show();
hideProgressBar();
return;
}
String sessionId = preferenceManager.getSessionId() != null ? this.preferenceManager.getSessionId() : "";
String deviceUniqueId = this.preferenceManager.getDeviceUniqueId() != null ? this.preferenceManager.getDeviceUniqueId() : "";
String encodeToString = Base64.encodeToString(("bi===" + deviceUniqueId + "&&&si===" + sessionId + "&&&ci===" + this.preferenceManager.getYuppDeviceId() + "&&&theme===w&&&mp===true&&&ucv===15").getBytes(), 0);
try {
encodeToString = URLEncoder.encode(encodeToString, "UTF-8");
} catch (UnsupportedEncodingException unused) {
}
String a = siteURL.endsWith("/") ? b.a(siteURL, "profiles/manage-user-profile?ut=", encodeToString) : b.a(siteURL, "/profiles/manage-user-profile?ut=", encodeToString);
g.a("siteurl ", a, "DEBUG");
NavigationUtils.onBoardWebViewNavigationForResult((FragmentActivity) this, NavigationConstants.NAV_ACCOUNT, a, true);
hideProgressBar();
}
private void loadBannerAd(String str) {
Configs utilAppConfigurations = APIUtils.getUtilAppConfigurations(getApplicationContext());
if (utilAppConfigurations != null && utilAppConfigurations.getBannerAdUnitIdAndroid() != null) {
str = utilAppConfigurations.getBannerAdUnitIdAndroid();
}
if (str.trim().isEmpty() || this.bannerAdUnit.equalsIgnoreCase(str)) {
return;
}
this.bannerAdUnit = str;
if (str.trim().length() > 1) {
AdManagerAdView adManagerAdView = new AdManagerAdView(this);
this.mBannerAdView = adManagerAdView;
adManagerAdView.setAdSize(AdSize.BANNER);
this.mBannerAdView.setAdUnitId(str);
BaseActivity.bannerAdsLayout.addView(this.mBannerAdView);
AdManagerAdView adManagerAdView2 = this.mBannerAdView;
if (adManagerAdView2 != null) {
requestBannerAd(adManagerAdView2, this);
}
}
}
public boolean loadFragment(Fragment fragment, String str) {
List<Menu> list;
Constants.TAB_CLICKED = "";
String simpleName = fragment.getClass().getSimpleName();
if (fragment instanceof HomeFragment) {
simpleName = "HomeFragment" + str;
this.isViewPagerFragment = false;
} else if ((fragment instanceof ViewPagerFragment) && (list = this.mMenuList) != null && list.size() > 0) {
simpleName = "ViewPagerFragment" + str;
this.isViewPagerFragment = true;
}
OTTApplication.is_Nav_Tab_fav = !str.equalsIgnoreCase("sports");
Fragment findFragmentByTag = getSupportFragmentManager().findFragmentByTag(simpleName);
NavigationUtils.sendAutoPlayPauseBroadCast(this);
NavigationUtils.sendStopAutoScrollBroadCast(this);
if (findFragmentByTag != null) {
if (this.currentSelectedFragment != null) {
if (str.equalsIgnoreCase("favourites")) {
OTTApplication.FAV_FROM_TAB = true;
Constants.TAB_CLICKED = str;
refreshBingeListPage(str);
} else if (str.equalsIgnoreCase("sports")) {
Constants.TAB_CLICKED = str;
refresh_sportsPage();
}
getSupportFragmentManager().beginTransaction().hide(this.currentSelectedFragment).show(findFragmentByTag).commitAllowingStateLoss();
this.currentSelectedFragment = findFragmentByTag;
if ((findFragmentByTag instanceof HomeFragment) && findFragmentByTag.getTag().equalsIgnoreCase("HomeFragmenthome") && OTTApplication.isContentPlayed && !OTTApplication.IS_PLAYER_PRESENT) {
((HomeFragment) findFragmentByTag).getPageSectionContent();
}
} else {
getSupportFragmentManager().beginTransaction().show(findFragmentByTag).commitAllowingStateLoss();
this.currentSelectedFragment = findFragmentByTag;
}
NavigationUtils.sendAutoPlayResumeBroadCast(this);
NavigationUtils.sendStartAutoScrollBroadCast(this);
} else {
FragmentTransaction beginTransaction = getSupportFragmentManager().beginTransaction();
Fragment fragment2 = this.currentSelectedFragment;
if (fragment2 != null) {
beginTransaction.hide(fragment2);
}
beginTransaction.add(R.id.contentframe, fragment, simpleName).commitAllowingStateLoss();
this.currentSelectedFragment = fragment;
}
if (!(fragment instanceof ListFragment)) {
this.isProfilesOpen = false;
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
FusionViliteMainActivity fusionViliteMainActivity = FusionViliteMainActivity.this;
if (fusionViliteMainActivity.currentSelectedFragment instanceof ListFragment) {
return;
}
fusionViliteMainActivity.updateToolBar(false, "", false, null);
}
}, 500L);
}
return true;
}
private void loadInterstitialAd(String str) {
if (str == null || UiUtils.showLocalAds) {
return;
}
InterstitialAd.load(this, str, new AdRequest.Builder().build(), new InterstitialAdLoadCallback() {
public void onAdFailedToLoad(@NonNull LoadAdError loadAdError) {
CustomLog.d("DFP ADS", "onAdError" + loadAdError.toString());
FusionViliteMainActivity.this.interstitialAd = null;
}
public void onAdLoaded(@NonNull InterstitialAd interstitialAd) {
FusionViliteMainActivity.this.interstitialAd = interstitialAd;
CustomLog.d("DFP ADS", "onAdLoaded");
interstitialAd.setFullScreenContentCallback(new FullScreenContentCallback() {
public void onAdDismissedFullScreenContent() {
FusionViliteMainActivity.this.interstitialAd = null;
}
public void onAdFailedToShowFullScreenContent(AdError adError) {
FusionViliteMainActivity.this.interstitialAd = null;
}
public void onAdShowedFullScreenContent() {
}
});
}
});
InterstitialAd interstitialAd = this.interstitialAd;
if (interstitialAd != null) {
interstitialAd.show(this);
}
}
private void loadUserProfilesData(List<User.ProfileParentalDetails> list) {
LinearLayout linearLayout = this.userProfilesLayout;
if (linearLayout != null && linearLayout.getChildCount() > 0) {
this.userProfilesLayout.removeAllViews();
}
LayoutInflater from = LayoutInflater.from(this);
if (list != null) {
for (final User.ProfileParentalDetails profileParentalDetails : list) {
CustomLog.d("DEBUG", "profiles " + profileParentalDetails.getName());
View inflate = from.inflate(R.layout.item_user_profile_setting_page, (ViewGroup) null);
AppCompatImageView findViewById = inflate.findViewById(R.id.profile_icon);
AppCompatImageView findViewById2 = inflate.findViewById(R.id.profile_lock);
AppCompatTextView findViewById3 = inflate.findViewById(R.id.profile_name);
if (profileParentalDetails.getName() != null && !profileParentalDetails.getName().trim().isEmpty()) {
findViewById3.setText(profileParentalDetails.getName());
}
if (profileParentalDetails.getImageUrl() != null && !profileParentalDetails.getImageUrl().trim().isEmpty()) {
RequestBuilder load = Glide.with(getApplicationContext()).load(APIUtils.getAbsoluteImagePath(getApplicationContext(), profileParentalDetails.getImageUrl()));
int i2 = R.drawable.ic_user_profile_default;
load.placeholder(i2).error(i2).transform(new Transformation[]{new CenterCrop(), new RoundedCorners((int) getResources().getDimension(R.dimen.margin_default_2))}).into(findViewById);
}
if (profileParentalDetails.getProfileLockActive() != null && profileParentalDetails.getProfileLockActive().booleanValue()) {
CustomLog.d("DEBUG", "profiles " + profileParentalDetails.getProfileLockActive());
findViewById2.setVisibility(0);
}
inflate.setTag(profileParentalDetails);
inflate.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
FusionViliteMainActivity.this.lambda$loadUserProfilesData$29(profileParentalDetails, view);
}
});
this.userProfilesLayout.addView(inflate);
}
}
View inflate2 = from.inflate(R.layout.user_profiles_divider_item, (ViewGroup) null);
int i3 = R.layout.simple_button_item;
View inflate3 = from.inflate(i3, (ViewGroup) null);
int i4 = R.id.button;
AppCompatTextView findViewById4 = inflate3.findViewById(i4);
findViewById4.setText(getResources().getString(R.string.exit_profiles_text));
Resources resources = getResources();
int i5 = R.color.user_profile_title_color;
findViewById4.setTextColor(resources.getColor(i5));
findViewById4.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
FusionViliteMainActivity.this.lambda$loadUserProfilesData$30(view);
}
});
View inflate4 = from.inflate(i3, (ViewGroup) null);
AppCompatTextView findViewById5 = inflate4.findViewById(i4);
findViewById5.setText(getResources().getString(R.string.manage_profiles_btn_text));
findViewById5.setTextColor(getResources().getColor(i5));
findViewById5.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
FusionViliteMainActivity.this.lambda$loadUserProfilesData$31(view);
}
});
this.userProfilesLayout.addView(inflate2);
this.userProfilesLayout.addView(inflate3);
this.userProfilesLayout.addView(inflate4);
}
public void logOut() {
if (this.preferenceManager == null) {
getPreferenceManager();
}
User loggedUser = this.preferenceManager.getLoggedUser();
final String phoneNumber = (loggedUser == null || loggedUser.getUserId() == null) ? "" : loggedUser.getPhoneNumber();
showProgressBar();
if (OttSDK.getInstance() != null) {
OttSDK.getInstance().getUserManager().logout(new UserManager.UserCallback<String>() {
@Override
public void onEmptySuccess() {
com.yupptv.ottsdk.managers.User.a.a(this);
}
@Override
public void onFailure(Error error) {
NavigationUtils.logKibanaError("FusionViliteMainActivity", "API", "/service/api/auth/signout", "NA", "NA", "NA", f.a(error, new StringBuilder("")), error.getMessage());
FusionViliteMainActivity fusionViliteMainActivity = FusionViliteMainActivity.this;
if (fusionViliteMainActivity == null) {
return;
}
fusionViliteMainActivity.hideProgressBar();
}
@Override
public void onSuccess(String str) {
CleverTap.moviesEventSignoutCompleted(phoneNumber);
FusionViliteMainActivity.this.hideProgressBar();
FusionViliteMainActivity fusionViliteMainActivity = FusionViliteMainActivity.this;
if (fusionViliteMainActivity.preferenceManager == null) {
fusionViliteMainActivity.getPreferenceManager();
}
PreferenceManager preferenceManager = FusionViliteMainActivity.this.preferenceManager;
if (preferenceManager != null) {
User loggedUser2 = preferenceManager.getLoggedUser();
UiUtils.deleteContentOnSignout(OTTApplication.getInstance(FusionViliteMainActivity.this), loggedUser2 != null ? "" + loggedUser2.getUserId() : "");
FusionViliteMainActivity.this.preferenceManager.setLoggedInUser("");
FusionViliteMainActivity.this.preferenceManager.setPreferedLanguages("");
FusionViliteMainActivity.this.preferenceManager.setPreferedMultiLanguages("");
}
OTTApplication.getInstance(FusionViliteMainActivity.this).getRecordDataTracker().clear();
try {
SparseArray<OfflineDownloadData> sparseArray = DownloadTracker.offlineDownloadDataList;
if (sparseArray != null) {
int size = sparseArray.size();
if (size > 0) {
for (int i2 = 0; i2 < size; i2++) {
try {
if (FusionViliteMainActivity.this.downloadTracker != null) {
FusionViliteMainActivity.this.downloadTracker.onCancelDownload(sparseArray.valueAt(i2));
}
} catch (Exception unused) {
}
}
}
}
} catch (Exception unused2) {
}
InAppNotificationListener inAppNotificationListener = FusionViliteMainActivity.this;
if (inAppNotificationListener == null) {
return;
}
Preferences.instance(inAppNotificationListener).setStringPreference("languageSelected", "");
Preferences.instance(FusionViliteMainActivity.this).setStringPreference("genreSelected", "");
Preferences.instance(FusionViliteMainActivity.this).setDefaultLanguageCode("");
FusionViliteMainActivity.this.restartActivity();
}
});
}
}
public void performDeeplinkOperation() {
Intent intent = this.intent_mainActivity;
String stringExtra = intent != null ? intent.getStringExtra("deeplink_path") : "";
if (TextUtils.isEmpty(stringExtra)) {
return;
}
if (!isTabDeeplink(stringExtra)) {
NavigationUtils.performItemClickNavigation(null, this, stringExtra, "");
} else if (this.isSubMenuTab) {
this.tabname = stringExtra;
} else {
this.bottomTabPosition = getMenuPosition(stringExtra);
}
}
private void prepareAds() {
ViewPagerFragment viewPagerFragment;
if (!UiUtils.showAds || this.adsHashMap == null || (viewPagerFragment = this.viewPagerFragment) == null) {
return;
}
if (viewPagerFragment.getFragmentFromViewpager() != null && (this.viewPagerFragment.getFragmentFromViewpager() instanceof HomeFragment)) {
Fragment fragmentFromViewpager = this.viewPagerFragment.getFragmentFromViewpager();
if (fragmentFromViewpager instanceof HomeFragment) {
String str = ((HomeFragment) fragmentFromViewpager).targetPage;
}
}
HashMap<String, AdUrlResponse> hashMap = this.adsHashMap;
StringBuilder sb = new StringBuilder("adtab_");
ViewPagerFragment viewPagerFragment2 = this.viewPagerFragment;
sb.append(viewPagerFragment2.getCurrentMainMenuTargetPath(viewPagerFragment2.getCurrentTab()));
if (hashMap.containsKey(sb.toString())) {
HashMap<String, AdUrlResponse> hashMap2 = this.adsHashMap;
StringBuilder sb2 = new StringBuilder("adtab_");
ViewPagerFragment viewPagerFragment3 = this.viewPagerFragment;
sb2.append(viewPagerFragment3.getCurrentMainMenuTargetPath(viewPagerFragment3.getCurrentTab()));
AdUrlResponse adUrlResponse = hashMap2.get(sb2.toString());
if (adUrlResponse == null) {
return;
}
List<AdUrlType> adUrlTypes = adUrlResponse.getAdUrlTypes();
if (adUrlTypes == null || adUrlTypes.size() <= 0) {
CustomLog.e("DFP ADS", "No Key/Values in HashMap");
RelativeLayout relativeLayout = BaseActivity.bannerAdsLayout;
if (relativeLayout != null) {
relativeLayout.setVisibility(8);
return;
}
return;
}
UiUtils.showAds = true;
boolean z = false;
for (int i2 = 0; i2 < adUrlTypes.size(); i2++) {
if (adUrlTypes.get(i2).getUrlType().equalsIgnoreCase(AdsType.Banner.toString()) && UiUtils.showBannerAds) {
loadBannerAd(adUrlTypes.get(i2).getAdUnitId());
StringBuilder sb3 = new StringBuilder("banner ad available for adtab_");
ViewPagerFragment viewPagerFragment4 = this.viewPagerFragment;
sb3.append(viewPagerFragment4.getCurrentMainMenuTargetPath(viewPagerFragment4.getCurrentTab()));
CustomLog.e("DFP ADS", sb3.toString());
z = true;
} else if (adUrlTypes.get(i2).getUrlType().equalsIgnoreCase(AdsType.Interstitial.toString()) && UiUtils.showInterstitialAds) {
loadInterstitialAd(adUrlTypes.get(i2).getAdUnitId());
StringBuilder sb4 = new StringBuilder("interstitial ad available for adtab_");
ViewPagerFragment viewPagerFragment5 = this.viewPagerFragment;
sb4.append(viewPagerFragment5.getCurrentMainMenuTargetPath(viewPagerFragment5.getCurrentTab()));
CustomLog.e("DFP ADS", sb4.toString());
} else if (adUrlTypes.get(i2).getUrlType().equalsIgnoreCase(AdsType.Native.toString()) && UiUtils.showNativeAds && this.viewPagerFragment.getFragmentFromViewpager() != null && (this.viewPagerFragment.getFragmentFromViewpager() instanceof HomeFragment)) {
final AdUrlType.Position position = adUrlTypes.get(i2).getPosition();
final String adUnitId = adUrlTypes.get(i2).getAdUnitId();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
((HomeFragment) FusionViliteMainActivity.this.viewPagerFragment.getFragmentFromViewpager()).loadNativeAds(position, adUnitId);
}
}, 200L);
StringBuilder sb5 = new StringBuilder("interstitial ad available for adtab_");
ViewPagerFragment viewPagerFragment6 = this.viewPagerFragment;
sb5.append(viewPagerFragment6.getCurrentMainMenuTargetPath(viewPagerFragment6.getCurrentTab()));
CustomLog.d("DFP ADS", sb5.toString());
}
}
if (!z) {
StringBuilder sb6 = new StringBuilder("not banner ad for adtab_");
ViewPagerFragment viewPagerFragment7 = this.viewPagerFragment;
sb6.append(viewPagerFragment7.getCurrentMainMenuTargetPath(viewPagerFragment7.getCurrentTab()));
CustomLog.e("DFP ADS", sb6.toString());
}
RelativeLayout relativeLayout2 = BaseActivity.bannerAdsLayout;
if (relativeLayout2 != null) {
relativeLayout2.setVisibility(z ? 0 : 8);
}
}
}
public void refreshAfterDark() {
TabLayout tabLayout = this.tabLayout;
String obj = tabLayout.getTabAt(tabLayout.getSelectedTabPosition()).getTag().toString();
if (obj == null || !obj.trim().equalsIgnoreCase("after_dark")) {
return;
}
FragmentManager supportFragmentManager = getSupportFragmentManager();
int i2 = R.id.contentframe;
if (supportFragmentManager.findFragmentById(i2) instanceof HomeFragment) {
Fragment findFragmentById = getSupportFragmentManager().findFragmentById(i2);
if (findFragmentById instanceof HomeFragment) {
HomeFragment homeFragment = (HomeFragment) findFragmentById;
homeFragment.isPinSuccess = true;
Preferences.instance(OTTApplication.getContext()).setAfterDarkExpiry(System.currentTimeMillis());
homeFragment.refreshData(false);
}
}
}
private void refreshBingeListPage(String str) {
Fragment findFragmentByTag = getSupportFragmentManager().findFragmentByTag("HomeFragment" + str);
if (findFragmentByTag != null) {
updateTargetPage(findFragmentByTag, Constants.TAB_CLICKED);
((HomeFragment) findFragmentByTag).requestSectionMetaData(false);
}
}
private void refreshSections() {
FragmentManager supportFragmentManager = getSupportFragmentManager();
int i2 = R.id.contentframe;
if (supportFragmentManager.findFragmentById(i2) instanceof ViewPagerFragment) {
refreshPager();
this.doSectionsRefresh = false;
} else if (!(getSupportFragmentManager().findFragmentById(i2) instanceof GridFragment) || (getSupportFragmentManager().findFragmentById(i2) instanceof DetailsFragment)) {
this.doSectionsRefresh = true;
} else {
this.doSectionsRefresh = false;
}
}
public void refreshWatchlist() {
TabLayout tabLayout = this.tabLayout;
String obj = tabLayout.getTabAt(tabLayout.getSelectedTabPosition()).getTag().toString();
if (obj != null) {
if (obj.trim().equalsIgnoreCase("watchlist") || obj.trim().equalsIgnoreCase("my_watchlist")) {
FragmentManager supportFragmentManager = getSupportFragmentManager();
int i2 = R.id.contentframe;
if (supportFragmentManager.findFragmentById(i2) instanceof HomeFragment) {
Fragment findFragmentById = getSupportFragmentManager().findFragmentById(i2);
if (findFragmentById instanceof HomeFragment) {
((HomeFragment) findFragmentById).refreshData(true);
}
}
}
}
}
private void refresh_sportsPage() {
Fragment findFragmentByTag = getSupportFragmentManager().findFragmentByTag("HomeFragmentsports");
if (findFragmentByTag != null) {
updateTargetPage(findFragmentByTag, Constants.TAB_CLICKED);
((HomeFragment) findFragmentByTag).requestSectionMetaData(false);
}
}
public void restartActivity() {
Intent intent = getIntent();
intent.putExtra("fromSignup", false);
intent.putExtra("isRestarted", true);
intent.setAction("android.intent.action.MAIN");
overridePendingTransition(0, 0);
finish();
startActivity(intent);
overridePendingTransition(0, 0);
}
public void searchPageNavigation() {
Configs utilAppConfigurations = APIUtils.getUtilAppConfigurations(getApplicationContext());
Fragment searchFragment = (utilAppConfigurations == null || utilAppConfigurations.getSearchStaticMenus() == null || utilAppConfigurations.getSearchStaticMenus().trim().length() <= 0) ? new SearchFragment() : new SearchFragmentNew();
this.main_layout.setBackgroundColor(getResources().getColor(R.color.search_suggestions_bg_color));
this.searchFragment = searchFragment;
this.currentSelectedFragment = searchFragment;
showBottomBar(false);
enableToolBarLogo(false);
NavigationUtils.sendAutoPlayPauseBroadCast(this);
NavigationUtils.sendStopAutoScrollBroadCast(this);
getSupportFragmentManager().beginTransaction().add(R.id.contentframe, searchFragment, searchFragment.getClass().getSimpleName()).addToBackStack(searchFragment.getClass().getSimpleName()).commitAllowingStateLoss();
String str = this.currentSelectedTab;
if (str != null && !str.equalsIgnoreCase(AnalyticsUtils.ATTRIBUTE_VALUE_SOURCE_SETTINGS_PAGE)) {
HashMap hashMap = new HashMap();
hashMap.put(AnalyticsUtils.ATTRIBUTE_SOURCE_MENU, this.currentSelectedTab);
CustomLog.e("TAG", "#ATTRIBUTE_SOURCE_MENU : " + this.currentSelectedTab);
AnalyticsUtils.getInstance().trackAnalyticsEvent(ScreenType.SETTINGS, null, null, null, AnalyticsUtils.EVENT_PAGE_SETTINGS, null, hashMap);
}
this.currentSelectedTab = AnalyticsUtils.ATTRIBUTE_VALUE_SOURCE_SETTINGS_PAGE;
}
private void setArrowImage() {
if (this.preferenceManager == null) {
getPreferenceManager();
}
PreferenceManager preferenceManager = this.preferenceManager;
if (preferenceManager == null || preferenceManager.getLoggedUser() == null) {
this.rightArrow.setBackground(getResources().getDrawable(R.drawable.right_arrow));
} else if (this.isProfilesOpen) {
this.rightArrow.setBackground(getResources().getDrawable(R.drawable.ic_profile_arrow_up));
} else {
this.rightArrow.setBackground(getResources().getDrawable(R.drawable.ic_down_arrow));
}
}
private void setBannerAdsMargin() {
RelativeLayout relativeLayout = BaseActivity.bannerAdsLayout;
if (relativeLayout != null && relativeLayout.getVisibility() == 0) {
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) BaseActivity.bannerAdsLayout.getLayoutParams();
layoutParams.bottomMargin = this.bannerAdsBottomMargin;
BaseActivity.bannerAdsLayout.setLayoutParams(layoutParams);
}
LinearLayout linearLayout = this.torcai_footer_adRL;
if (linearLayout == null || linearLayout.getVisibility() != 0) {
return;
}
RelativeLayout.LayoutParams layoutParams2 = (RelativeLayout.LayoutParams) this.torcai_footer_adRL.getLayoutParams();
layoutParams2.bottomMargin = this.bannerAdsBottomMargin;
this.torcai_footer_adRL.setLayoutParams(layoutParams2);
}
private void setExpandEnabled(boolean z) {
ViewGroup.LayoutParams layoutParams = (AppBarLayout.LayoutParams) this.collapsingToolbarLayout.getLayoutParams();
if (z) {
layoutParams.setScrollFlags(3);
this.detailHeaderLayout.setVisibility(0);
expandToolbar(true, false);
} else {
this.detailHeaderLayout.setVisibility(8);
layoutParams.setScrollFlags(21);
expandToolbar(true, true);
if (getSupportFragmentManager().getBackStackEntryCount() < 1) {
updateToolBarTheme(1, true);
}
}
layoutParams.setScrollFlags(0);
this.collapsingToolbarLayout.setLayoutParams(layoutParams);
}
private void setPromotionalPopup(String str) {
View inflate;
try {
if (TextUtils.isEmpty(str) || (inflate = LayoutInflater.from(getApplicationContext()).inflate(R.layout.popup_promotional, (ViewGroup) null)) == null) {
return;
}
ImageView imageView = (ImageView) inflate.findViewById(R.id.coverposter_tvod);
Button button = (Button) inflate.findViewById(R.id.recharge_plan_install);
ImageView imageView2 = (ImageView) inflate.findViewById(R.id.cancel_plan);
TextView textView = (TextView) inflate.findViewById(R.id.recharge_desc);
TextView textView2 = (TextView) inflate.findViewById(R.id.recharge_desc1);
int i2 = R.string.install_desc_text;
textView.setText(i2);
textView2.setText(i2);
if (Arrays.asList(textView.getText().toString().split(" ")).size() > 50) {
textView.setVisibility(0);
textView2.setVisibility(8);
} else {
textView.setVisibility(8);
textView2.setVisibility(0);
}
imageView.setClipToOutline(true);
if (TextUtils.isEmpty(str)) {
imageView.setImageResource(R.drawable.default_banner);
} else {
Glide.with(getApplicationContext()).load(APIUtils.getAbsoluteImagePath(getApplicationContext(), str)).into(imageView);
}
AlertDialog.Builder title = new AlertDialog.Builder(this).setView(inflate).setTitle("");
if (!isFinishing()) {
this.mAlertDialog = title.show();
}
AlertDialog alertDialog = this.mAlertDialog;
if (alertDialog != null) {
alertDialog.setCancelable(false);
}
button.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
FusionViliteMainActivity.lambda$setPromotionalPopup$21(view);
}
});
imageView2.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
FusionViliteMainActivity.this.lambda$setPromotionalPopup$22(view);
}
});
} catch (Exception unused) {
}
}
private void setToolbarTitle(String str) {
this.toolbar_title.setText(str);
if (TextUtils.isEmpty(str)) {
this.toolbar.setVisibility(0);
this.toolbar_logo.setVisibility(0);
} else {
this.toolbar.setVisibility(8);
this.toolbar_logo.setVisibility(8);
}
this.toolbar.setLogo((Drawable) null);
}
private void setUserProfilesArrowImage() {
if (this.preferenceManager == null) {
getPreferenceManager();
}
PreferenceManager preferenceManager = this.preferenceManager;
if (preferenceManager == null || preferenceManager.getLoggedUser() == null) {
this.loggedInLayoutArrow.setImageDrawable(getResources().getDrawable(R.drawable.right_arrow));
} else if (this.isProfilesOpen) {
this.loggedInLayoutArrow.setImageDrawable(getResources().getDrawable(R.drawable.ic_profile_arrow_up));
} else {
this.loggedInLayoutArrow.setImageDrawable(getResources().getDrawable(R.drawable.ic_down_arrow));
}
}
public void setVisibilityOfTabIndicator(TabLayout.Tab tab, int i2) {
if (tab == null || tab.getTag() == null) {
return;
}
tab.getCustomView().findViewById(R.id.selected_tab_indicator).setVisibility(i2);
}
public void showCastMiniController(boolean z) {
this.isChromeCastMinimized = z;
if (!z) {
this.mbottomLayout.setVisibility(8);
} else {
this.mbottomLayout.setVisibility(0);
updateUI(this.dimen_110dp);
}
}
public void showGatewayBlockDialog(String str, String str2) {
Dialog dialog = new Dialog(this);
this.dialog = dialog;
dialog.requestWindowFeature(1);
this.dialog.setContentView(R.layout.cancel_subscription_popup);
this.dialog.getWindow().setLayout((int) (getResources().getDisplayMetrics().widthPixels * 0.9d), -2);
this.dialog.setCanceledOnTouchOutside(false);
TextView textView = (TextView) this.dialog.findViewById(R.id.headerTitle);
TextView textView2 = (TextView) this.dialog.findViewById(R.id.cancel_description);
if (str != null && str.trim().length() > 0) {
textView.setText(str);
}
if (str2 == null || str2.trim().length() <= 0) {
textView2.setVisibility(8);
} else {
textView2.setText(str2);
}
this.dialog.findViewById(R.id.no).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (FusionViliteMainActivity.this.dialog != null) {
FusionViliteMainActivity.this.dialog.dismiss();
}
}
});
this.dialog.show();
}
private void showInterstitialStaticDialog() {
Dialog dialog = new Dialog(this);
this.dialog = dialog;
dialog.setContentView(R.layout.splashscreenpopup);
this.dialog.getWindow().setBackgroundDrawableResource(R.color.transparent);
this.dialog.setCancelable(true);
this.dialog.setCanceledOnTouchOutside(false);
this.dialog.getWindow().setLayout((int) (getResources().getDisplayMetrics().widthPixels * 0.9d), (int) (getResources().getDisplayMetrics().heightPixels * 0.85d));
this.dialog.getWindow().setGravity(17);
RecyclerView findViewById = this.dialog.findViewById(R.id.ads_items);
ImageView imageView = (ImageView) this.dialog.findViewById(R.id.closebtn);
TextView textView = (TextView) this.dialog.findViewById(R.id.title1);
TextView textView2 = (TextView) this.dialog.findViewById(R.id.subtitle);
final CardView findViewById2 = this.dialog.findViewById(R.id.cardview);
Configs utilAppConfigurations = APIUtils.getUtilAppConfigurations(getApplicationContext());
if (utilAppConfigurations != null && utilAppConfigurations.getInterstitialStaticPopup() != null) {
AdsResponse adObjectFromString = UiUtils.getAdObjectFromString(utilAppConfigurations.getInterstitialStaticPopup());
textView.setText(adObjectFromString.getTitle());
textView2.setText(adObjectFromString.getSubtitle());
InterstitialStaticPopupAdapter interstitialStaticPopupAdapter = new InterstitialStaticPopupAdapter(this, adObjectFromString.getButtons());
findViewById.setHasFixedSize(true);
findViewById.setLayoutManager(new LinearLayoutManager(this));
findViewById.setAdapter(interstitialStaticPopupAdapter);
if (adObjectFromString.getBackGroundImagePathMobile() != null) {
Glide.with(getApplicationContext()).asBitmap().load(adObjectFromString.getBackGroundImagePathMobile()).centerCrop().into(new SimpleTarget<Bitmap>() {
public void onResourceReady(@NonNull Object obj, @Nullable Transition transition) {
onResourceReady((Bitmap) obj, (Transition<? super Bitmap>) transition);
}
public void onResourceReady(@NonNull Bitmap bitmap, @Nullable Transition<? super Bitmap> transition) {
FusionViliteMainActivity.this.dialog.show();
findViewById2.setBackground(new BitmapDrawable(FusionViliteMainActivity.this.getResources(), bitmap));
}
});
}
}
imageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (FusionViliteMainActivity.this.dialog != null) {
FusionViliteMainActivity.this.dialog.dismiss();
}
}
});
Preferences.instance(this).setBooleanPreference("interstitial_static_popup", Boolean.TRUE);
}
public void showPopup(final Preferences preferences, String str, final boolean z) {
final OttSDK oTTSdkInstance = APIUtils.getOTTSdkInstance(getApplicationContext());
if (oTTSdkInstance == null) {
return;
}
final User loggedUser = oTTSdkInstance.getPreferenceManager().getLoggedUser();
HashMap hashMap = new HashMap();
hashMap.put("msg1", str);
if (isGdprDialogShown) {
return;
}
isGdprDialogShown = true;
NavigationUtils.showDialog((FragmentActivity) this, DialogType.GDPR_COOKIE_POLICY_DIALOG, hashMap, new DialogListener() {
@Override
public void itemClicked(boolean z2, int i2, int i3) {
}
@Override
public void itemClicked(boolean z2, int i2, HashMap hashMap2) {
boolean unused = FusionViliteMainActivity.isGdprDialogShown = false;
if (i2 == 0) {
return;
}
if (!z) {
oTTSdkInstance.getUserManager().submitGdprConsent(loggedUser.getUserId().intValue(), new UserManager.UserCallback<String>() {
@Override
public void onEmptySuccess() {
com.yupptv.ottsdk.managers.User.a.a(this);
}
@Override
public void onFailure(Error error) {
NavigationUtils.logKibanaError("FusionViliteMainActivity", "API", "/service/api/auth/consent/request", "NA", "NA", "NA", f.a(error, new StringBuilder("")), error.getMessage());
Toast.makeText((Context) FusionViliteMainActivity.this, (CharSequence) error.getMessage(), 1).show();
FusionViliteMainActivity.this.updateDOBGender();
}
@Override
public void onSuccess(String str2) {
AnonymousClass54 anonymousClass54 = AnonymousClass54.this;
preferences.setGDPRCookiePolicy(loggedUser.getUserId().intValue(), str2);
FusionViliteMainActivity.this.updateDOBGender();
}
});
} else {
preferences.setCookiePolicy("true");
FusionViliteMainActivity.this.gdprCookiePolicy();
}
}
});
}
public void showPrepaidRenewLottie() {
try {
MediaCatalogManager[] mediaCatalogManagerArr = {APIUtils.getmMediaManager(this)};
RestAdapter.enableCache(false);
mediaCatalogManagerArr[0].getBottomTemplateInfo("expiry_popup", "", new AnonymousClass34());
} catch (Exception e2) {
if (TextUtils.isEmpty(e2.getMessage())) {
CustomLog.e("onFailure", e2.getMessage().toString());
}
}
}
private void showToolBarButtons() {
AppCompatButton appCompatButton;
AppCompatButton appCompatButton2;
AppCompatButton appCompatButton3 = this.callButton;
if (appCompatButton3 != null) {
appCompatButton3.setVisibility(8);
}
AppCompatButton appCompatButton4 = this.payButton;
if (appCompatButton4 != null) {
appCompatButton4.setVisibility(8);
}
Configs utilAppConfigurations = APIUtils.getUtilAppConfigurations(getApplicationContext());
if (utilAppConfigurations != null && utilAppConfigurations.getIsCallSupported() != null && utilAppConfigurations.getIsCallSupported().equalsIgnoreCase("true") && (appCompatButton2 = this.callButton) != null) {
appCompatButton2.setVisibility(0);
}
if (utilAppConfigurations == null || utilAppConfigurations.getShowPackages() == null || !utilAppConfigurations.getShowPackages().equalsIgnoreCase("true") || (appCompatButton = this.payButton) == null) {
return;
}
appCompatButton.setVisibility(8);
}
public void showUserSubscriptionOfferDialog(final UserSubscriptionOffer userSubscriptionOffer) {
Dialog dialog = new Dialog(this);
this.dialog = dialog;
dialog.setContentView(R.layout.user_subscription_offer_popup);
this.dialog.getWindow().setBackgroundDrawableResource(R.color.transparent);
this.dialog.setCancelable(true);
this.dialog.setCanceledOnTouchOutside(false);
this.dialog.getWindow().setLayout((int) (getResources().getDisplayMetrics().widthPixels * 0.8d), -2);
this.dialog.getWindow().setGravity(17);
AppCompatImageView findViewById = this.dialog.findViewById(R.id.offerimage);
AppCompatImageView findViewById2 = this.dialog.findViewById(R.id.closeDialogIv);
AppCompatButton findViewById3 = this.dialog.findViewById(R.id.explorebtn);
AppCompatTextView findViewById4 = this.dialog.findViewById(R.id.offerdescription);
if (userSubscriptionOffer.getDescription() != null && userSubscriptionOffer.getDescription().trim().length() > 0) {
findViewById4.setVisibility(0);
findViewById4.setText(userSubscriptionOffer.getDescription());
}
if (userSubscriptionOffer.getImgUrl() != null && userSubscriptionOffer.getImgUrl().trim().length() > 0) {
findViewById.setVisibility(0);
String imgUrl = userSubscriptionOffer.getImgUrl();
if (APIUtils.getAbsoluteImagePath(getApplicationContext(), imgUrl) != null) {
imgUrl = APIUtils.getAbsoluteImagePath(getApplicationContext(), imgUrl);
}
RequestBuilder load = Glide.with(getApplicationContext()).load(imgUrl);
int i2 = R.drawable.default_banner;
load.placeholder(i2).error(i2).into(findViewById);
}
findViewById2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
FusionViliteMainActivity.this.dismissInterstitialDialog();
}
});
findViewById3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
FusionViliteMainActivity.this.launchWebviewPlansPage(null, userSubscriptionOffer.getTargetPath(), "home subscribe");
FusionViliteMainActivity.this.dismissInterstitialDialog();
}
});
Preferences.instance(this).setLongPreference("USRSUB_OFFER_POPUP_SHOWTIME", System.currentTimeMillis());
this.dialog.show();
}
private void signOutUser() {
HashMap hashMap = new HashMap();
hashMap.put("msg2", "");
if (Configurations.enableOfflineDownloads) {
hashMap.put("msg1", OTTApplication.getContext().getResources().getString(R.string.logout_confirmation_title));
} else {
hashMap.put("msg1", OTTApplication.getContext().getResources().getString(R.string.logout_confirmation_sub_title));
}
CleverTap.moviesEventPopUp("no", "SignOut", "popup displayed", "SignOut", "", "", "", "", "", "", "hamburger menu", "", this.bottomTabSelected, "", "", -1, -1, "", "");
NavigationUtils.showDialog((FragmentActivity) this, DialogType.CONTINUE_LOGOUT_DIALOG, hashMap, new DialogListener() {
@Override
public void itemClicked(boolean z, int i2, int i3) {
}
@Override
public void itemClicked(boolean z, int i2, HashMap hashMap2) {
FusionViliteMainActivity.this.isClicked = false;
if (i2 == 0) {
CleverTap.moviesEventPopUp("no", "SignOut", "button clicked", "SignOut", "No", "", "", "", "", "", "hamburger menu", "", FusionViliteMainActivity.this.bottomTabSelected, "", "", -1, -1, "", "");
} else {
CleverTap.moviesEventPopUp("no", "SignOut", "button clicked", "SignOut", "Yes", "", "", "", "", "", "hamburger menu", "", FusionViliteMainActivity.this.bottomTabSelected, "", "", -1, -1, "", "");
FusionViliteMainActivity.this.logOut();
}
}
});
}
private void toggleBackButton(boolean z) {
if (z) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeAsUpIndicator(R.drawable.back_arrow);
return;
}
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setHomeAsUpIndicator(R.drawable.actionbar_menu);
this.toggle.setDrawerIndicatorEnabled(false);
this.toggle.syncState();
}
public void trackEvents(String str, int i2, ContentPage contentPage) {
try {
HashMap hashMap = new HashMap();
hashMap.put(AnalyticsUtils.ATTRIBUTE_ACTIONS, i2 == 0 ? AnalyticsUtils.ATTRIBUTE_VALUE_ACTION_REMOVED : AnalyticsUtils.ATTRIBUTE_VALUE_ACTION_ADDED);
CustomLog.e("TAG", "#ATTRIBUTE_ACTIONS : " + i2);
AnalyticsUtils.getInstance().trackAnalyticsEvent(ScreenType.PLAYER, null, contentPage, null, str, AnalyticsUtils.ATTRIBUTE_VALUE_SOURCE_PLAYER_PAGE, hashMap);
} catch (NullPointerException unused) {
}
}
private void trackHamburgerEvents(String str, String str2, String str3) {
if (str.equalsIgnoreCase(AnalyticsUtils.EVENT_PAGE_HAMBURGER)) {
CleverTap.moviesEventHamburgerMenu(str2);
}
try {
HashMap hashMap = new HashMap();
hashMap.put(AnalyticsUtils.ATTRIBUTE_MENU_NAME, str2);
CustomLog.e("TAG", "#ATTRIBUTE_MENU_NAME : " + str2);
AnalyticsUtils analyticsUtils = AnalyticsUtils.getInstance();
ScreenType screenType = ScreenType.HAMBURGER;
if (str3 == null || str3.trim().length() <= 0) {
str3 = AnalyticsUtils.NOT_AVAILABLE;
}
analyticsUtils.trackAnalyticsEvent(screenType, null, null, null, str, str3, hashMap);
} catch (Exception unused) {
}
}
private void trackPlayerEvents(String str, String str2, Object obj) {
try {
HashMap hashMap = new HashMap();
AnalyticsUtils analyticsUtils = AnalyticsUtils.getInstance();
ScreenType screenType = ScreenType.PLAYER;
if (str2 == null || str2.trim().length() <= 0) {
str2 = AnalyticsUtils.NOT_AVAILABLE;
}
analyticsUtils.trackAnalyticsEvent(screenType, null, obj, null, str, str2, hashMap);
} catch (NullPointerException unused) {
}
}
public void updateCastPlayer(boolean z) {
CastContext castContext;
if (z) {
this.isChromeCastMinimized = false;
if (this.mCastContext.getSessionManager().getCurrentCastSession() != null && this.mCastContext.getSessionManager().getCurrentCastSession().getRemoteMediaClient() != null && this.mCastContext.getSessionManager().getCurrentCastSession().getRemoteMediaClient().hasMediaSession() && this.mCastContext.getSessionManager().getCurrentCastSession().getRemoteMediaClient().getMediaInfo() != null) {
this.mCastContext.getSessionManager().getCurrentCastSession().getRemoteMediaClient().getMediaInfo().getContentId();
}
if (this.mCastContext.getSessionManager().getCurrentCastSession().getRemoteMediaClient().getStreamDuration() > 0) {
this.seekValue = this.mCastContext.getSessionManager().getCurrentCastSession().getRemoteMediaClient().getApproximateStreamPosition();
} else {
this.seekValue = 0L;
}
try {
if (this.itemObjTemp == null && (castContext = this.mCastContext) != null && castContext.getCastState() == 4) {
this.itemObjTemp = ChromeCastUtils.getCustomDataJson(this.mCastSession.getRemoteMediaClient().getMediaInfo());
}
goToDetail(this.itemObjTemp);
this.isComingFromChromeCast = true;
try {
if (this.itemObjTemp != null) {
goToDetail(this.itemObject);
} else if (mCastObject != null) {
goToDetail((ContentPage) new Gson().fromJson(mCastObject.toString(), ContentPage.class));
}
} catch (Exception unused) {
}
} catch (JSONException unused2) {
this.itemObjTemp = null;
}
}
}
public void updateDOBGender() {
}
public void updateNonLogin() {
RecyclerView recyclerView = this.menuListRecyclerView;
if (recyclerView != null && recyclerView.getAdapter() != null) {
this.menuListRecyclerView.getAdapter().notifyDataSetChanged();
}
updateSubscribeimage();
this.loggedInLayout.setVisibility(8);
this.loginLayout.setVisibility(0);
this.signoutButton.setVisibility(8);
}
private void updatePlayerAlpha(float f2) {
this.mPlayerFragmentContainer.setAlpha(f2);
}
private void updatePreferences(final String str) {
showProgressBar();
if (OttSDK.getInstance() != null) {
OttSDK.getInstance().getUserManager().updateUserDisplayPreference(str, new UserManager.UserCallback<String>() {
@Override
public void onEmptySuccess() {
com.yupptv.ottsdk.managers.User.a.a(this);
}
@Override
public void onFailure(Error error) {
NavigationUtils.logKibanaError("FusionViliteMainActivity", "API", "/service/api/auth/update/session/preference", "NA", "NA", "NA", f.a(error, new StringBuilder("")), error.getMessage());
if (FusionViliteMainActivity.this.isFinishing()) {
return;
}
FusionViliteMainActivity.this.restartActivity();
FusionViliteMainActivity.this.restrictBackgroundActions(false);
}
@Override
public void onSuccess(String str2) {
if (FusionViliteMainActivity.this.isFinishing()) {
return;
}
String str3 = str;
if (str3 == null || !str3.equalsIgnoreCase("Eng")) {
String str4 = str;
if (str4 == null || !str4.equalsIgnoreCase("FRE")) {
OTTApplication.setLocalePortuguese(FusionViliteMainActivity.this);
} else {
OTTApplication.setLocaleFrench(FusionViliteMainActivity.this);
}
} else {
OTTApplication.setLocaleEnglish(FusionViliteMainActivity.this);
}
if (APIUtils.getUtilPreferenceManager(FusionViliteMainActivity.this.getApplicationContext()) != null) {
APIUtils.getUtilPreferenceManager(FusionViliteMainActivity.this.getApplicationContext()).setDisplayLanguage(str);
}
FusionViliteMainActivity.this.getConfigurationData();
}
});
}
}
private void updateStatusBarAlpha(float f2) {
int evaluateColorAlpha = evaluateColorAlpha(Math.max(0.0f, Math.min(1.0f, f2)), getResources().getColor(R.color.statusBarColor), -16777216);
if (Build.VERSION.SDK_INT < 34) {
getWindow().setStatusBarColor(evaluateColorAlpha);
return;
}
z1.a(getWindow(), false);
new WindowInsetsControllerCompat(getWindow(), getWindow().getDecorView()).setAppearanceLightStatusBars(false);
getWindow().getDecorView().setBackgroundColor(evaluateColorAlpha);
}
public void updateSubscribeimage() {
final String str;
String str2;
User loggedUser;
Configs utilAppConfigurations = APIUtils.getUtilAppConfigurations(this);
if (this.preferenceManager == null) {
getPreferenceManager();
}
PreferenceManager preferenceManager = this.preferenceManager;
String str3 = null;
SubscriptionAnimationConfig subscriptionAnimationConfig = preferenceManager != null ? preferenceManager.getSubscriptionAnimationConfig() : null;
if (subscriptionAnimationConfig != null) {
String lottieUrl = subscriptionAnimationConfig.getToolbar().getLottieUrl();
String imageUrl = subscriptionAnimationConfig.getToolbar().getImageUrl();
str2 = subscriptionAnimationConfig.getToolbar().getGifUrl();
str = lottieUrl;
str3 = imageUrl;
} else {
str = null;
str2 = null;
}
PreferenceManager preferenceManager2 = this.preferenceManager;
if (preferenceManager2 != null && preferenceManager2.getLoggedUser() != null && (loggedUser = this.preferenceManager.getLoggedUser()) != null) {
List<User.UserPackage> packages = loggedUser.getPackages();
User.Attributes attributes = loggedUser.getAttributes();
if (packages != null && packages.size() > 0) {
if (attributes != null) {
String activePackLogo = attributes.getActivePackLogo();
CustomLog.d("", "updateSubscribeimage: " + activePackLogo);
if (TextUtils.isEmpty(activePackLogo)) {
this.subscriber_menu.setVisibility(8);
} else {
this.subscriber_menu.setVisibility(0);
Glide.with(OTTApplication.getContext()).load(activePackLogo).into(this.subscriber_menu);
}
}
if (subscriptionAnimationConfig != null && subscriptionAnimationConfig.getToolbar() != null && subscriptionAnimationConfig.getToolbar().getSubscribedUser() != null) {
final String lottieUrl2 = subscriptionAnimationConfig.getToolbar().getSubscribedUser().getLottieUrl();
final String targetPath = subscriptionAnimationConfig.getToolbar().getSubscribedUser().getTargetPath();
boolean isVimtvAppInstalledOrNot = Utils.isVimtvAppInstalledOrNot(OTTApplication.getContext(), "com.vodafone.vodafoneplay");
if (!this.isPrepaidRenewLottieVisible && !TextUtils.isEmpty(lottieUrl2) && !isVimtvAppInstalledOrNot) {
new Handler().post(new Runnable() {
@Override
public final void run() {
FusionViliteMainActivity.this.lambda$updateSubscribeimage$23(lottieUrl2);
}
});
this.download_container_lottie.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
CleverTap.moviesEventClicked("button", "download lottie");
FusionViliteMainActivity.this.downloadVIMobileApp(targetPath);
}
});
return;
}
}
if (utilAppConfigurations == null || TextUtils.isEmpty(utilAppConfigurations.getToolbarSubscirbedLottieEnabled()) || !utilAppConfigurations.getToolbarSubscirbedLottieEnabled().equalsIgnoreCase("false")) {
return;
}
if (!this.isPrepaidRenewLottieVisible) {
this.gif_container.setVisibility(8);
this.container_lottie.setVisibility(8);
}
this.subscribed_container_lottie.setVisibility(8);
this.download_container_lottie.setVisibility(8);
return;
}
}
if (!TextUtils.isEmpty(str)) {
new Handler().post(new Runnable() {
@Override
public final void run() {
FusionViliteMainActivity.this.lambda$updateSubscribeimage$28(str);
}
});
return;
}
if (TextUtils.isEmpty(str2)) {
if (TextUtils.isEmpty(str3)) {
return;
}
RequestBuilder load = Glide.with(getApplicationContext()).load(str3);
int i2 = R.drawable.subscribe_badge;
load.placeholder(i2).error(i2).transform(new Transformation[]{new CenterCrop(), new RoundedCorners((int) getResources().getDimension(R.dimen.margin_default_2))}).into(this.subscribe_button_iv);
return;
}
Glide.with(getApplicationContext()).load(str2).into(this.gif_view);
this.gif_container.setVisibility(0);
this.container_lottie.setVisibility(8);
this.download_container_lottie.setVisibility(8);
this.subscribed_container_lottie.setVisibility(8);
}
public void updateTabItemsNew(List<Menu> list) {
char c;
List<Menu> list2 = this.mMenuList;
if (list2 != null) {
list2.clear();
}
TabLayout tabLayout = this.tabLayout;
if (tabLayout != null) {
tabLayout.removeAllTabs();
}
if (this.mMenuList == null) {
this.mMenuList = new ArrayList();
}
this.mMenuList.addAll(list);
int size = list.size();
if (size > getResources().getInteger(R.integer.bottom_tab_count)) {
this.tabLayout.setTabMode(0);
} else {
this.tabLayout.setTabMode(1);
this.tabLayout.setTabGravity(0);
}
int i2 = -1;
for (int i3 = 0; i3 < size; i3++) {
RelativeLayout relativeLayout = (RelativeLayout) LayoutInflater.from(this).inflate(R.layout.fusion_litesdk_custom_tab, (ViewGroup) null);
TextView textView = (TextView) relativeLayout.findViewById(R.id.tabContent);
ImageView imageView = (ImageView) relativeLayout.findViewById(R.id.tab_icon);
textView.setText(list.get(i3).getDisplayText().toLowerCase(Locale.getDefault()));
textView.setTypeface(ResourcesCompat.getFont(this, R.font.font_style_gotham_regular), 1);
CustomLog.d("Menus", "menu : " + list.get(i3).getCode());
String code = list.get(i3).getCode();
code.getClass();
switch (code.hashCode()) {
case -1827029285:
if (code.equals("account_m")) {
c = 0;
break;
}
c = 65535;
break;
case -1288397417:
if (code.equals("favourites_mobile")) {
c = 1;
break;
}
c = 65535;
break;
case -1211677427:
if (code.equals("home_m")) {
c = 2;
break;
}
c = 65535;
break;
case -1177318867:
if (code.equals("account")) {
c = 3;
break;
}
c = 65535;
break;
case -1131585765:
if (code.equals("kids_m")) {
c = 4;
break;
}
c = 65535;
break;
case -1068259517:
if (code.equals("movies")) {
c = 5;
break;
}
c = 65535;
break;
case -1003272776:
if (code.equals("e_learning")) {
c = 6;
break;
}
c = 65535;
break;
case -946803270:
if (code.equals("tvguide")) {
c = 7;
break;
}
c = 65535;
break;
case -906336856:
if (code.equals("search")) {
c = '\b';
break;
}
c = 65535;
break;
case -895760513:
if (code.equals("sports")) {
c = '\t';
break;
}
c = 65535;
break;
case -816678056:
if (code.equals("videos")) {
c = '\n';
break;
}
c = 65535;
break;
case -411750398:
if (code.equals("home_mobile")) {
c = 11;
break;
}
c = 65535;
break;
case -280322202:
if (code.equals("watch_now")) {
c = '\f';
break;
}
c = 65535;
break;
case -279939603:
if (code.equals("watchlist")) {
c = '\r';
break;
}
c = 65535;
break;
case -199315262:
if (code.equals("originals")) {
c = 14;
break;
}
c = 65535;
break;
case -146626905:
if (code.equals("d2h_mobile")) {
c = 15;
break;
}
c = 65535;
break;
case -689792:
if (code.equals("mobile_movies")) {
c = 16;
break;
}
c = 65535;
break;
case 3714:
if (code.equals("tv")) {
c = 17;
break;
}
c = 65535;
break;
case 3208415:
if (code.equals("home")) {
c = 18;
break;
}
c = 65535;
break;
case 3291757:
if (code.equals("kids")) {
c = 19;
break;
}
c = 65535;
break;
case 54345219:
if (code.equals("my_siti_mobile")) {
c = 20;
break;
}
c = 65535;
break;
case 95458912:
if (code.equals("debut")) {
c = 21;
break;
}
c = 65535;
break;
case 98712316:
if (code.equals("guide")) {
c = 22;
break;
}
c = 65535;
break;
case 104263205:
if (code.equals("music")) {
c = 23;
break;
}
c = 65535;
break;
case 106748522:
if (code.equals("plans")) {
c = 24;
break;
}
c = 65535;
break;
case 545161127:
if (code.equals("watchnow")) {
c = 25;
break;
}
c = 65535;
break;
case 555760278:
if (code.equals("catchup")) {
c = 26;
break;
}
c = 65535;
break;
case 586052842:
if (code.equals("favourites")) {
c = 27;
break;
}
c = 65535;
break;
case 692889332:
if (code.equals("account_mobile")) {
c = 28;
break;
}
c = 65535;
break;
case 794428861:
if (code.equals("book_d2h_mobile")) {
c = 29;
break;
}
c = 65535;
break;
case 820462825:
if (code.equals("dth_mobile")) {
c = 30;
break;
}
c = 65535;
break;
case 994290514:
if (code.equals("my_dishtv_mobile")) {
c = 31;
break;
}
c = 65535;
break;
case 1028478746:
if (code.equals("my_watchlist")) {
c = ' ';
break;
}
c = 65535;
break;
case 1432626128:
if (code.equals("channels")) {
c = '!';
break;
}
c = 65535;
break;
case 1434631203:
if (code.equals("settings")) {
c = '\"';
break;
}
c = 65535;
break;
case 1541704270:
if (code.equals("debut_m")) {
c = '#';
break;
}
c = 65535;
break;
case 1541925881:
if (code.equals("after_dark")) {
c = '$';
break;
}
c = 65535;
break;
case 1683173044:
if (code.equals("kids_mobile")) {
c = '%';
break;
}
c = 65535;
break;
case 1761518591:
if (code.equals("book_dth_mobile")) {
c = '&';
break;
}
c = 65535;
break;
case 2004962180:
if (code.equals("book_d2h")) {
c = '\'';
break;
}
c = 65535;
break;
case 2004964226:
if (code.equals("book_dth")) {
c = '(';
break;
}
c = 65535;
break;
case 2059799393:
if (code.equals("debut_mobile")) {
c = ')';
break;
}
c = 65535;
break;
default:
c = 65535;
break;
}
switch (c) {
case 0:
case 3:
case 28:
imageView.setImageDrawable(getResources().getDrawable(R.drawable.ic_user_profile_default));
imageView.setColorFilter(getResources().getColor(R.color.tab_un_selected_color));
TabLayout tabLayout2 = this.tabLayout;
e.a(list.get(i3), tabLayout2.newTab(), relativeLayout, tabLayout2);
i2 = i3;
break;
case 1:
case 27:
imageView.setImageDrawable(getResources().getDrawable(R.drawable.my_bingelist));
imageView.setColorFilter(getResources().getColor(R.color.tab_un_selected_color));
TabLayout tabLayout3 = this.tabLayout;
e.a(list.get(i3), tabLayout3.newTab(), relativeLayout, tabLayout3);
break;
case 2:
case 11:
case 18:
imageView.setImageDrawable(getResources().getDrawable(R.drawable.ic_home));
imageView.setColorFilter(getResources().getColor(R.color.tab_un_selected_color));
TabLayout tabLayout4 = this.tabLayout;
e.a(list.get(i3), tabLayout4.newTab(), relativeLayout, tabLayout4);
break;
case 4:
case 19:
case '%':
imageView.setImageDrawable(getResources().getDrawable(R.drawable.ic_kids));
TabLayout tabLayout5 = this.tabLayout;
e.a(list.get(i3), tabLayout5.newTab(), relativeLayout, tabLayout5);
break;
case 5:
case 16:
imageView.setImageDrawable(getResources().getDrawable(R.drawable.movies_icon_unselected));
imageView.setColorFilter(getResources().getColor(R.color.tab_un_selected_color));
TabLayout tabLayout6 = this.tabLayout;
e.a(list.get(i3), tabLayout6.newTab(), relativeLayout, tabLayout6);
break;
case 6:
imageView.setImageDrawable(getResources().getDrawable(R.drawable.ic_kids));
TabLayout tabLayout7 = this.tabLayout;
e.a(list.get(i3), tabLayout7.newTab(), relativeLayout, tabLayout7);
break;
case 7:
case 22:
imageView.setImageDrawable(getResources().getDrawable(R.drawable.ic_tv));
imageView.setColorFilter(getResources().getColor(R.color.tab_un_selected_color));
TabLayout tabLayout8 = this.tabLayout;
e.a(list.get(i3), tabLayout8.newTab(), relativeLayout, tabLayout8);
break;
case '\b':
imageView.setImageDrawable(getResources().getDrawable(R.drawable.search_icon_unselected));
TabLayout tabLayout9 = this.tabLayout;
e.a(list.get(i3), tabLayout9.newTab(), relativeLayout, tabLayout9);
this.toolbarSearchIcon.setVisibility(8);
break;
case '\t':
imageView.setImageDrawable(getResources().getDrawable(R.drawable.ic_sports));
imageView.setColorFilter(getResources().getColor(R.color.tab_un_selected_color));
TabLayout tabLayout10 = this.tabLayout;
e.a(list.get(i3), tabLayout10.newTab(), relativeLayout, tabLayout10);
break;
case '\n':
case '\f':
case 25:
imageView.setImageDrawable(getResources().getDrawable(R.drawable.ic_videos));
imageView.setColorFilter(getResources().getColor(R.color.tab_un_selected_color));
TabLayout tabLayout11 = this.tabLayout;
e.a(list.get(i3), tabLayout11.newTab(), relativeLayout, tabLayout11);
break;
case '\r':
case ' ':
imageView.setImageDrawable(getResources().getDrawable(R.drawable.ic_watchlist));
imageView.setColorFilter(getResources().getColor(R.color.tab_un_selected_color));
TabLayout tabLayout12 = this.tabLayout;
e.a(list.get(i3), tabLayout12.newTab(), relativeLayout, tabLayout12);
break;
case 14:
imageView.setImageDrawable(getResources().getDrawable(R.drawable.ic_originals));
imageView.setColorFilter(getResources().getColor(R.color.tab_un_selected_color));
TabLayout tabLayout13 = this.tabLayout;
e.a(list.get(i3), tabLayout13.newTab(), relativeLayout, tabLayout13);
break;
case 15:
case 20:
case 29:
case 30:
case 31:
case '&':
case '\'':
case '(':
imageView.setImageDrawable(getResources().getDrawable(R.drawable.ic_book));
imageView.setColorFilter(getResources().getColor(R.color.tab_un_selected_color));
TabLayout tabLayout14 = this.tabLayout;
e.a(list.get(i3), tabLayout14.newTab(), relativeLayout, tabLayout14);
break;
case 17:
imageView.setImageDrawable(getResources().getDrawable(R.drawable.ic_tv));
imageView.setColorFilter(getResources().getColor(R.color.tab_un_selected_color));
TabLayout tabLayout15 = this.tabLayout;
e.a(list.get(i3), tabLayout15.newTab(), relativeLayout, tabLayout15);
break;
case 21:
case '#':
case ')':
imageView.setImageDrawable(getResources().getDrawable(R.drawable.ic_debut));
TabLayout tabLayout16 = this.tabLayout;
e.a(list.get(i3), tabLayout16.newTab(), relativeLayout, tabLayout16);
break;
case 23:
imageView.setImageDrawable(getResources().getDrawable(R.drawable.ic_music));
imageView.setColorFilter(getResources().getColor(R.color.tab_un_selected_color));
TabLayout tabLayout17 = this.tabLayout;
e.a(list.get(i3), tabLayout17.newTab(), relativeLayout, tabLayout17);
break;
case 24:
imageView.setImageDrawable(getResources().getDrawable(R.drawable.ic_settings));
textView.setTextColor(ContextCompat.getColor(this, R.color.tab_selected_color));
imageView.setColorFilter((ColorFilter) null);
TabLayout tabLayout18 = this.tabLayout;
e.a(list.get(i3), tabLayout18.newTab(), relativeLayout, tabLayout18);
break;
case 26:
imageView.setImageDrawable(getResources().getDrawable(R.drawable.ic_catchup));
TabLayout tabLayout19 = this.tabLayout;
e.a(list.get(i3), tabLayout19.newTab(), relativeLayout, tabLayout19);
break;
case '!':
imageView.setImageDrawable(getResources().getDrawable(R.drawable.ic_catchup1));
TabLayout tabLayout20 = this.tabLayout;
e.a(list.get(i3), tabLayout20.newTab(), relativeLayout, tabLayout20);
break;
case '\"':
imageView.setImageDrawable(getResources().getDrawable(R.drawable.ic_settings));
imageView.setColorFilter(getResources().getColor(R.color.tab_un_selected_color));
TabLayout tabLayout21 = this.tabLayout;
e.a(list.get(i3), tabLayout21.newTab(), relativeLayout, tabLayout21);
break;
case '$':
imageView.setImageDrawable(getResources().getDrawable(R.drawable.ic_after_dark));
imageView.setColorFilter(getResources().getColor(R.color.tab_un_selected_color));
TabLayout tabLayout22 = this.tabLayout;
e.a(list.get(i3), tabLayout22.newTab(), relativeLayout, tabLayout22);
break;
default:
imageView.setImageDrawable(getResources().getDrawable(R.drawable.ic_settings));
imageView.setColorFilter(getResources().getColor(R.color.tab_un_selected_color));
TabLayout tabLayout23 = this.tabLayout;
e.a(list.get(i3), tabLayout23.newTab(), relativeLayout, tabLayout23);
break;
}
if (list.get(i3).getCode().equalsIgnoreCase("plans")) {
imageView.setColorFilter((ColorFilter) null);
}
}
Preferences instance = Preferences.instance(this);
if (!instance.getBooleanPreference("FromAccountPage").booleanValue() || i2 <= -1) {
return;
}
instance.setBooleanPreference("FromAccountPage", Boolean.FALSE);
this.tabLayout.getTabAt(i2).select();
}
private void updateTargetPage(Fragment fragment, String str) {
if (fragment == null || !(fragment instanceof HomeFragment)) {
return;
}
if (!str.equalsIgnoreCase("favourites") && !str.equalsIgnoreCase("favourites_mobile")) {
((HomeFragment) fragment).targetPage = str;
} else {
((HomeFragment) fragment).targetPage = APIUtils.getUtilAppConfigurations(getApplicationContext()).getFavouritesTargetPath();
}
}
private void updateToolbarItems(boolean z, boolean z2) {
this.toolbar_logo.setVisibility(z ? 0 : 8);
this.toolbar_title.setVisibility(z ? 8 : 0);
if (z2) {
return;
}
this.toolbar_logo.setVisibility(8);
this.toolbar_title.setVisibility(8);
}
public void updateUserLayout(User user) {
if (this.preferenceManager == null) {
getPreferenceManager();
}
if (user.getStatus().intValue() == 0) {
updateNonLogin();
return;
}
User.SessionDetails sessionDetails = user.getSessionDetails();
if (sessionDetails != null && this.preferenceManager != null) {
Preferences.instance(this).setStringPreference("languageSelected", sessionDetails.getContentLangCodes());
}
RecyclerView recyclerView = this.menuListRecyclerView;
if (recyclerView != null && recyclerView.getAdapter() != null) {
this.menuListRecyclerView.getAdapter().notifyDataSetChanged();
}
updateSubscribeimage();
this.loginLayout.setVisibility(8);
this.loggedInLayout.setVisibility(0);
if (!Constants.IS_USER_PROFILES_SUPPORTED) {
this.loggedInLayoutArrow.setVisibility(8);
}
if (Constants.IS_USER_PROFILES_SUPPORTED) {
if (user.getProfileParentalDetails() == null || user.getProfileId() == null) {
return;
}
loadUserProfilesData(user.getProfileParentalDetails());
int intValue = user.getProfileId().intValue();
CustomLog.d("DEBUG", "selectedProfileId + " + intValue);
for (User.ProfileParentalDetails profileParentalDetails : user.getProfileParentalDetails()) {
if (profileParentalDetails.getProfileId().intValue() == intValue) {
CustomLog.d("DEBUG", "profileParentDetails.getProfileId() + " + profileParentalDetails.getProfileId());
CustomLog.d("DEBUG", "profileParentDetails.getName() + " + profileParentalDetails.getName());
this.userNameTV.setText(profileParentalDetails.getName());
if (profileParentalDetails.getImageUrl() != null && !profileParentalDetails.getImageUrl().trim().isEmpty()) {
CustomLog.d("DEBUG", "profileParentDetails.getImageUrl() + " + profileParentalDetails.getImageUrl());
Glide.with(getApplicationContext()).load(APIUtils.getAbsoluteImagePath(getApplicationContext(), profileParentalDetails.getImageUrl())).placeholder(R.drawable.ic_user_profile_default).into(this.navMenuUserProfileIcon);
}
}
}
return;
}
if ((user.getFirstName() != null && !user.getFirstName().isEmpty()) || (user.getLastName() != null && !user.getLastName().isEmpty())) {
if (user.getPhoneNumber().isEmpty()) {
this.userNameTV.setText(user.getFirstName() + " " + user.getLastName());
} else {
this.userNameTV.setText(user.getPhoneNumber());
}
if (!user.getEmail().isEmpty()) {
this.userEmailTV.setText(user.getEmail());
} else if (!user.getPhoneNumber().isEmpty()) {
this.userEmailTV.setText(user.getPhoneNumber());
}
generateProfileTV(user.getFirstName() + " " + user.getLastName());
return;
}
if (user.getName() != null && !user.getName().isEmpty()) {
if (user.getPhoneNumber().isEmpty()) {
this.userNameTV.setText(user.getName());
} else {
this.userNameTV.setText(user.getPhoneNumber());
}
if (!user.getEmail().isEmpty()) {
this.userEmailTV.setText(user.getEmail());
} else if (!user.getPhoneNumber().isEmpty()) {
this.userEmailTV.setText(user.getPhoneNumber());
}
generateProfileTV(user.getName());
return;
}
if (user.getEmail().isEmpty()) {
this.userNameTV.setText(user.getPhoneNumber());
this.userEmailTV.setVisibility(8);
generateProfileTV(user.getPhoneNumber());
} else {
if (user.getPhoneNumber().isEmpty()) {
this.userNameTV.setText(user.getEmail());
} else {
this.userNameTV.setText(user.getPhoneNumber());
}
if (!user.getPhoneNumber().isEmpty()) {
this.userEmailTV.setText(user.getPhoneNumber());
}
generateProfileTV(user.getEmail());
}
}
private void updateWatchWhileScreen(boolean z) {
if (!z) {
showSystemUI();
ExoPlayerFragment exoPlayerFragment = (ExoPlayerFragment) this.mPlayerFragment;
if (exoPlayerFragment != null) {
exoPlayerFragment.setExoplayerSubtitleBottomPadding(0);
}
this.mWatchWhileLayout.exitFullscreen();
} else if (this.mWatchWhileLayout.mState != 2) {
hideSystemUI();
ExoPlayerFragment exoPlayerFragment2 = (ExoPlayerFragment) this.mPlayerFragment;
if (exoPlayerFragment2 != null) {
exoPlayerFragment2.setExoplayerSubtitleBottomPadding(120);
}
this.mWatchWhileLayout.enterFullscreen();
}
Fragment fragment = this.mPlayerFragment;
if (fragment instanceof ExoPlayerFragment) {
((ExoPlayerFragment) fragment).switchFullscreen(z);
}
}
private void viewBindDetailHeaderUI() {
this.detailHeaderLayout = findViewById(R.id.details_header);
this.detailInfoRelativeLayout = findViewById(R.id.infoLinearLayout);
this.detailHeaderRootLayout = (LinearLayout) findViewById(R.id.detail_header_root_layout);
this.detailBackgroundImage = (ImageView) findViewById(R.id.detail_background);
this.imgBack = (ImageView) findViewById(R.id.imgBack);
this.detailPosterImage = (ImageView) findViewById(R.id.detail_poster_image);
View findViewById = findViewById(R.id.detail_gradientview);
this.detatilGradientView = findViewById;
if (Build.VERSION.SDK_INT >= 24) {
findViewById.setBackgroundResource(R.drawable.ic_banner_graident_new);
}
this.fixedAspectRatioRL = (FixedAspectRatioRelativeLayout) findViewById(R.id.fixedAspectRatioRL);
}
@Override
public void WWL_maximized() {
CustomMaterialSearchView customMaterialSearchView;
Constants.IS_MAX_WWL = Boolean.TRUE;
OTTApplication.IS_PLAYER_PRESENT = false;
OTTApplication.playerPresent = true;
OTTApplication.isDrawerOpen = false;
Fragment fragment = this.searchFragment;
if (fragment != null && (fragment instanceof SearchFragment) && (customMaterialSearchView = ((SearchFragment) fragment).materialSearchView) != null && customMaterialSearchView.isSearchOpen()) {
((SearchFragment) this.searchFragment).materialSearchView.closeSearch();
((SearchFragment) this.searchFragment).materialSearchView.clearFocus();
((SearchFragment) this.searchFragment).materialSearchView.mEmptyBtn.setVisibility(8);
hideKeyBoard();
}
if (UiUtils.showLandscapePlayer) {
setRequestedOrientation(0);
hideSystemUI();
OrientationUtils orientationUtils = this.mOrientationUtils;
if (orientationUtils != null) {
orientationUtils.goFullScreen(true);
}
} else {
OrientationUtils orientationUtils2 = this.mOrientationUtils;
if (orientationUtils2 != null) {
orientationUtils2.goFullScreen(false);
}
}
this.mLastAlpha = 1.0f;
this.playerCurrentState = 1;
if (getResources().getConfiguration().orientation == 2 && !this.mWatchWhileLayout.mIsFullscreen) {
updateWatchWhileScreen(true);
}
Fragment fragment2 = this.mPlayerFragment;
if (fragment2 instanceof ExoPlayerFragment) {
ExoPlayerFragment exoPlayerFragment = (ExoPlayerFragment) fragment2;
if (exoPlayerFragment.mReplayButton.getVisibility() == 0) {
exoPlayerFragment.player_replay.setVisibility(0);
exoPlayerFragment.mReplayButton.setVisibility(8);
exoPlayerFragment.hideControls();
} else {
Fragment fragment3 = this.mPlayerFragment;
if (fragment3 != null) {
((ExoPlayerFragment) fragment3).hideMiniControls();
if (((ExoPlayerFragment) this.mPlayerFragment).isShowNextEpisodeButtonShowing) {
resumePlayer();
}
}
exoPlayerFragment.updatePlayerControls();
exoPlayerFragment.updateNextVideo();
}
Fragment fragment4 = this.mPlayerFragment;
if (fragment4 instanceof ExoPlayerFragment) {
ExoPlayerFragment exoPlayerFragment2 = (ExoPlayerFragment) fragment4;
if (exoPlayerFragment2.isTrailer && exoPlayerFragment2.isPlaying()) {
((ExoPlayerFragment) this.mPlayerFragment).backButton.setVisibility(0);
}
}
exoPlayerFragment.showHideForwardRewindLayout(true);
}
}
@Override
public void WWL_minimized() {
List<Menu> list;
WatchWhileLayout watchWhileLayout;
ViewPagerFragment viewPagerFragment;
PlayerControlView playerControlView;
ExoPlayer exoPlayer;
CustomMaterialSearchView customMaterialSearchView;
OTTApplication.IS_PLAYER_PRESENT = true;
Constants.IS_MAX_WWL = Boolean.FALSE;
FragmentManager supportFragmentManager = getSupportFragmentManager();
int i2 = R.id.contentframe;
if (supportFragmentManager.findFragmentById(i2) instanceof DetailsFragment) {
toggleBackButton(true);
updateToolbarItems(true, false);
enableHomeToolbar(true);
this.toolbar.setVisibility(8);
}
Fragment fragment = this.searchFragment;
if (fragment != null && (fragment instanceof SearchFragment) && (customMaterialSearchView = ((SearchFragment) fragment).materialSearchView) != null) {
customMaterialSearchView.requestFocus();
((SearchFragment) this.searchFragment).materialSearchView.showSearch(false);
((SearchFragment) this.searchFragment).materialSearchView.hideKeyboardEdit();
}
OttLog.error("WWL_minimized", "+++++++++++");
setRequestedOrientation(1);
this.mLastAlpha = 0.0f;
this.playerCurrentState = 2;
ExoPlayerFragment exoPlayerFragment = (ExoPlayerFragment) this.mPlayerFragment;
if (exoPlayerFragment != null) {
exoPlayerFragment.hideControls();
}
Fragment fragment2 = this.mPlayerFragment;
if (fragment2 != null) {
((ExoPlayerFragment) fragment2).showMiniControls();
((ExoPlayerFragment) this.mPlayerFragment).nextEpisodeButton.setVisibility(4);
((ExoPlayerFragment) this.mPlayerFragment).imageBackIV.setVisibility(4);
}
if (exoPlayerFragment != null) {
if (exoPlayerFragment.player_replay.getVisibility() == 0) {
exoPlayerFragment.player_replay.setVisibility(8);
exoPlayerFragment.mPauseButton.setVisibility(8);
exoPlayerFragment.mPlayButton.setVisibility(8);
exoPlayerFragment.mReplayButton.setVisibility(0);
} else {
ExoPlayer exoPlayer2 = exoPlayerFragment.player;
if (exoPlayer2 == null || exoPlayer2.getPlayWhenReady()) {
exoPlayerFragment.mPauseButton.setVisibility(0);
exoPlayerFragment.mPlayButton.setVisibility(8);
} else {
exoPlayerFragment.mPauseButton.setVisibility(8);
exoPlayerFragment.mPlayButton.setVisibility(0);
}
}
if ((exoPlayerFragment.isPlayingAd || ((exoPlayer = exoPlayerFragment.player) != null && exoPlayer.isPlayingAd())) && (playerControlView = exoPlayerFragment.mPlayerControlView) != null) {
playerControlView.hideAdControls();
}
if (exoPlayerFragment.relatedVideos_layout.getVisibility() == 0) {
exoPlayerFragment.relatedVideos_layout.setVisibility(8);
}
if (exoPlayerFragment.buttonRecyclerView.getVisibility() == 0) {
exoPlayerFragment.buttonRecyclerView.setVisibility(8);
}
if (this.mPlayerFragment instanceof ExoPlayerFragment) {
exoPlayerFragment.hideNextVideo();
}
if ((this.mPlayerFragment instanceof ExoPlayerFragment) && exoPlayerFragment.skipIntroButton.getVisibility() == 0) {
exoPlayerFragment.skipIntroButton.setVisibility(8);
}
if ((this.mPlayerFragment instanceof ExoPlayerFragment) && exoPlayerFragment.watchCreditsFrameLayout.getVisibility() == 0) {
exoPlayerFragment.watchCreditsFrameLayout.setVisibility(8);
}
}
if (getSupportFragmentManager().getBackStackEntryCount() == 0) {
showBottomBar(true);
}
exitMiniPlayer();
if ((getSupportFragmentManager().findFragmentById(i2) instanceof GridFragment) && getSupportFragmentManager().findFragmentByTag("favourites") != null && ((GridFragment) getSupportFragmentManager().findFragmentById(i2)).isFavourites) {
((GridFragment) getSupportFragmentManager().findFragmentById(i2)).requestFavouritesContent(false);
}
CastSession castSession = this.mCastSession;
if (castSession == null || !castSession.isConnected()) {
TabLayout tabLayout = this.tabLayout;
if (tabLayout != null && this.viewPagerFragment != null && tabLayout.getSelectedTabPosition() != -1 && (list = this.viewPagerFragment.menuList) != null && list.get(this.tabLayout.getSelectedTabPosition()).getCode().equalsIgnoreCase("favourites")) {
this.viewPagerFragment.refreshData();
}
} else {
OttLog.error("Chromecast connected", "Do not refresh data");
}
if (this.tabLayout != null && (viewPagerFragment = this.viewPagerFragment) != null && viewPagerFragment.getCurrentTab() == 0 && this.doEPGRefreshOnChangeInPlayer) {
this.doEPGRefreshOnChangeInPlayer = false;
this.viewPagerFragment.refreshData();
}
if (exoPlayerFragment != null) {
exoPlayerFragment.showHideForwardRewindLayout(false);
}
TabLayout tabLayout2 = this.tabLayout;
if (tabLayout2 == null || tabLayout2.getVisibility() != 0 || (watchWhileLayout = this.mWatchWhileLayout) == null) {
return;
}
watchWhileLayout.addBottomPadding(this, true);
if (isBottomBarVisible()) {
this.bannerAdsBottomMargin = (int) getResources().getDimension(R.dimen.banner_ad_bottom_margin_bottom_bar_and_dock_player);
} else {
this.bannerAdsBottomMargin = (int) getResources().getDimension(R.dimen.banner_ad_bottom_margin_dock_player_only);
}
setBannerAdsMargin();
if (this.tabLayout.getSelectedTabPosition() != -1) {
TabLayout tabLayout3 = this.tabLayout;
if (tabLayout3.getTabAt(tabLayout3.getSelectedTabPosition()) != null) {
TabLayout tabLayout4 = this.tabLayout;
isSubMenusAvailable(tabLayout4.getTabAt(tabLayout4.getSelectedTabPosition()).getTag().toString());
}
}
}
@Override
public void WWL_onClicked() {
this.mDrawerLayout.closeDrawers();
if (this.mWatchWhileLayout.mState == 2) {
Fragment fragment = this.mPlayerFragment;
if (fragment != null && (fragment instanceof ExoPlayerFragment) && ((ExoPlayerFragment) fragment).mMiniControlsContainer.getVisibility() == 8) {
((ExoPlayerFragment) this.mPlayerFragment).showMiniControls();
return;
}
this.mWatchWhileLayout.maximize(false);
}
if (this.mWatchWhileLayout.mState == 1) {
Fragment fragment2 = this.mPlayerFragment;
if (fragment2 instanceof ExoPlayerFragment) {
ExoPlayerFragment exoPlayerFragment = (ExoPlayerFragment) fragment2;
if (exoPlayerFragment.isTrailer) {
return;
}
exoPlayerFragment.toggleControls();
}
}
}
@Override
public void WWL_onHided() {
Fragment findFragmentById;
ViewPagerFragment viewPagerFragment;
Fragment fragmentFromViewpager;
OTTApplication.IS_PLAYER_PRESENT = false;
setRequestedOrientation(1);
updateUI(0);
CastSession castSession = this.mCastSession;
if (castSession != null && !castSession.isConnected()) {
this.itemObject = null;
this.itemObjTemp = null;
}
if ((this.mPlayerFragment instanceof ExoPlayerFragment) && !TextUtils.isEmpty(this.isNowPlayingPath)) {
OTTApplication.isDrawerOpen = false;
if (OTTApplication.is_Nav_fav) {
if (OTTApplication.is_Nav_fav_from_grid) {
OTTApplication.isDrawerOpen = true;
} else {
OTTApplication.isDrawerOpen = false;
}
}
if (OTTApplication.is_nav_home) {
OTTApplication.isDrawerOpen = true;
OTTApplication.is_nav_home = false;
}
if (!OTTApplication.is_Nav_fav_from_grid && OTTApplication.is_Nav_fav && OTTApplication.playerPresent && OTTApplication.isPlayerPage) {
OTTApplication.isDrawerOpen = true;
OTTApplication.isPlayerPage = false;
}
WindowManager.LayoutParams attributes = getWindow().getAttributes();
attributes.screenBrightness = -1.0f;
getWindow().setAttributes(attributes);
CastSession castSession2 = this.mCastSession;
if (castSession2 != null) {
castSession2.isConnected();
}
((ExoPlayerFragment) this.mPlayerFragment).callRecoEvent();
((ExoPlayerFragment) this.mPlayerFragment).stopPlayer();
this.mUpNextFragment.clearViewPagerData();
this.isNowPlayingPath = "";
}
this.playerCurrentState = 0;
if (isBottomBarVisible()) {
this.bannerAdsBottomMargin = (int) getResources().getDimension(R.dimen.banner_ad_bottom_margin_bottom_bar_only);
} else {
this.bannerAdsBottomMargin = (int) getResources().getDimension(R.dimen.banner_ad_bottom_margin_default);
}
setBannerAdsMargin();
if (OTTApplication.isContentPlayed && this.bottomTabSelected.equalsIgnoreCase("home") && (findFragmentById = getSupportFragmentManager().findFragmentById(R.id.contentframe)) != null && (findFragmentById instanceof ViewPagerFragment) && (fragmentFromViewpager = (viewPagerFragment = (ViewPagerFragment) findFragmentById).getFragmentFromViewpager()) != null && (fragmentFromViewpager instanceof HomeFragment) && viewPagerFragment.selectedTab.equalsIgnoreCase("Home")) {
((HomeFragment) fragmentFromViewpager).getPageSectionContent();
}
}
@Override
public void WWL_onSliding(float f2) {
float f3;
Fragment fragment = this.mPlayerFragment;
if (fragment instanceof ExoPlayerFragment) {
if (f2 == 0.0f) {
((ExoPlayerFragment) fragment).showOverLayLayoutIfAny();
} else {
((ExoPlayerFragment) fragment).hideControlsWithoutAnim();
}
if (f2 > 2.0f) {
f3 = (3.0f - f2) * this.mLastAlpha;
} else {
float f4 = f2 > 1.0f ? ((2.0f - f2) * 0.75f) + 0.25f : 1.0f;
if (f2 >= 0.0f && f2 <= 1.0f) {
updateStatusBarAlpha(1.0f - f2);
}
f3 = f4;
}
updatePlayerAlpha(f3);
this.mLastAlpha = f3;
}
}
public void backToGuide() {
if (this.viewPagerFragment != null) {
TabLayout tabLayout = this.tabLayout;
if (tabLayout == null || tabLayout.getSelectedTabPosition() == 0) {
onBackPressed();
} else {
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
FusionViliteMainActivity.this.getSupportFragmentManager().popBackStack();
FusionViliteMainActivity.this.viewPagerFragment.setCurrentTab(0);
TabLayout tabLayout2 = FusionViliteMainActivity.this.tabLayout;
if (tabLayout2 != null) {
tabLayout2.getTabAt(0).select();
}
}
}, 10L);
showBottomBar(true);
}
}
}
public boolean beforeShow(Map<String, Object> map) {
if (map == null) {
return true;
}
CustomLog.e("inAppBeforeShow:", "extras size : " + map.size());
for (int i2 = 0; i2 < map.size(); i2++) {
CustomLog.e("inAppBeforeShow:", "extras key:value : " + map.get(Integer.valueOf(i2)));
}
return true;
}
public void checkPlayingSameContent(String str, OfflinePlayingCallBack offlinePlayingCallBack) {
Fragment fragment = this.mPlayerFragment;
if (fragment instanceof ExoPlayerFragment) {
((ExoPlayerFragment) fragment).checkPlayingSameContent(str, offlinePlayingCallBack);
}
}
public void checkShowInstallOpenAppPopup() {
throw new UnsupportedOperationException("Method not decompiled: com.yupptv.ott.FusionViliteMainActivity.checkShowInstallOpenAppPopup():void");
}
public void clearPlayerData() {
Fragment fragment;
UpNextFragment upNextFragment = this.mUpNextFragment;
if (upNextFragment == null || (fragment = this.mPlayerFragment) == null) {
return;
}
upNextFragment.clearData(((ExoPlayerFragment) fragment).watchNowButtonClicked);
((ExoPlayerFragment) this.mPlayerFragment).watchNowButtonClicked = false;
}
public void clearPlayerSavedObjects() {
Fragment fragment = this.mPlayerFragment;
if (fragment != null) {
ExoPlayerFragment exoPlayerFragment = (ExoPlayerFragment) fragment;
exoPlayerFragment.lastItemObject = null;
exoPlayerFragment.lastStreamResponse = null;
}
}
public void clearSuggestions() {
ArrayList arrayList = new ArrayList();
SearchAdapter searchAdapter = new SearchAdapter(this, (String[]) arrayList.toArray(new String[arrayList.size()]), getResources().getDrawable(R.drawable.search_suggested), false, this.materialSearchView);
searchAdapter.updateData(new ArrayList());
this.materialSearchView.setAdapter(searchAdapter);
}
public void closePlayer() {
WatchWhileLayout watchWhileLayout = this.mWatchWhileLayout;
if (watchWhileLayout != null) {
this.playerClosed = false;
ExoPlayerFragment exoPlayerFragment = (ExoPlayerFragment) this.mPlayerFragment;
exoPlayerFragment.currentSpeedIndex = 2;
exoPlayerFragment.isShowNextEpisodeButtonShowing = false;
watchWhileLayout.mState = 2;
watchWhileLayout.slideHorizontal(true);
}
}
public void completeRefresher() {
OTTApplication.getInstance(this).refreshAfterSubscription();
}
public void dismissInterstitialDialog() {
Dialog dialog = this.dialog;
if (dialog != null) {
dialog.dismiss();
}
}
public void displayViewAllFrameContainer() {
if (this.mViewAllFragmentContainer.getVisibility() == 8) {
this.mViewAllFragmentContainer.setVisibility(0);
}
}
public void doPagerRefresh() {
FragmentManager supportFragmentManager = getSupportFragmentManager();
int i2 = R.id.contentframe;
if (!(supportFragmentManager.findFragmentById(i2) instanceof ViewPagerFragment)) {
this.doSectionsRefresh = true;
return;
}
Fragment findFragmentById = getSupportFragmentManager().findFragmentById(i2);
if (findFragmentById instanceof ViewPagerFragment) {
((ViewPagerFragment) findFragmentById).notifyDataSetChange();
}
this.doViewpagerCacheRefresh = true;
this.doEPGCacheRefresh = true;
this.doSectionsRefresh = false;
}
public void enableToolBarLogo(final boolean z) {
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
FusionViliteMainActivity.this.toolbarLogoLayout.setVisibility(z ? 0 : 8);
}
}, 200L);
}
@Override
public void exitMiniPlayer() {
CastSession castSession;
OttLog.error("exitMiniPlayer", "exitMiniPlayer");
if (this.hasPlayServices) {
CastSession castSession2 = this.mCastSession;
if (castSession2 != null && castSession2.isConnected() && this.mCastSession.getRemoteMediaClient() != null && this.mCastSession.getRemoteMediaClient().getMediaStatus() != null) {
int playerState = this.mCastSession.getRemoteMediaClient().getMediaStatus().getPlayerState();
this.mCastSession.getRemoteMediaClient().getMediaStatus();
if (playerState != 1) {
showCastMiniController(true);
this.mWatchWhileLayout.exitPlayer();
addCastSessionListener();
castSession = this.mCastSession;
if (castSession == null && castSession.isConnected()) {
this.mWatchWhileLayout.exitPlayer();
return;
}
}
}
showCastMiniController(false);
addCastSessionListener();
castSession = this.mCastSession;
if (castSession == null) {
}
}
}
@Override
public void expandToolBar(boolean z) {
setExpandEnabled(z);
}
public void gdprCookiePolicy() {
if (OttSDK.getInstance() != null) {
final Preferences instance = Preferences.instance(this);
OttSDK ottSDK = OttSDK.getInstance();
if (this.preferenceManager == null) {
getPreferenceManager();
}
final User loggedUser = this.preferenceManager.getLoggedUser();
if (instance.getCookiePolicy().equalsIgnoreCase("false")) {
showPopup(instance, getResources().getString(R.string.cookie_policy_text), true);
} else if (loggedUser == null || !instance.getGDPRCookiePolicy(loggedUser.getUserId().intValue()).equalsIgnoreCase("false")) {
updateDOBGender();
} else {
ottSDK.getUserManager().getGdprConsentStatus(loggedUser.getUserId().intValue(), new UserManager.UserCallback<String>() {
@Override
public void onEmptySuccess() {
com.yupptv.ottsdk.managers.User.a.a(this);
}
@Override
public void onFailure(Error error) {
NavigationUtils.logKibanaError("FusionViliteMainActivity", "API", "/service/api/auth/consent/status", "NA", "NA", "NA", f.a(error, new StringBuilder("")), error.getMessage());
?? r11 = FusionViliteMainActivity.this;
r11.showPopup(instance, r11.getResources().getString(R.string.gdpr_header_text), false);
}
@Override
public void onSuccess(String str) {
if (str.equalsIgnoreCase("false")) {
?? r4 = FusionViliteMainActivity.this;
r4.showPopup(instance, r4.getResources().getString(R.string.gdpr_header_text), false);
} else {
instance.setGDPRCookiePolicy(loggedUser.getUserId().intValue(), str);
FusionViliteMainActivity.this.updateDOBGender();
}
}
});
}
}
}
public void getActivePackage(final String str, final String str2, final int i2) {
showProgressBar();
if (OttSDK.getInstance() != null) {
OttSDK.getInstance().getPaymentManager().getActivePackages(new PaymentManager.PaymentCallback<List<ActivePackagesResponse>>() {
@Override
public void onFailure(Error error) {
NavigationUtils.logKibanaError("FusionViliteMainActivity", "API", "/service/api/auth/user/activepackages", "NA", "NA", "NA", f.a(error, new StringBuilder("")), error.getMessage());
InAppNotificationListener inAppNotificationListener = FusionViliteMainActivity.this;
if (inAppNotificationListener == null || inAppNotificationListener.isFinishing()) {
return;
}
FusionViliteMainActivity.this.hideProgressBar();
NavigationUtils.loadScreenActivityForResult((FragmentActivity) FusionViliteMainActivity.this, ScreenType.PAYMENTS, str2, i2, str, "");
}
@Override
public void onSuccess(List<ActivePackagesResponse> list) {
InAppNotificationListener inAppNotificationListener = FusionViliteMainActivity.this;
if (inAppNotificationListener == null || inAppNotificationListener.isFinishing()) {
return;
}
FusionViliteMainActivity.this.hideProgressBar();
if (list.size() == 0) {
NavigationUtils.loadScreenActivityForResult((FragmentActivity) FusionViliteMainActivity.this, ScreenType.PAYMENTS, str2, i2, str, "");
return;
}
ActivePackagesResponse activePackagesResponse = list.get(0);
if (activePackagesResponse.getGateway().equalsIgnoreCase("Demo")) {
FusionViliteMainActivity.this.showGatewayBlockDialog(APIUtils.getUtilAppConfigurations(FusionViliteMainActivity.this.getApplicationContext()).getDEMO_GATEWAY_ERROR_MESSAGE(), "");
return;
}
if (activePackagesResponse.getGateway().equalsIgnoreCase(NavigationConstants.PAYMENT_ROKU_INAPP)) {
if (str.equalsIgnoreCase(NavigationConstants.PAYMENT_UPGRADE_PLAN)) {
?? r9 = FusionViliteMainActivity.this;
r9.showGatewayBlockDialog(r9.getString(R.string.gateway_blocked_upgrade_title), FusionViliteMainActivity.this.getString(R.string.gateway_blocked_upgrade_subtitle_roku));
return;
} else {
?? r92 = FusionViliteMainActivity.this;
r92.showGatewayBlockDialog(r92.getString(R.string.gateway_blocked_title), FusionViliteMainActivity.this.getString(R.string.gateway_blocked_subtitle_roku));
return;
}
}
if (!activePackagesResponse.getGateway().equalsIgnoreCase(NavigationConstants.PAYMENT_AMAZON_INAPP)) {
NavigationUtils.loadScreenActivityForResult((FragmentActivity) FusionViliteMainActivity.this, ScreenType.PAYMENTS, str2, i2, str, "");
} else if (str.equalsIgnoreCase(NavigationConstants.PAYMENT_UPGRADE_PLAN)) {
?? r93 = FusionViliteMainActivity.this;
r93.showGatewayBlockDialog(r93.getString(R.string.gateway_blocked_upgrade_title), FusionViliteMainActivity.this.getString(R.string.gateway_blocked_upgrade_subtitle_amazon));
} else {
?? r94 = FusionViliteMainActivity.this;
r94.showGatewayBlockDialog(r94.getString(R.string.gateway_blocked_title), FusionViliteMainActivity.this.getString(R.string.gateway_blocked_subtitle_amazon));
}
}
});
}
}
public AutoplayPosterModel getAutoplayPosterModel() {
return this.autoplayPosterModel;
}
public Carousel getCarouselRecycelerView() {
return this.mRecyclerView;
}
public int getCurrentBottomTabPosition() {
TabLayout tabLayout = this.tabLayout;
if (tabLayout != null) {
return tabLayout.getSelectedTabPosition();
}
return -1;
}
public Fragment getCurrentFragment() {
return getSupportFragmentManager().findFragmentById(R.id.contentframe);
}
public EPGProgramsData getEPGProgramData() {
return this.mEPGProgramsData;
}
public EPG getEpgData() {
return this.epgData;
}
public HashMap<String, Boolean> getEpgDataTracker() {
return this.epgDataTracker;
}
public String getPageEventName() {
String obj;
TabLayout tabLayout = this.tabLayout;
if (tabLayout == null || tabLayout.getVisibility() != 0) {
return AnalyticsUtils.NOT_AVAILABLE;
}
CustomLog.e("getPageEventName", "" + this.tabLayout.getSelectedTabPosition());
int selectedTabPosition = this.tabLayout.getSelectedTabPosition();
obj = this.tabLayout.getTabAt(selectedTabPosition) != null ? this.tabLayout.getTabAt(selectedTabPosition).getTag().toString() : "";
obj.getClass();
switch (obj) {
case "tvguide":
case "guide":
return AnalyticsUtils.EVENT_PAGE_GUIDE;
case "watchlist":
case "my_watchlist":
return AnalyticsUtils.EVENT_PAGE_WATCHLIST;
case "mobile_movies":
return "carousel";
case "home":
return AnalyticsUtils.EVENT_PAGE_HOME;
case "catchup":
return AnalyticsUtils.EVENT_PAGE_CATCHUP;
case "favourites":
return AnalyticsUtils.EVENT_PAGE_FAVOURIES;
case "settings":
return AnalyticsUtils.EVENT_PAGE_SETTINGS;
default:
return obj;
}
}
public PartnerAutoplayBannerModel getPartnerAutoplayBannerModel() {
return this.partnerAutoplayBannerModel;
}
public Carousel getPartnerCarouselRecycelerView() {
return this.mPartnerRecyclerView;
}
public int getPlayerCurrentState() {
return this.playerCurrentState;
}
public EPGUserChannels getSavedEPGChannelsList() {
return this.mEPGUserChannels;
}
public ScreenType getScreenType() {
TabLayout tabLayout = this.tabLayout;
if (tabLayout != null) {
if (tabLayout.getSelectedTabPosition() != -1 && this.tabLayout.getVisibility() == 0) {
TabLayout.Tab tabAt = this.tabLayout.getTabAt(this.tabLayout.getSelectedTabPosition());
if (tabAt != null) {
String obj = tabAt.getTag().toString();
obj.getClass();
switch (obj) {
case "tvguide":
case "guide":
return ScreenType.GUIDE;
case "watchlist":
case "my_watchlist":
return ScreenType.WATCHLIST;
case "home":
return ScreenType.HOME;
case "catchup":
return ScreenType.CATCHUP;
case "favourites":
return ScreenType.FAVOURITES;
case "settings":
return ScreenType.SETTINGS;
default:
return ScreenType.NONE;
}
}
}
}
return this.playerScreenSource.trim().length() > 0 ? ScreenType.getType(this.playerScreenSource) : ScreenType.NONE;
}
public String getStreamPollKey() {
return this.mStreamPollKey;
}
public int getViewPagerFragmentPos() {
int currentTab;
ViewPagerFragment viewPagerFragment = this.viewPagerFragment;
if (viewPagerFragment == null || (currentTab = viewPagerFragment.getCurrentTab()) < 0) {
return 0;
}
return currentTab;
}
public void goBackFromPlayer() {
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
FusionViliteMainActivity.this.canceledPinDialog = true;
FusionViliteMainActivity.this.closePlayer();
FusionViliteMainActivity.this.updateUI(0);
}
}, 500L);
}
public void goToDetail(final Object obj) {
Fragment fragment;
if (this.mUpNextFragment != null) {
FragmentTransaction beginTransaction = getSupportFragmentManager().beginTransaction();
beginTransaction.detach(this.mUpNextFragment);
beginTransaction.attach(this.mUpNextFragment);
beginTransaction.commitNowAllowingStateLoss();
}
UpNextFragment upNextFragment = this.mUpNextFragment;
if (upNextFragment != null) {
upNextFragment.attachMetaFragment();
}
if (this.mPlayerFragment != null) {
FragmentTransaction beginTransaction2 = getSupportFragmentManager().beginTransaction();
beginTransaction2.detach(this.mPlayerFragment);
beginTransaction2.attach(this.mPlayerFragment);
beginTransaction2.commitNowAllowingStateLoss();
}
this.itemObject = obj;
this.itemObjTemp = obj;
this.canceledPinDialog = false;
try {
mCastObject = new JSONObject(new Gson().toJson(obj));
} catch (JSONException | Exception unused) {
}
if ((this.mWatchWhileLayout.mState != 0 || (this.mPlayerFragment instanceof ExoPlayerFragment)) && (fragment = this.mPlayerFragment) != null) {
((ExoPlayerFragment) fragment).resetFlags();
}
WatchWhileLayout watchWhileLayout = this.mWatchWhileLayout;
int i2 = watchWhileLayout.mState;
if (i2 == 0) {
this.isChromeCastMinimized = false;
watchWhileLayout.mState = 1;
watchWhileLayout.mIsFullscreen = false;
if (watchWhileLayout.canAnimate()) {
WatchWhileLayout watchWhileLayout2 = this.mWatchWhileLayout;
watchWhileLayout2.setAnimatePos(watchWhileLayout2.mOffsetX);
}
this.mWatchWhileLayout.reset();
if ((obj instanceof Card) || (obj instanceof String)) {
this.mWatchWhileLayout.maximize(true);
}
} else if (((obj instanceof Card) || (obj instanceof String)) && i2 != 1) {
watchWhileLayout.maximize(true);
}
new Handler().postDelayed(new Runnable() {
@Override
public final void run() {
FusionViliteMainActivity.this.lambda$goToDetail$32(obj);
}
}, 100L);
new Handler().postDelayed(new Runnable() {
@Override
public final void run() {
FusionViliteMainActivity.this.lambda$goToDetail$33();
}
}, 3000L);
}
public void goToHomePage() {
TabLayout tabLayout;
if (this.viewPagerFragment == null || (tabLayout = this.tabLayout) == null || tabLayout.getSelectedTabPosition() == 0) {
return;
}
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
FusionViliteMainActivity.this.viewPagerFragment.setCurrentTab(0);
TabLayout tabLayout2 = FusionViliteMainActivity.this.tabLayout;
if (tabLayout2 != null) {
tabLayout2.getTabAt(0).select();
}
}
}, 10L);
}
public void handleInAppMessaging() {
CleverTapAPI cleverTap = OTTApplication.getCleverTap();
if (cleverTap != null) {
if (CleverTapAPI.getDefaultInstance(this) != null) {
CleverTapAPI.getDefaultInstance(this).resumeInAppNotifications();
}
cleverTap.setInAppNotificationListener(this);
cleverTap.setInAppNotificationButtonListener(this);
cleverTap.setInboxMessageButtonListener(this);
cleverTap.setCTNotificationInboxListener(this);
cleverTap.initializeInbox();
CleverTapAPI.createNotificationChannel(getApplicationContext(), LogConstants.DEFAULT_CHANNEL, "General", "Clevertap Inapp message Testing", 5, true);
}
}
public void hideKeyBoard() {
((InputMethodManager) getSystemService("input_method")).hideSoftInputFromWindow(new View(this).getWindowToken(), 2);
}
public void hideProgressBar() {
LineSpinFadeLoaderView lineSpinFadeLoaderView = this.drawerProgressBar;
if (lineSpinFadeLoaderView != null) {
lineSpinFadeLoaderView.setVisibility(8);
}
LineSpinFadeLoaderView lineSpinFadeLoaderView2 = this.drawerProgressBar;
if (lineSpinFadeLoaderView2 instanceof LineSpinFadeLoaderView) {
lineSpinFadeLoaderView2.stopAnimation();
}
restrictBackgroundActions(false);
}
public void hideSystemUI() {
CustomLog.e("SystemUI", "hide system UI");
getWindow().addFlags(1024);
if (ViewConfiguration.get(this).hasPermanentMenuKey()) {
return;
}
getWindow().getDecorView().setSystemUiVisibility(4610);
}
public void hideViewAllFrameContainer() {
if (this.mViewAllFragmentContainer.getVisibility() == 0) {
if (!this.isViewAllBottomSheetDisplayed) {
this.mViewAllFragmentContainer.setVisibility(8);
}
if (getSupportFragmentManager().findFragmentById(R.id.viewAllFrameLayout) instanceof GridFragment) {
getSupportFragmentManager().popBackStack();
}
}
}
public void inboxDidInitialize() {
CustomLog.i("CT_Inbox>>", "inboxDidInitialize() called");
}
public void inboxMessagesDidUpdate() {
CustomLog.i("CT_Inbox>>", "inboxMessagesDidUpdate() called");
}
public void initiateJuspayCall() {
CustomLog.e("JUSPAY_DEBUG", "initiate api call from MainActivity");
if (APIUtils.getUtilPreferenceManager(getApplicationContext()).getLoggedUser() != null) {
User loggedUser = APIUtils.getUtilPreferenceManager(getApplicationContext()).getLoggedUser();
String str = "PREPAID";
if (loggedUser != null && loggedUser.getUserCategory() != null && loggedUser.getUserCategory().intValue() != 1) {
if (loggedUser.getUserCategory().intValue() == 2) {
str = "POSTPAID";
} else if (loggedUser.getUserCategory().intValue() == 3) {
str = "non-vi";
}
}
JuspayConfig enableJuspayConfig = APIUtils.getUtilPreferenceManager(getApplicationContext()).getEnableJuspayConfig();
if (enableJuspayConfig == null || enableJuspayConfig.getCustomerTypes() == null || enableJuspayConfig.getCustomerTypes().size() <= 0) {
return;
}
for (String str2 : enableJuspayConfig.getCustomerTypes()) {
if (!TextUtils.isEmpty(str) && str.equalsIgnoreCase(str2)) {
APIUtils.getOTTSdkInstance(getApplicationContext()).getPaymentManager().initiateJuspayPayment(new PaymentManager.PaymentCallback<InitiateJuspay>() {
@Override
public void onFailure(Error error) {
if (error != null) {
CustomLog.e("JuspaySDKLogEvent", "initiateJuspayPayment onFailure : " + error.getMessage());
}
}
@Override
public void onSuccess(InitiateJuspay initiateJuspay) {
if (initiateJuspay != null) {
String json = new Gson().toJson(initiateJuspay);
if (TextUtils.isEmpty(json)) {
return;
}
JuspayUtility.getInstance().setInitiateResponse(json);
}
}
});
return;
}
}
}
}
public boolean isBannerAdsVisible() {
RelativeLayout relativeLayout = BaseActivity.bannerAdsLayout;
return relativeLayout != null && relativeLayout.getVisibility() == 0;
}
public boolean isBottomBarVisible() {
TabLayout tabLayout = this.tabLayout;
return tabLayout != null && tabLayout.getVisibility() == 0;
}
public boolean isClicked() {
return this.isClick;
}
public boolean isCurrentEPGFragment() {
try {
Fragment findFragmentById = getSupportFragmentManager().findFragmentById(R.id.contentframe);
if (findFragmentById == null || !(findFragmentById instanceof ViewPagerFragment)) {
return false;
}
return ((ViewPagerFragment) findFragmentById).isEPGFragment();
} catch (NullPointerException unused) {
return false;
}
}
public boolean isCurrentRecordingFragment() {
try {
Fragment findFragmentById = getSupportFragmentManager().findFragmentById(R.id.contentframe);
if (findFragmentById == null || !(findFragmentById instanceof ViewPagerFragment)) {
return false;
}
return ((ViewPagerFragment) findFragmentById).isMyRecordingFragment();
} catch (NullPointerException unused) {
return false;
}
}
public boolean isExploreSection(Section.SectionInfo sectionInfo) {
if (sectionInfo == null || sectionInfo.getSectionPresentation() == null) {
return false;
}
return sectionInfo.getSectionPresentation().equalsIgnoreCase("custom_grid") || sectionInfo.getSectionPresentation().equalsIgnoreCase("grid");
}
public boolean isScreenLocked() {
KeyguardManager keyguardManager = (KeyguardManager) OTTApplication.getContext().getSystemService("keyguard");
PowerManager powerManager = (PowerManager) OTTApplication.getContext().getSystemService("power");
if (powerManager == null || !powerManager.isInteractive() || keyguardManager == null) {
return true;
}
return keyguardManager.isKeyguardLocked();
}
@Override
public void isSearchExit() {
this.searchFragment = null;
this.queryString = "";
}
public boolean isViewAllFrameVisible() {
return this.mViewAllFragmentContainer.getVisibility() == 0;
}
public void launchLanguagesScreen(boolean z) {
Intent intent = new Intent((Context) this, (Class<?>) LoadScreenActivity.class);
intent.putExtra(NavigationConstants.SCREEN_TYPE, ScreenType.VIEW_LANGUAGES);
if (z) {
startActivityForResult(intent, 17);
} else {
startActivity(intent);
}
}
public void launchMyTransactionsPage(String str, String str2) {
Configs utilAppConfigurations = APIUtils.getUtilAppConfigurations(this);
String siteURL = (utilAppConfigurations == null || utilAppConfigurations.getSiteURL() == null) ? "" : utilAppConfigurations.getSiteURL();
User loggedUser = APIUtils.getUtilPreferenceManager(this).getLoggedUser();
if (loggedUser == null || loggedUser.getStatus().intValue() == 0) {
NavigationUtils.loadScreenActivityForResult((FragmentActivity) this, ScreenType.SIGNIN, NavigationConstants.NAV_FROM_HOME, (String) null, 12, str2, "");
return;
}
if (this.preferenceManager == null) {
getPreferenceManager();
}
PreferenceManager preferenceManager = this.preferenceManager;
if (preferenceManager == null) {
Toast.makeText((Context) this, (CharSequence) "Something went wrong", 0).show();
hideProgressBar();
return;
}
String sessionId = preferenceManager.getSessionId() != null ? this.preferenceManager.getSessionId() : "";
String deviceUniqueId = this.preferenceManager.getDeviceUniqueId() != null ? this.preferenceManager.getDeviceUniqueId() : "";
int yuppDeviceId = this.preferenceManager.getYuppDeviceId();
CustomLog.d("DEBUG", "sessionId " + sessionId);
CustomLog.d("DEBUG", "boxId " + deviceUniqueId);
CustomLog.d("DEBUG", "clientId " + yuppDeviceId);
String str3 = "bi===" + deviceUniqueId + "&&&si===" + sessionId + "&&&ci===" + yuppDeviceId + "&&&theme===w&&&source===" + str2 + "&&&platform===lsdk&&&ucv===15";
if (str != null && !str.trim().isEmpty()) {
str3 = b.a(str3, "&&&redirect===", str);
}
CustomLog.d("DEBUG", "siteurl string to encode " + str3);
String encodeToString = Base64.encodeToString(str3.getBytes(), 0);
try {
encodeToString = URLEncoder.encode(encodeToString, "UTF-8");
} catch (UnsupportedEncodingException unused) {
}
String a = siteURL.endsWith("/") ? b.a(siteURL, "sso/manage?ut=", encodeToString) : b.a(siteURL, "/sso/manage?ut=", encodeToString);
g.a("siteurl ", a, "DEBUG");
if (OTTApplication.IS_FROM_SIGNIN) {
NavigationUtils.onBoardWebViewNavigationForResult((FragmentActivity) this, NavigationConstants.NAV_ACCOUNT, a, "signinPage");
OTTApplication.IS_FROM_SIGNIN = false;
} else {
NavigationUtils.onBoardWebViewNavigationForResult(str2, (FragmentActivity) this, NavigationConstants.NAV_ACCOUNT, a);
}
hideProgressBar();
}
public void launchPaymentScreen() {
Intent intent = new Intent((Context) this, (Class<?>) LoadScreenActivity.class);
intent.putExtra(NavigationConstants.SCREEN_TYPE, ScreenType.PAYMENTS);
startActivity(intent);
}
public void launchRedeemVoucherScreen() {
Intent intent = new Intent((Context) this, (Class<?>) LoadScreenActivity.class);
intent.putExtra(NavigationConstants.SCREEN_TYPE, ScreenType.REDEEM_VOUCHER);
intent.putExtra(NavigationConstants.NAV_FROM, "button");
startActivityForResult(intent, 18);
}
public void launchSigninPage(boolean z, int i2) {
Intent intent = new Intent((Context) this, (Class<?>) LoadScreenActivity.class);
intent.putExtra(NavigationConstants.SCREEN_TYPE, ScreenType.SIGNIN);
if (i2 != -1) {
intent.putExtra("BACK_NAVIGATION_REFERENCE", i2);
}
if (z) {
intent.putExtra(NavigationConstants.NAV_FROM, NavigationConstants.NAV_FROM_SETTINGS);
} else {
intent.putExtra(NavigationConstants.NAV_FROM, NavigationConstants.NAV_FROM_HOME);
}
startActivityForResult(intent, 15);
}
public void launchSubscribeUpgradePlanWebView(String str, String str2, String str3, String str4) {
String str5;
Configs utilAppConfigurations = APIUtils.getUtilAppConfigurations(getApplicationContext());
String siteURL = (utilAppConfigurations == null || utilAppConfigurations.getSiteURL() == null) ? "" : utilAppConfigurations.getSiteURL();
if (this.preferenceManager == null) {
getPreferenceManager();
}
PreferenceManager preferenceManager = this.preferenceManager;
if (preferenceManager == null) {
Toast.makeText((Context) this, (CharSequence) "Something went wrong", 0).show();
hideProgressBar();
return;
}
String sessionId = preferenceManager.getSessionId() != null ? this.preferenceManager.getSessionId() : "";
String deviceUniqueId = this.preferenceManager.getDeviceUniqueId() != null ? this.preferenceManager.getDeviceUniqueId() : "";
int yuppDeviceId = this.preferenceManager.getYuppDeviceId();
CustomLog.d("DEBUG", "sessionId " + sessionId);
CustomLog.d("DEBUG", "boxId " + deviceUniqueId);
CustomLog.d("DEBUG", "clientId " + yuppDeviceId);
CustomLog.d("DEBUG", "packageId " + str3);
CustomLog.d("DEBUG", "gateway " + str4);
String str6 = "bi===" + deviceUniqueId + "&&&si===" + sessionId + "&&&ci===" + yuppDeviceId + "&&&theme===w&&&pi===" + str3 + "&&&gw===" + str4 + "&&&source===content watch now&&&platform===lsdk&&&ucv===15";
if (str != null && str.trim().length() > 0) {
str6 = b.a(str6, "&&&contentPath===", str);
}
if (str2 == null || str2.trim().length() <= 0) {
str5 = str6 + "&&&redirect===plans/list";
} else {
str5 = b.a(str6, "&&&redirect===", str2);
}
CustomLog.d("DEBUG", "siteurl string to encode " + str5);
String encodeToString = Base64.encodeToString(str5.getBytes(), 0);
try {
encodeToString = URLEncoder.encode(encodeToString, "UTF-8");
} catch (UnsupportedEncodingException unused) {
}
String a = siteURL.endsWith("/") ? b.a(siteURL, "sso/manage?ut=", encodeToString) : b.a(siteURL, "/sso/manage?ut=", encodeToString);
g.a("siteurl ", a, "DEBUG");
NavigationUtils.onBoardWebViewNavigationForResult("content watch now", (FragmentActivity) this, NavigationConstants.NAV_ACCOUNT, a);
hideProgressBar();
}
public void launchWebviewPlansPage(String str, String str2, String str3) {
String str4;
if (!UiUtils.isNetworkConnected(this)) {
Toast.makeText((Context) this, (CharSequence) "please check your internet connection", 0).show();
return;
}
Configs utilAppConfigurations = APIUtils.getUtilAppConfigurations(getApplicationContext());
String siteURL = (utilAppConfigurations == null || utilAppConfigurations.getSiteURL() == null) ? "" : utilAppConfigurations.getSiteURL();
if (this.preferenceManager == null) {
getPreferenceManager();
}
PreferenceManager preferenceManager = this.preferenceManager;
if (preferenceManager == null) {
Toast.makeText((Context) this, (CharSequence) "Something went wrong", 0).show();
hideProgressBar();
return;
}
String sessionId = preferenceManager.getSessionId() != null ? this.preferenceManager.getSessionId() : "";
String deviceUniqueId = this.preferenceManager.getDeviceUniqueId() != null ? this.preferenceManager.getDeviceUniqueId() : "";
int yuppDeviceId = this.preferenceManager.getYuppDeviceId();
CustomLog.d("DEBUG", "sessionId " + sessionId);
CustomLog.d("DEBUG", "boxId " + deviceUniqueId);
CustomLog.d("DEBUG", "clientId " + yuppDeviceId);
String str5 = "bi===" + deviceUniqueId + "&&&si===" + sessionId + "&&&ci===" + yuppDeviceId + "&&&theme===w&&&source===" + str3 + "&&&platform===lsdk&&&ucv===15";
if (str != null && str.trim().length() > 0) {
str5 = b.a(str5, "&&&contentPath===", str);
}
if (str2 == null || str2.trim().length() <= 0) {
str4 = str5 + "&&&redirect===plans/list";
} else {
str4 = b.a(str5, "&&&redirect===", str2);
}
CustomLog.d("DEBUG", "siteurl string to encode " + str4);
String encodeToString = Base64.encodeToString(str4.getBytes(), 0);
try {
encodeToString = URLEncoder.encode(encodeToString, "UTF-8");
} catch (UnsupportedEncodingException unused) {
}
String a = siteURL.endsWith("/") ? b.a(siteURL, "sso/manage?ut=", encodeToString) : b.a(siteURL, "/sso/manage?ut=", encodeToString);
g.a("siteurl ", a, "DEBUG");
if (OTTApplication.IS_FROM_SIGNIN) {
NavigationUtils.onBoardWebViewNavigationForResult((FragmentActivity) this, NavigationConstants.NAV_ACCOUNT, a, "signinPage");
OTTApplication.IS_FROM_SIGNIN = false;
} else {
NavigationUtils.onBoardWebViewNavigationForResult(str3, (FragmentActivity) this, NavigationConstants.NAV_ACCOUNT, a);
}
hideProgressBar();
}
public void maximizePlayer() {
WatchWhileLayout watchWhileLayout = this.mWatchWhileLayout;
if (watchWhileLayout.mState == 0) {
watchWhileLayout.mState = 1;
watchWhileLayout.mIsFullscreen = false;
if (watchWhileLayout.canAnimate()) {
WatchWhileLayout watchWhileLayout2 = this.mWatchWhileLayout;
watchWhileLayout2.setAnimatePos(watchWhileLayout2.mMaxY);
}
this.mWatchWhileLayout.reset();
}
this.mWatchWhileLayout.maximize(true);
}
public void minimizeEPGGuidePlayer() {
WatchWhileLayout watchWhileLayout = this.mWatchWhileLayout;
if (watchWhileLayout != null) {
watchWhileLayout.minimize(true);
}
}
public void minimizePlayer() {
WatchWhileLayout watchWhileLayout = this.mWatchWhileLayout;
if (watchWhileLayout != null) {
watchWhileLayout.minimize(true);
}
if (isBottomBarVisible()) {
this.bannerAdsBottomMargin = (int) getResources().getDimension(R.dimen.banner_ad_bottom_margin_bottom_bar_and_dock_player);
} else {
this.bannerAdsBottomMargin = (int) getResources().getDimension(R.dimen.banner_ad_bottom_margin_dock_player_only);
}
setBannerAdsMargin();
}
public void offlineDownload(String str, String str2, String str3, String str4, String str5, VideoDownloadCallBack videoDownloadCallBack) {
userId = str;
Fragment fragment = this.mPlayerFragment;
if (fragment instanceof ExoPlayerFragment) {
((ExoPlayerFragment) fragment).offlineDownload(str, str2, str3, str4, str5, videoDownloadCallBack, this.downloadTracker);
}
}
public void offlineSubscriptionRequired(String str) {
Fragment fragment = this.mPlayerFragment;
if (fragment instanceof ExoPlayerFragment) {
((ExoPlayerFragment) fragment).offlineSubscription(str);
}
}
public void onActivityResult(int r17, int r18, android.content.Intent r19) {
throw new UnsupportedOperationException("Method not decompiled: com.yupptv.ott.FusionViliteMainActivity.onActivityResult(int, int, android.content.Intent):void");
}
public void onBackPressed() {
TabLayout tabLayout;
Fragment findFragmentById = getSupportFragmentManager().findFragmentById(R.id.contentframe);
boolean z = findFragmentById instanceof DetailsFragment;
if (z) {
OTTApplication.exitPopupContentClicked = false;
}
Fragment fragment = this.mPlayerFragment;
if (fragment instanceof ExoPlayerFragment) {
ExoPlayerFragment exoPlayerFragment = (ExoPlayerFragment) fragment;
if (exoPlayerFragment.isTrailer) {
if (!exoPlayerFragment.isPlaying() && ((ExoPlayerFragment) this.mPlayerFragment).freeErrorEpisodePopup.getVisibility() != 0) {
closePlayer();
if ((!(findFragmentById instanceof GridFragment) || !(findFragmentById instanceof SearchFragmentNew)) && (this.currentSelectedFragment instanceof HomeFragment) && !OTTApplication.is_Nav_fav) {
showBottomBar(true);
}
this.playerClosed = true;
return;
}
if (getResources().getConfiguration().orientation == 2) {
this.mOrientationUtils.shrinkToPotraitMode();
return;
}
Constants.IS_READY = false;
closePlayer();
if (z) {
toggleBackButton(true);
updateToolbarItems(true, false);
enableHomeToolbar(true);
this.toolbar.setVisibility(8);
return;
}
if (((findFragmentById instanceof GridFragment) && (findFragmentById instanceof SearchFragmentNew)) || !(this.currentSelectedFragment instanceof HomeFragment) || OTTApplication.is_Nav_fav) {
return;
}
showBottomBar(true);
return;
}
}
if (this.mViewAllFragmentContainer.getVisibility() == 0) {
hideViewAllFrameContainer();
return;
}
if (OTTApplication.IS_PLAYER_SCREEN_LOCKED) {
Toast.makeText((Context) this, (CharSequence) "Screen locked", 0).show();
return;
}
if (this.playerCurrentState == 0 && this.mDrawerLayout.isDrawerOpen(8388611)) {
this.mDrawerLayout.closeDrawer(8388611);
return;
}
OTTApplication.fav = false;
RelativeLayout relativeLayout = this.favouritesActionMenuLayout;
if (relativeLayout != null && relativeLayout.getVisibility() == 0) {
this.favouritesActionMenuLayout.setVisibility(8);
}
if (OTTApplication.isDrawerOpen || OTTApplication.is_Nav_fav || OTTApplication.is_Nav_fav_from_grid || findFragmentById == null || !(findFragmentById instanceof GridFragment)) {
if (OTTApplication.IS_PLAYER_PRESENT && !(findFragmentById instanceof GridFragment)) {
this.mDrawerLayout.closeDrawers();
showBottomBar(true);
OTTApplication.isDrawerOpen = false;
OTTApplication.is_Nav_fav = false;
OTTApplication.is_Nav_meta = false;
OTTApplication.is_Nav_fav_from_grid = false;
OTTApplication.is_nav_home = false;
} else if (OTTApplication.isDrawerOpen) {
this.mDrawerLayout.openDrawer(8388611);
OTTApplication.isPlayerPage = false;
OTTApplication.isDrawerOpen = false;
OTTApplication.is_Nav_fav = false;
OTTApplication.is_Nav_meta = false;
} else if (!OTTApplication.is_Nav_fav && !OTTApplication.isDrawerOpen && findFragmentById != null && (findFragmentById instanceof HomeFragment) && ((HomeFragment) findFragmentById).isFavourites) {
Refresh();
showBottomBar(true);
return;
}
} else if (OTTApplication.is_nav_drawer) {
OTTApplication.isDrawerOpen = true;
OTTApplication.is_nav_drawer = false;
}
if (findFragmentById != null && (findFragmentById instanceof SearchFragment)) {
SearchFragment searchFragment = (SearchFragment) findFragmentById;
if (searchFragment.materialSearchView.isSearchOpen()) {
searchFragment.materialSearchView.closeSearch();
searchFragment.materialSearchView.mEmptyBtn.setVisibility(8);
MyRecoManager.getInstance().setOriginMedium("carousel");
ImageView imageView = this.toolbarSearchIcon;
if (imageView == null || imageView.getVisibility() != 0) {
showBottomBar(true);
return;
} else {
showBottomBar(false);
return;
}
}
}
if (findFragmentById != null && (findFragmentById instanceof SearchFragmentNew)) {
MyRecoManager.getInstance().setTAB_NAME(OTTApplication.tabName);
MyRecoManager.getInstance().setOriginMedium("carousel");
}
if (findFragmentById instanceof ListFragment) {
ListFragment listFragment = (ListFragment) findFragmentById;
if (listFragment.isProfilesOpen()) {
listFragment.showHideProfiles();
this.isProfilesOpen = !this.isProfilesOpen;
setArrowImage();
return;
}
}
if (handleBackStack()) {
return;
}
if (findFragmentById == null || !(findFragmentById instanceof OfflineDownloadListFragment) || UiUtils.isNetworkConnected(this)) {
if ((this.backToExit && (!OTTApplication.exitPopupApiCalled || !this.exitPopupEnabled)) || this.exitButtonClicked) {
APIUtils.getOTTSdkInstance(getApplicationContext()).cancelAllRequests();
if (OTTApplication.getWebLinkCallback() != null) {
OTTApplication.getWebLinkCallback().callWebLink("go_back_to_vi_app");
}
OnBackPressedCallback onBackPressedCallback = this.backPressedCallback;
if (onBackPressedCallback != null) {
onBackPressedCallback.remove();
}
super/*androidx.activity.ComponentActivity*/.onBackPressed();
return;
}
if (this.viewPagerFragment != null && (tabLayout = this.tabLayout) != null && tabLayout.getSelectedTabPosition() != 0) {
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
FusionViliteMainActivity.this.viewPagerFragment.setCurrentTab(0);
TabLayout tabLayout2 = FusionViliteMainActivity.this.tabLayout;
if (tabLayout2 != null) {
tabLayout2.getTabAt(0).select();
}
}
}, 10L);
return;
}
this.backToExit = true;
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
FusionViliteMainActivity.this.backToExit = false;
}
}, 3000L);
if (!this.exitPopupEnabled) {
Toast.makeText((Context) this, (CharSequence) getResources().getString(R.string.back_to_exit), 0).show();
return;
}
if (this.backToExit && !OTTApplication.exitPopupContentClicked && OTTApplication.exitPopupApiCalled) {
DialogType dialogType = DialogType.EXIT_POPUP;
HashMap hashMap = new HashMap();
hashMap.put("dialog_template_code", this.templateCode);
hashMap.put("dialog_key_target_path", "home");
CleverTap.moviesEventExitPopup(Constants.VALUE_DISPLAYED, "", "", "", "", this.bottomTabSelected, "", -1, "", "", "");
NavigationUtils.showDialog("", this, dialogType, hashMap, null, new BottomButtonsActionListener() {
@Override
public void onButtonClicked(AppCompatButton appCompatButton, Object obj, ButtonType buttonType) {
}
@Override
public void onDismiss() {
}
});
}
}
}
@Override
public void onBannerAdFailedToLoad(LoadAdError loadAdError) {
BaseActivity.bannerAdsLayout.setVisibility(8);
CustomLog.d("DEBUG", "onBannerAdFailedToLoad " + loadAdError.toString());
}
@Override
public void onBannerAdLoaded() {
BaseActivity.bannerAdsLayout.setVisibility(0);
setBannerAdsMargin();
ViewPagerFragment viewPagerFragment = this.viewPagerFragment;
if (viewPagerFragment != null) {
viewPagerFragment.updateBottomPadding((int) getResources().getDimension(R.dimen.banner_ad_bottom_padding_for_viewpager));
}
CustomLog.d("DEBUG", "onBannerAdLoaded");
}
@Override
public void onClick(View view) {
int id = view.getId();
if (id == R.id.sign_in_text || id == R.id.sign_in_button) {
DrawerLayout drawerLayout = this.mDrawerLayout;
if (drawerLayout != null) {
drawerLayout.closeDrawers();
}
trackEvent(AnalyticsV2.EVENT_HAMBURGER_SIGNIN);
completeRefresher();
return;
}
if (id == R.id.sign_out_button) {
DrawerLayout drawerLayout2 = this.mDrawerLayout;
if (drawerLayout2 != null) {
drawerLayout2.closeDrawers();
}
trackEvent(AnalyticsV2.EVENT_HAMBURGER_SIGNOUT);
if (this.isClicked) {
return;
}
this.isClicked = true;
signOutUser();
return;
}
if (id == R.id.userloggedInLayout) {
this.isProfilesOpen = !this.isProfilesOpen;
setUserProfilesArrowImage();
if (this.userProfilesLayout.getVisibility() == 0) {
this.userProfilesLayout.setVisibility(8);
} else {
this.userProfilesLayout.setVisibility(0);
}
}
}
public void onCreate(Bundle bundle) {
super/*androidx.fragment.app.FragmentActivity*/.onCreate(bundle);
setRequestedOrientation(1);
overridePendingTransition(0, 0);
this.selectHomeOnPopFromWebView = false;
setContentView(R.layout.fusionvilite_activity_home);
handleInAppMessaging();
this.bannerAdsBottomMargin = (int) getResources().getDimension(R.dimen.banner_ad_bottom_margin_bottom_bar_only);
BaseActivity.bannerAdsLayout = (RelativeLayout) findViewById(R.id.bannerAdsLayout);
try {
ChromeCastUtils.getInsatnce(this);
} catch (Exception unused) {
}
if (this.preferenceManager == null) {
getPreferenceManager();
}
OTTApplication.getInstance(this).initClevertap(this);
this.contentFrameLayout = (FrameLayout) findViewById(R.id.contentframe);
frameSetasDefault = (FrameLayout) findViewById(R.id.frameSetasDefault);
this.sharedPref = Preferences.instance(OTTApplication.getContext());
DownloadTracker downloadTracker = OTTApplication.getInstance(this).getDownloadTracker();
this.downloadTracker = downloadTracker;
downloadTracker.addListener(this);
try {
CustomLog.e("MediaDownloadService", "DownloadService.start");
DownloadService.start(this, MediaDownloadService.class);
} catch (IllegalStateException unused2) {
CustomLog.e("MediaDownloadService", "DownloadService.startForeground");
if (Build.VERSION.SDK_INT >= 26) {
DownloadService.startForeground(this, MediaDownloadService.class);
}
}
Fade fade = new Fade();
fade.excludeTarget(android.R.id.statusBarBackground, true);
fade.excludeTarget(android.R.id.navigationBarBackground, true);
getWindow().setExitTransition(fade);
getWindow().setEnterTransition(fade);
if (!OTTApplication.IS_CLICKED_ON_NOTIFICATION) {
OTTApplication.IS_CLICKED_ON_NOTIFICATION = true;
String stringExtra = getIntent().getStringExtra("target_path");
if (!TextUtils.isEmpty(stringExtra)) {
OTTApplication.IS_CLICKED_ON_NOTIFICATION = true;
NavigationUtils.performItemClickNavigation(null, this, stringExtra, "");
}
}
this.dimen_110dp = (int) getResources().getDimension(R.dimen.content_layout_bottom);
this.handler = new Handler();
this.main_layout = (RelativeLayout) findViewById(R.id.main_layout);
this.toolbar = findViewById(R.id.toolBar);
this.iV_Gradient_top = (ImageView) findViewById(R.id.iV_Gradient_top);
this.toolbar_title = (TextView) findViewById(R.id.toolbar_title);
this.toolbar_logo = findViewById(R.id.toolbar_logo);
this.subscribe_button_iv = findViewById(R.id.subscribe_button_iv);
this.subscribed_button_iv = findViewById(R.id.subscribed_button_iv);
this.container_lottie = (RelativeLayout) findViewById(R.id.container_lottie);
this.lottieAnimationView = (ImageView) findViewById(R.id.animation_view);
this.subscribedLottieAnimationView = (ImageView) findViewById(R.id.subscribed_animation_view);
this.downloadLottieAnimationView = findViewById(R.id.download_animation_view);
this.subscribed_container_lottie = (RelativeLayout) findViewById(R.id.subscribed_container_lottie);
this.download_container_lottie = (RelativeLayout) findViewById(R.id.download_container_lottie);
this.gif_container = (RelativeLayout) findViewById(R.id.container_gif);
this.gif_view = findViewById(R.id.gif_view);
this.payImage = (ImageView) findViewById(R.id.toolbar_pay);
this.homePageTestButton = findViewById(R.id.toobar_studybutton);
this.languageImage = (ImageView) findViewById(R.id.toolbar_language);
this.navBackImage = (ImageView) findViewById(R.id.nav_back);
this.loggedin_nav_back = (ImageView) findViewById(R.id.loggedin_nav_back);
this.toolbar_languageText = (TextView) findViewById(R.id.toolbar_languagetitle);
this.toobar_payText = (TextView) findViewById(R.id.toolbar_paytitle);
this.payButton = findViewById(R.id.toobar_paybutton);
this.callButton = findViewById(R.id.toobar_callbutton);
this.toolbarLogoLayout = (RelativeLayout) findViewById(R.id.toolbar_logo_layout);
this.toolbarSearchIcon = (ImageView) findViewById(R.id.searchNav);
this.swagUpload = (ImageView) findViewById(R.id.swagUpload);
this.subscriber_menu = (ImageView) findViewById(R.id.h_menu_subscribed);
this.accountHeaderLayout = (RelativeLayout) findViewById(R.id.account_header_layout);
this.user_name = (TextView) findViewById(R.id.user_name);
this.leftArrowLayout = (RelativeLayout) findViewById(R.id.leftArrowLayout);
this.leftArrowIv = (ImageView) findViewById(R.id.leftArrow);
RelativeLayout relativeLayout = (RelativeLayout) findViewById(R.id.signin_text_layout);
LinearLayout linearLayout = (LinearLayout) findViewById(R.id.signin_button_layout);
this.userIcon = (ImageView) findViewById(R.id.user_icon);
this.userProfileIcon = (ImageView) findViewById(R.id.user_profile_icon);
this.userIconText = (TextView) findViewById(R.id.user_text_icon);
this.preferenceManager = APIUtils.getUtilPreferenceManager(getApplicationContext());
this.rightArrow = (ImageView) findViewById(R.id.rightArrow);
this.linear_tablayout = (LinearLayout) findViewById(R.id.tabs_main);
LinearLayout linearLayout2 = (LinearLayout) findViewById(R.id.vi_lite_home);
this.linear_home = linearLayout2;
linearLayout2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (OTTApplication.getWebLinkCallback() != null) {
OTTApplication.getWebLinkCallback().callWebLink("go_back_to_vi_app");
}
FusionViliteMainActivity.this.finish();
}
});
this.torcai_footer_adRL = (LinearLayout) findViewById(R.id.torcai_footer_adRL);
this.jp_progressbar = (LineSpinFadeLoaderView) findViewById(R.id.jp_progressbar);
new Thread(new Runnable() {
@Override
public final void run() {
FusionViliteMainActivity.this.lambda$onCreate$0();
}
}).start();
this.subscribe_button_iv.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
FusionViliteMainActivity.this.lambda$onCreate$1(view);
}
});
this.container_lottie.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
FusionViliteMainActivity.this.lambda$onCreate$2(view);
}
});
this.gif_view.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
FusionViliteMainActivity.this.lambda$onCreate$3(view);
}
});
final Configs utilAppConfigurations = APIUtils.getUtilAppConfigurations(getApplicationContext());
this.toolbarSearchIcon.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
NavigationUtils.sendAutoPlayPauseBroadCast(FusionViliteMainActivity.this);
FragmentManager supportFragmentManager = FusionViliteMainActivity.this.getSupportFragmentManager();
int i2 = R.id.contentframe;
Fragment findFragmentById = supportFragmentManager.findFragmentById(i2);
if ((findFragmentById instanceof SearchFragmentNew) || (findFragmentById instanceof SearchFragment)) {
return;
}
Configs configs = utilAppConfigurations;
Fragment searchFragment = (configs == null || configs.getSearchStaticMenus() == null || configs.getSearchStaticMenus().trim().length() <= 0) ? new SearchFragment() : new SearchFragmentNew();
FusionViliteMainActivity.this.main_layout.setBackgroundColor(FusionViliteMainActivity.this.getResources().getColor(R.color.search_suggestions_bg_color));
CleverTap.moviesEventTabViewed("Search");
FusionViliteMainActivity.this.searchFragment = searchFragment;
FusionViliteMainActivity fusionViliteMainActivity = FusionViliteMainActivity.this;
fusionViliteMainActivity.currentSelectedFragment = searchFragment;
fusionViliteMainActivity.showBottomBar(false);
FusionViliteMainActivity.this.enableToolBarLogo(false);
FusionViliteMainActivity.this.getSupportFragmentManager().beginTransaction().add(i2, searchFragment, searchFragment.getClass().getSimpleName()).addToBackStack(searchFragment.getClass().getSimpleName()).commitAllowingStateLoss();
if (FusionViliteMainActivity.this.currentSelectedTab != null && !FusionViliteMainActivity.this.currentSelectedTab.equalsIgnoreCase(AnalyticsUtils.ATTRIBUTE_VALUE_SOURCE_SETTINGS_PAGE)) {
HashMap hashMap = new HashMap();
hashMap.put(AnalyticsUtils.ATTRIBUTE_SOURCE_MENU, FusionViliteMainActivity.this.currentSelectedTab);
CustomLog.e("TAG", "#ATTRIBUTE_SOURCE_MENU : " + FusionViliteMainActivity.this.currentSelectedTab);
AnalyticsUtils.getInstance().trackAnalyticsEvent(ScreenType.SETTINGS, null, null, null, AnalyticsUtils.EVENT_PAGE_SETTINGS, null, hashMap);
}
FusionViliteMainActivity.this.currentSelectedTab = AnalyticsUtils.ATTRIBUTE_VALUE_SOURCE_SETTINGS_PAGE;
}
});
this.accountHeaderLayout.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
FusionViliteMainActivity.this.lambda$onCreate$4(view);
}
});
Intent intent = getIntent();
this.intent_mainActivity = intent;
String stringExtra2 = intent.getStringExtra("ContentDeepLink");
if (!TextUtils.isEmpty(stringExtra2)) {
OTTApplication.SHOW_APP_OPEN_POPUP = false;
NavigationUtils.performItemClickNavigation(null, this, stringExtra2, "");
}
String stringExtra3 = this.intent_mainActivity.getStringExtra("carouselDeeplinkpath");
String stringExtra4 = this.intent_mainActivity.getStringExtra(PaymentConstants.URL);
if (!TextUtils.isEmpty(stringExtra4)) {
setPromotionalPopup(stringExtra4);
}
this.isLanguageFilterApplied = Preferences.instance(this).getBooleanPreference("language_filter_applied_key").booleanValue();
Intent intent2 = this.intent_mainActivity;
if (intent2 != null && !TextUtils.isEmpty(intent2.getStringExtra("tabName"))) {
this.tabname = this.intent_mainActivity.getStringExtra("tabName");
}
Intent intent3 = this.intent_mainActivity;
if (intent3 != null && !TextUtils.isEmpty(intent3.getStringExtra("partnerpage_path"))) {
String stringExtra5 = this.intent_mainActivity.getStringExtra("partnerpage_path");
this.partnerpage_path = stringExtra5;
NavigationUtils.performItemClickNavigation(null, this, stringExtra5, "");
}
if (!TextUtils.isEmpty(stringExtra3)) {
NavigationUtils.performItemClickNavigation(null, this, stringExtra3, "");
}
if (utilAppConfigurations == null || utilAppConfigurations.getSwagUploadSupport() == null || utilAppConfigurations.getSwagUploadSupport().trim().length() <= 0 || !utilAppConfigurations.getSwagUploadSupport().trim().equalsIgnoreCase("true")) {
this.swagUpload.setVisibility(8);
} else {
this.swagUpload.setVisibility(0);
}
this.swagUpload.setVisibility(8);
setSupportActionBar(this.toolbar);
DrawerLayout findViewById = findViewById(R.id.drawer_layout);
this.mDrawerLayout = findViewById;
ActionBarDrawerToggle actionBarDrawerToggle = new ActionBarDrawerToggle(this, findViewById, this.toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
this.toggle = actionBarDrawerToggle;
this.mDrawerLayout.addDrawerListener(actionBarDrawerToggle);
this.toggle.syncState();
toggleBackButton(false);
relativeLayout.setVisibility(0);
linearLayout.setVisibility(8);
getSupportActionBar().setDisplayHomeAsUpEnabled(false);
getSupportActionBar().setHomeButtonEnabled(false);
this.toolbar_logo.setVisibility(0);
this.toolbar.setVisibility(0);
this.toolbar.setNavigationIcon((Drawable) null);
getSupportActionBar().setTitle("");
this.payImage.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
FusionViliteMainActivity.this.lambda$onCreate$5(view);
}
});
this.toobar_payText.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
FusionViliteMainActivity.this.lambda$onCreate$6(view);
}
});
this.favouritesActionMenuLayout = (RelativeLayout) findViewById(R.id.fav_action_layout);
AppCompatButton findViewById2 = findViewById(R.id.unfav_action_btn);
this.favActionButton = findViewById2;
if (findViewById2 != null) {
findViewById2.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
FusionViliteMainActivity.this.lambda$onCreate$7(view);
}
});
}
TabLayout findViewById3 = findViewById(R.id.tabs);
this.tabLayout = findViewById3;
findViewById3.addOnTabSelectedListener(this.bottomMenuTabListener);
this.contentframeLayout = (FrameLayout) findViewById(R.id.contentframe);
this.mOrientationUtils = new OrientationUtils(this);
this.mbottomLayout = (RelativeLayout) findViewById(R.id.bottom_layout);
this.languageImage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
FusionViliteMainActivity.this.launchLanguagesScreen(true);
}
});
this.navBackImage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (FusionViliteMainActivity.this.mDrawerLayout == null || !FusionViliteMainActivity.this.mDrawerLayout.isDrawerOpen(8388611)) {
return;
}
FusionViliteMainActivity.this.mDrawerLayout.closeDrawer(8388611);
}
});
this.loggedin_nav_back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (FusionViliteMainActivity.this.mDrawerLayout == null || !FusionViliteMainActivity.this.mDrawerLayout.isDrawerOpen(8388611)) {
return;
}
FusionViliteMainActivity.this.mDrawerLayout.closeDrawer(8388611);
}
});
this.toolbar_languageText.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
FusionViliteMainActivity.this.lambda$onCreate$8(view);
}
});
this.payButton.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
FusionViliteMainActivity.this.lambda$onCreate$9(view);
}
});
this.callButton.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
FusionViliteMainActivity.this.lambda$onCreate$10(view);
}
});
this.mDrawerLayout.addDrawerListener(new DrawerLayout.DrawerListener() {
public void onDrawerClosed(@NonNull View view) {
FusionViliteMainActivity fusionViliteMainActivity = FusionViliteMainActivity.this;
if (fusionViliteMainActivity.preferenceManager == null) {
fusionViliteMainActivity.getPreferenceManager();
}
PreferenceManager preferenceManager = FusionViliteMainActivity.this.preferenceManager;
if (preferenceManager == null || preferenceManager.getLoggedUser() != null) {
return;
}
FusionViliteMainActivity.this.updateSubscribeimage();
}
public void onDrawerOpened(@NonNull View view) {
}
public void onDrawerSlide(@NonNull View view, float f2) {
if (f2 > 0.0f) {
FusionViliteMainActivity.this.isDrawerOpeningState = true;
} else {
FusionViliteMainActivity.this.isDrawerOpeningState = false;
}
}
public void onDrawerStateChanged(int i2) {
}
});
this.mDrawerLayout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
}
});
try {
this.isfromSignup = getIntent().getExtras().getBoolean("fromSignup");
} catch (Exception unused3) {
}
APIUtils.getOTTSdkInstance(getApplicationContext());
if (getIntent() != null && getIntent().hasExtra("isRestarted")) {
isActivityRestarted = getIntent().getBooleanExtra("isRestarted", false);
}
try {
Bundle bundleExtra = getIntent().getBundleExtra("NOTIFICATION_DATA");
if (bundleExtra != null) {
this.mTargetPath = (OfflineDownloadData) bundleExtra.getParcelable(NavigationConstants.SERVICES_TARGET_PATH);
this.isComingFromNotification = bundleExtra.containsKey("SERVICES_COMING_NOTIFICATION") ? bundleExtra.getBoolean("SERVICES_COMING_NOTIFICATION") : false;
this.isComingFromCancelNotification = bundleExtra.containsKey("SERVICES_COMING_CANCEL_NOTIFICATION") ? bundleExtra.getBoolean("SERVICES_COMING_CANCEL_NOTIFICATION") : false;
userId = bundleExtra.containsKey("USER_ID") ? bundleExtra.getString("USER_ID") : "";
}
} catch (Exception unused4) {
this.isComingFromNotification = false;
this.isComingFromCancelNotification = false;
}
NavigationView findViewById4 = findViewById(R.id.nav_view);
if (Utils.isTablet(this)) {
DrawerLayout.LayoutParams layoutParams = (DrawerLayout.LayoutParams) findViewById4.getLayoutParams();
((ViewGroup.MarginLayoutParams) layoutParams).width = getResources().getDimensionPixelSize(R.dimen._190sdp);
findViewById4.setLayoutParams(layoutParams);
}
this.loginLayout = findViewById(R.id.userloginLayout);
this.loggedInLayout = findViewById(R.id.userloggedInLayout);
this.loggedInLayoutArrow = findViewById(R.id.logged_in_layout_arrow);
LinearLayout linearLayout3 = (LinearLayout) findViewById(R.id.user_profiles_layout);
this.userProfilesLayout = linearLayout3;
if (Constants.IS_USER_PROFILES_SUPPORTED) {
linearLayout3.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
FusionViliteMainActivity.lambda$onCreate$11(view);
}
});
this.loggedInLayoutArrow.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
FusionViliteMainActivity.this.lambda$onCreate$12(view);
}
});
}
TextView textView = (TextView) this.loginLayout.findViewById(R.id.sign_in_text);
AppCompatButton findViewById5 = this.loginLayout.findViewById(R.id.sign_in_button);
AppCompatButton findViewById6 = this.loginLayout.findViewById(R.id.sign_up_button);
this.navMenuUserProfileIcon = (ImageView) this.loggedInLayout.findViewById(R.id.profile_icon_circular);
this.userNameTV = (TextView) this.loggedInLayout.findViewById(R.id.username);
this.userEmailTV = (TextView) this.loggedInLayout.findViewById(R.id.userEmail);
this.tv_profile = (TextView) this.loggedInLayout.findViewById(R.id.tv_profile);
this.signoutButton = findViewById(R.id.sign_out_button);
Typeface font = ResourcesCompat.getFont(this, R.font.font_style_gotham_bold);
this.latoRegular = ResourcesCompat.getFont(this, R.font.font_style_gotham_regular);
findViewById5.setTypeface(font);
findViewById6.setTypeface(font);
textView.setOnClickListener(this);
findViewById5.setOnClickListener(this);
findViewById6.setOnClickListener(this);
if (Constants.IS_USER_PROFILES_SUPPORTED) {
this.loggedInLayout.setOnClickListener(this);
}
if (!OTTApplication.isTorcSDKIsIntitalized) {
OTTApplication.isTorcSDKIsIntitalized = true;
try {
Constants.getMarketURLForVodafone(getApplicationContext()).toString();
} catch (Exception unused5) {
}
CustomLog.e("TORCAI_SDK_STATUS", "initialize");
}
this.signoutButton.setOnClickListener(this);
this.menuListRecyclerView = findViewById(R.id.recycler_view_menu_items);
this.menuListRecyclerView.setLayoutManager(new LinearLayoutManager(getApplicationContext()));
this.menuListRecyclerView.setItemAnimator(new DefaultItemAnimator());
this.mAdapter = new RecyclerViewAdapter(this, ListType.MAIN_MENU, "", "", false);
TextView textView2 = (TextView) findViewById(R.id.version_text);
this.versionTextView = textView2;
textView2.setText("Version 3.1.5, 15");
this.versionTextView.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
FusionViliteMainActivity.this.lambda$onCreate$13(view);
}
});
LineSpinFadeLoaderView lineSpinFadeLoaderView = (LineSpinFadeLoaderView) findViewById(R.id.drawerprogressBar);
this.drawerProgressBar = lineSpinFadeLoaderView;
lineSpinFadeLoaderView.setVisibility(8);
this.toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
FusionViliteMainActivity.this.handleHamBurgerMenu(true);
}
});
this.appBarLayout = findViewById(R.id.appBarContainer);
this.collapsingToolbarLayout = findViewById(R.id.collapsingtoolbarlayout);
this.mPortraitWidthInPixels = getResources().getDisplayMetrics().widthPixels;
WatchWhileLayout watchWhileLayout = (WatchWhileLayout) findViewById(R.id.watch_while_layout);
this.mWatchWhileLayout = watchWhileLayout;
watchWhileLayout.setListener(this);
this.mPlayerFragmentContainer = (FrameLayout) findViewById(R.id.player_fragment_container);
this.mViewAllFragmentContainer = (FrameLayout) findViewById(R.id.viewAllFrameLayout);
if (utilAppConfigurations != null) {
String playLastChannelOnLaunch = utilAppConfigurations.getPlayLastChannelOnLaunch();
String stringPreference = Preferences.instance(this).getStringPreference("lastchannel");
Bundle extras = getIntent() != null ? getIntent().getExtras() : null;
if (playLastChannelOnLaunch != null && playLastChannelOnLaunch.equalsIgnoreCase("true") && stringPreference != null && stringPreference.trim().length() > 0 && extras != null && extras.getBoolean("splashscreen")) {
Constants.IS_LAST_CHANNEL = Boolean.TRUE;
if (OttSDK.getInstance() != null) {
OttSDK.getInstance().getMediaManager().getPageContent(stringPreference, new MediaCatalogManager.MediaCatalogCallback<ContentPage>() {
@Override
public void onFailure(Error error) {
NavigationUtils.logKibanaError("FusionViliteMainActivity", "API", "/service/api/v1/page/content", "NA", "NA", "NA", f.a(error, new StringBuilder("")), error.getMessage());
Toast.makeText((Context) FusionViliteMainActivity.this, (CharSequence) error.getMessage(), 1).show();
}
@Override
public void onSuccess(ContentPage contentPage) {
Fragment fragment = FusionViliteMainActivity.this.mPlayerFragment;
if (fragment != null) {
((ExoPlayerFragment) fragment).hideDocPlayer();
}
FusionViliteMainActivity.this.goToDetail(contentPage);
}
});
}
}
final String homeTestButtonText = utilAppConfigurations.getHomeTestButtonText() != null ? utilAppConfigurations.getHomeTestButtonText() : "Study Material";
this.homePageTestButton.setText(homeTestButtonText);
final String homePageTestUrl = utilAppConfigurations.getHomePageTestUrl() != null ? utilAppConfigurations.getHomePageTestUrl() : "";
this.homePageTestButton.setVisibility(8);
this.homePageTestButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (FusionViliteMainActivity.this.isClick) {
return;
}
FusionViliteMainActivity.this.isClick = true;
FusionViliteMainActivity fusionViliteMainActivity = FusionViliteMainActivity.this;
fusionViliteMainActivity.clickHandler.postDelayed(fusionViliteMainActivity.isClickedRunnable, 3000L);
AnalyticsUtils.getInstance().trackAnalyticsEvent(ScreenType.HOME, null, null, null, homeTestButtonText, AnalyticsUtils.ATTRIBUTE_VALUE_SOURCE_HOME_PAGE, null);
NavigationUtils.onBoardWebViewNavigation(FusionViliteMainActivity.this, NavigationConstants.NAV_TAKE_A_TEST, homePageTestUrl, homeTestButtonText);
}
});
}
if (UiUtils.showChromeCast) {
this.hasPlayServices = Utils.checkPlayServices(this);
} else {
this.hasPlayServices = false;
}
try {
if (this.hasPlayServices) {
this.mSessionManager = CastContext.getSharedInstance(this).getSessionManager();
this.mCastContext = CastContext.getSharedInstance(this);
}
} catch (Exception unused6) {
}
getSupportFragmentManager().addOnBackStackChangedListener(new FragmentManager.OnBackStackChangedListener() {
public void onBackStackChangeCommitted(Fragment fragment, boolean z) {
androidx.fragment.app.s.a(this, fragment, z);
}
public void onBackStackChangeStarted(Fragment fragment, boolean z) {
androidx.fragment.app.s.b(this, fragment, z);
}
public final void onBackStackChanged() {
FusionViliteMainActivity.this.lambda$onCreate$14();
}
});
this.mAdapter.setItemClickListener(new ItemClickListener() {
@Override
public final void onClick(View view, int i2, Object obj, int i3, List list) {
FusionViliteMainActivity.this.lambda$onCreate$15(utilAppConfigurations, view, i2, obj, i3, list);
}
});
if (APIUtils.getUtilAppConfigurations(getApplicationContext()) != null && !TextUtils.isEmpty(APIUtils.getUtilAppConfigurations(getApplicationContext()).getExitPopupTemplate())) {
this.exitPopupEnabled = true;
this.templateCode = APIUtils.getUtilAppConfigurations(getApplicationContext()).getExitPopupTemplate();
}
viewBindDetailHeaderUI();
setExpandEnabled(false);
showToolBarButtons();
initUIelements();
Preferences instance = Preferences.instance(this);
int i2 = UiUtils.showBannerAds ? 500 : 50;
if (UiUtils.isNetworkConnected(this) || instance == null || !instance.getEnableOfflineDownload().booleanValue()) {
UiUtils.updateConfigFlags();
Configurations.updateClientConfigurations();
} else {
new Handler().postDelayed(new Runnable() {
@Override
public final void run() {
FusionViliteMainActivity.this.lambda$onCreate$16();
}
}, i2);
}
if (this.preferenceManager == null) {
getPreferenceManager();
}
User loggedUser = this.preferenceManager.getLoggedUser();
if (loggedUser != null && userId.equals(loggedUser.getUserId().toString())) {
OfflineDownloadData offlineDownloadData = this.mTargetPath;
if (offlineDownloadData != null && this.isComingFromNotification) {
new Handler().postDelayed(new Runnable() {
@Override
public final void run() {
FusionViliteMainActivity.this.lambda$onCreate$17();
}
}, i2);
} else if (offlineDownloadData != null && this.isComingFromCancelNotification) {
new Handler().postDelayed(new Runnable() {
@Override
public final void run() {
FusionViliteMainActivity.this.lambda$onCreate$18();
}
}, i2);
}
}
updateDOBGender();
initPALSdk(true);
if (!instance.getBooleanPreference("greendaoDB_Version").booleanValue()) {
instance.setBooleanPreference("greendaoDB_Version", Boolean.TRUE);
}
HashMap hashMap = new HashMap();
CustomLog.e("TAG", "#ATTRIBUTE_SOURCE_MENU : " + this.currentSelectedTab);
AnalyticsUtils.getInstance().trackAnalyticsEvent(ScreenType.HOME, null, null, null, this.currentSelectedTab, null, hashMap);
this.toolbar_logo.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
FusionViliteMainActivity.this.lambda$onCreate$19(view);
}
});
this.imgBack.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
FusionViliteMainActivity.this.lambda$onCreate$20(view);
}
});
new GetAndroidAdvertisingID(this).execute(new Void[0]);
if (!instance.getBooleanPreference("interstitial_static_popup").booleanValue()) {
showInterstitialStaticDialog();
}
createExitDialog();
if (Build.VERSION.SDK_INT >= 36) {
OnBackPressedCallback onBackPressedCallback = this.backPressedCallback;
if (onBackPressedCallback != null) {
onBackPressedCallback.remove();
}
if (this.backPressedCallback == null) {
this.backPressedCallback = new OnBackPressedCallback(true) {
public void handleOnBackPressed() {
FusionViliteMainActivity.this.onBackPressed();
}
};
getOnBackPressedDispatcher().addCallback(this, this.backPressedCallback);
}
}
}
public boolean onCreateOptionsMenu(android.view.Menu menu) {
getMenuInflater().inflate(R.menu.main, menu);
MenuItem findItem = menu.findItem(R.id.search);
MenuItem findItem2 = menu.findItem(R.id.filter);
this.filter = findItem2;
findItem2.setVisible(false);
Configs utilAppConfigurations = APIUtils.getUtilAppConfigurations(getApplicationContext());
if (utilAppConfigurations != null && utilAppConfigurations.isShowToolbarFilter()) {
this.filter.setVisible(true);
}
findItem.setVisible(false);
int i2 = R.id.media_route_menu_item;
this.chromecastMneu = menu.findItem(i2);
if (this.hasPlayServices) {
CastButtonFactory.setUpMediaRouteButton(getApplicationContext(), menu, i2);
}
return true;
}
public void onDestroy() {
AdManagerAdView adManagerAdView = this.mBannerAdView;
if (adManagerAdView != null) {
adManagerAdView.destroy();
}
Fragment fragment = this.mPlayerFragment;
if (fragment != null) {
((ExoPlayerFragment) fragment).callRecoEvent();
}
super.onDestroy();
if (isActivityRestarted) {
isActivityRestarted = false;
APIUtils.resetOttSDK();
} else {
DownloadTracker downloadTracker = this.downloadTracker;
if (downloadTracker != null) {
downloadTracker.removeListener(this);
}
OTTApplication.IS_FROM_CONTENT_MENU_DEEPLINK = false;
}
}
public void onDismissed(Map<String, Object> map, @Nullable Map<String, Object> map2) {
if (map != null) {
CustomLog.e("inAppAfterDismiss:", "extras size : " + map.size());
for (int i2 = 0; i2 < map.size(); i2++) {
CustomLog.e("inAppAfterDismiss:", "extras key:value : " + map.get(Integer.valueOf(i2)));
}
}
}
@Override
public void onDownloadsChanged() {
}
public void onInAppButtonClick(HashMap<String, String> hashMap) {
handleInappButtonClick(hashMap, "InAppButtonClick");
}
public void onInboxButtonClick(HashMap<String, String> hashMap) {
handleInappButtonClick(hashMap, "InboxButtonClick");
}
public void onNewIntent(Intent intent) {
PreferenceManager preferenceManager;
String str;
super/*androidx.activity.ComponentActivity*/.onNewIntent(intent);
if (this.preferenceManager == null) {
getPreferenceManager();
}
if (intent != null && intent.hasExtra("fromdeeplink") && (str = OTTApplication.sharedPath) != null) {
OTTApplication.sharedPath = "";
String str2 = (MyRecoManager.getInstance().getOriginSource() == null || !MyRecoManager.getInstance().getOriginSource().equalsIgnoreCase("Notification")) ? "" : NavigationConstants.NAV_FROM_NOTIFICATION;
MyRecoManager.getInstance().setOriginSource("Share");
NavigationUtils.performItemClickNavigation(null, this, str, str2);
}
if (this.hasPlayServices) {
addCastSessionListener();
this.mSessionManager.addSessionManagerListener(this.mSessionManagerListener);
CastSession castSession = this.mCastSession;
if (castSession != null && castSession.isConnected()) {
updateCastPlayer(true);
}
}
if (intent != null) {
try {
Bundle bundleExtra = getIntent().getBundleExtra("NOTIFICATION_DATA");
if (bundleExtra != null) {
this.mTargetPath = (OfflineDownloadData) bundleExtra.getParcelable(NavigationConstants.SERVICES_TARGET_PATH);
this.isComingFromNotification = bundleExtra.containsKey("SERVICES_COMING_NOTIFICATION") ? bundleExtra.getBoolean("SERVICES_COMING_NOTIFICATION") : false;
this.isComingFromCancelNotification = bundleExtra.containsKey("SERVICES_COMING_CANCEL_NOTIFICATION") ? bundleExtra.getBoolean("SERVICES_COMING_CANCEL_NOTIFICATION") : false;
userId = bundleExtra.containsKey("USER_ID") ? bundleExtra.getString("USER_ID") : "";
}
} catch (Exception unused) {
this.isComingFromNotification = false;
this.isComingFromCancelNotification = false;
}
OfflineDownloadData offlineDownloadData = this.mTargetPath;
if (offlineDownloadData == null || !this.isComingFromCancelNotification) {
if (offlineDownloadData == null || !this.isComingFromNotification || (preferenceManager = this.preferenceManager) == null || preferenceManager.getLoggedUser() == null) {
return;
}
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
MyRecoManager.getInstance().setOriginSource("Notification");
MyRecoManager.getInstance().setOriginMedium("Notification");
FusionViliteMainActivity.this.isComingFromNotification = false;
}
}, 500L);
return;
}
try {
DownloadTracker downloadTracker = this.downloadTracker;
if (downloadTracker != null) {
downloadTracker.onCancelDownload(intent, this);
}
} catch (Exception unused2) {
}
PreferenceManager preferenceManager2 = this.preferenceManager;
if (preferenceManager2 == null || preferenceManager2.getLoggedUser() == null) {
return;
}
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
MyRecoManager.getInstance().setOriginSource("Notification");
MyRecoManager.getInstance().setOriginMedium("Notification");
FusionViliteMainActivity.this.isComingFromCancelNotification = true;
}
}, 500L);
}
}
public boolean onOptionsItemSelected(MenuItem menuItem) {
if (this.preferenceManager == null) {
getPreferenceManager();
}
int itemId = menuItem.getItemId();
if (itemId == R.id.filter) {
List<ContentLanguage> contentLanguages = APIUtils.getUtilApplicationManager(getApplicationContext()).getContentLanguages();
FilterItemsList filterItemsList = new FilterItemsList();
ArrayList arrayList = new ArrayList();
for (ContentLanguage contentLanguage : contentLanguages) {
Filter.FilterItem filterItem = new Filter.FilterItem();
filterItem.setCode(contentLanguage.getCode());
filterItem.setTitle(contentLanguage.getName());
filterItem.setDisplaytText(contentLanguage.getDisplaytText());
arrayList.add(filterItem);
}
filterItemsList.setFilterItems(arrayList);
FilterItemsList genresFilterList = this.preferenceManager.getGenresFilterList();
if (genresFilterList != null) {
showBottomBar(false);
enableToolBarLogo(false);
NavigationUtils.sendAutoPlayPauseBroadCast(this);
NavigationUtils.sendStopAutoScrollBroadCast(this);
ShowFilterFragment showFilterFragment = new ShowFilterFragment(getSupportFragmentManager());
showFilterFragment.setLanguageFilterList(filterItemsList);
showFilterFragment.setGenreFilterList(genresFilterList);
getSupportFragmentManager().beginTransaction().setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out).add(R.id.contentframe, showFilterFragment, "ShowFilterFragment").addToBackStack((String) null).commitAllowingStateLoss();
}
} else if (itemId == R.id.search) {
Fragment findFragmentById = getSupportFragmentManager().findFragmentById(R.id.contentframe);
if ((findFragmentById instanceof SearchFragmentNew) || (findFragmentById instanceof SearchFragment)) {
return super/*android.app.Activity*/.onOptionsItemSelected(menuItem);
}
CleverTap.moviesEventTabViewed("Search");
searchPageNavigation();
}
return super/*android.app.Activity*/.onOptionsItemSelected(menuItem);
}
public void onPause() {
OTTApplication.isActivityPaused = true;
this.isBackgroundRequestCompleted = false;
NavigationUtils.sendAutoPlayPauseBroadCast(this);
NavigationUtils.sendStopAutoScrollBroadCast(this);
SessionManager sessionManager = this.mSessionManager;
if (sessionManager != null) {
sessionManager.removeSessionManagerListener(this.mSessionManagerListener);
}
this.mCastSession = null;
AdManagerAdView adManagerAdView = this.mBannerAdView;
if (adManagerAdView != null) {
adManagerAdView.pause();
}
super/*androidx.fragment.app.FragmentActivity*/.onPause();
}
public void onPictureInPictureModeChanged(boolean z, Configuration configuration) {
if (z) {
WatchWhileLayout watchWhileLayout = this.mWatchWhileLayout;
if (watchWhileLayout != null) {
watchWhileLayout.slideTo(1);
}
ExoPlayerFragment exoPlayerFragment = (ExoPlayerFragment) this.mPlayerFragment;
if (exoPlayerFragment != null) {
RelativeLayout relativeLayout = exoPlayerFragment.parent_access_layout;
if (relativeLayout != null && relativeLayout.getVisibility() == 0) {
((ExoPlayerFragment) this.mPlayerFragment).parent_access_layout.setVisibility(8);
}
AppCompatButton appCompatButton = ((ExoPlayerFragment) this.mPlayerFragment).nextEpisodeButton;
if (appCompatButton != null) {
appCompatButton.setVisibility(4);
}
ImageView imageView = ((ExoPlayerFragment) this.mPlayerFragment).imageBackIV;
if (imageView != null) {
imageView.setVisibility(4);
}
}
enterPIPMode = true;
this.mPIPReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
PlayerControlView playerControlView;
if (intent == null) {
return;
}
if (!intent.getAction().equals("media_control")) {
ExoPlayerFragment exoPlayerFragment2 = (ExoPlayerFragment) FusionViliteMainActivity.this.mPlayerFragment;
if (exoPlayerFragment2 == null || (playerControlView = exoPlayerFragment2.mPlayerControlView) == null) {
return;
}
playerControlView.rewind();
return;
}
int intExtra = intent.getIntExtra("control_type", 0);
if (intExtra == 1) {
FusionViliteMainActivity.this.resumePlayer();
} else {
if (intExtra != 2) {
return;
}
FusionViliteMainActivity.this.pausePlayer();
}
}
};
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction("media_control");
intentFilter.addAction("media_rewind_control");
if (!this.mRegistered) {
if (Build.VERSION.SDK_INT >= 33) {
registerReceiver(this.mPIPReceiver, intentFilter, 2);
} else {
registerReceiver(this.mPIPReceiver, intentFilter);
}
this.mRegistered = true;
}
} else {
enterPIPMode = false;
if (this.mRegistered) {
this.mRegistered = false;
unregisterReceiver(this.mPIPReceiver);
this.mPIPReceiver = null;
}
OTTApplication.IS_EXIT_PIP_MODE = true;
}
super/*androidx.activity.ComponentActivity*/.onPictureInPictureModeChanged(z, configuration);
}
public void onResume() {
super/*androidx.fragment.app.FragmentActivity*/.onResume();
OTTApplication.isActivityPaused = false;
if (this.isFavouriteClicked) {
this.isFavouriteClicked = false;
int menuPosition = getMenuPosition(this.previousSelectedTab);
TabLayout tabLayout = this.tabLayout;
tabLayout.selectTab(tabLayout.getTabAt(menuPosition), true);
}
Fragment fragment = this.mPlayerFragment;
if (fragment instanceof ExoPlayerFragment) {
ExoPlayerFragment exoPlayerFragment = (ExoPlayerFragment) fragment;
if (exoPlayerFragment.isTrailer || OTTApplication.PAUSE_PLAY_BACK || exoPlayerFragment.isShowNextEpisodeButtonShowing) {
OTTApplication.PAUSE_PLAY_BACK = false;
resumePlayer();
}
}
NavigationUtils.sendAutoPlayResumeBroadCast(this);
NavigationUtils.sendStartAutoScrollBroadCast(this);
TabLayout tabLayout2 = this.tabLayout;
if (tabLayout2 != null && tabLayout2.getSelectedTabPosition() != -1 && this.tabLayout.getSelectedTabPosition() == getMenuPosition("swag_mobile")) {
TabLayout tabLayout3 = this.tabLayout;
tabLayout3.selectTab(tabLayout3.getTabAt(getMenuPosition("home")));
}
TabLayout tabLayout4 = this.tabLayout;
if (tabLayout4 != null && tabLayout4.getSelectedTabPosition() != -1 && this.selectHomeOnPopFromWebView && this.tabLayout.getSelectedTabPosition() == getMenuPosition("plans")) {
TabLayout tabLayout5 = this.tabLayout;
tabLayout5.selectTab(tabLayout5.getTabAt(getMenuPosition("home")));
this.selectHomeOnPopFromWebView = false;
}
AdManagerAdView adManagerAdView = this.mBannerAdView;
if (adManagerAdView != null) {
adManagerAdView.resume();
}
closeDrawerLayout(null);
this.isBackgroundRequestCompleted = true;
if (this.hasPlayServices) {
addCastSessionListener();
this.mSessionManager.addSessionManagerListener(this.mSessionManagerListener);
}
APIUtils.getOTTSdkInstance(getApplicationContext());
HashMap<String, BottomDataModel> hashMap = UiUtils.mCommonTemplateHashMap;
if (hashMap != null && hashMap.size() == 0 && OttSDK.getInstance() != null) {
NavigationUtils.fetchTemplate(OttSDK.getInstance());
}
Fragment findFragmentById = getSupportFragmentManager().findFragmentById(R.id.contentframe);
if ((findFragmentById instanceof HomeFragment) || (findFragmentById instanceof ViewPagerFragment)) {
showBottomBar(true);
}
if (OTTApplication.isDrawerOpen) {
Fragment currentFragment = getCurrentFragment();
if (currentFragment == null || !(currentFragment instanceof HomeFragment)) {
if (currentFragment instanceof ViewPagerFragment) {
this.mDrawerLayout.openDrawer(8388611);
OTTApplication.isDrawerOpen = false;
}
} else if (((HomeFragment) currentFragment).targetPage.equalsIgnoreCase("home")) {
this.mDrawerLayout.openDrawer(8388611);
OTTApplication.isDrawerOpen = false;
}
}
if (OTTApplication.IS_PLAYER_PRESENT) {
this.mDrawerLayout.closeDrawers();
}
if (findFragmentById instanceof SearchFragmentNew) {
showBottomBar(false);
}
if (findFragmentById instanceof GridFragment) {
showBottomBar(false);
}
}
@Override
public void onSaveFilters(String str) {
}
@Override
public void onSaveLanugageGenreFilters(String str, final String str2, final String str3) {
OttSDK oTTSdkInstance;
CustomLog.d("DEBUG", "onSaveFilters ");
if (str.equalsIgnoreCase("logout")) {
Preferences.instance(this).setStringPreference("languageSelected", str2);
Preferences.instance(this).setStringPreference("genreSelected", str3);
completeRefresher();
}
if (str.equalsIgnoreCase("Save")) {
if ((TextUtils.isEmpty(str2) && TextUtils.isEmpty(str3)) || (oTTSdkInstance = APIUtils.getOTTSdkInstance(getApplicationContext())) == null || oTTSdkInstance.getUserManager() == null) {
return;
}
oTTSdkInstance.getUserManager().updateUserLanguageGenrePreferences(str2, str3, new UserManager.UserCallback<String>() {
@Override
public void onEmptySuccess() {
com.yupptv.ottsdk.managers.User.a.a(this);
}
@Override
public void onFailure(Error error) {
NavigationUtils.logKibanaError("FusionViliteMainActivity", "API", "/service/api/auth/update/session/preference", "NA", "NA", "NA", f.a(error, new StringBuilder("")), error.getMessage());
Toast.makeText((Context) FusionViliteMainActivity.this, (CharSequence) error.getMessage(), 1).show();
FusionViliteMainActivity.this.onBackPressed();
}
@Override
public void onSuccess(String str4) {
OTTApplication.isDrawerOpen = false;
Preferences.instance(FusionViliteMainActivity.this).setStringPreference("languageSelected", str2);
Preferences.instance(FusionViliteMainActivity.this).setStringPreference("genreSelected", str3);
Preferences.instance(FusionViliteMainActivity.this).setBooleanPreference("language_filter_applied_key", Boolean.TRUE);
FusionViliteMainActivity.this.Refresh();
}
});
}
}
@Override
public void onScrolledToEnd() {
}
public void onShow(CTInAppNotification cTInAppNotification) {
}
public void onTrimMemory(int i2) {
Fragment fragment;
super/*androidx.activity.ComponentActivity*/.onTrimMemory(i2);
try {
ActivityManager.RunningAppProcessInfo runningAppProcessInfo = new ActivityManager.RunningAppProcessInfo();
ActivityManager.getMyMemoryState(runningAppProcessInfo);
int i3 = runningAppProcessInfo.importance;
boolean z = i3 != 100;
if (i3 != 100 && (fragment = this.mPlayerFragment) != null) {
((ExoPlayerFragment) fragment).isFromBackground = false;
}
if ((i2 == 80 || i2 == 60) && z) {
startActivity(getIntent());
}
} catch (Exception unused) {
}
}
public void onUserLeaveHint() {
Configs utilAppConfigurations;
ExoPlayerFragment exoPlayerFragment;
ExoPlayer exoPlayer;
if (!getPackageManager().hasSystemFeature("android.software.picture_in_picture") || (utilAppConfigurations = APIUtils.getUtilAppConfigurations(getApplicationContext())) == null || utilAppConfigurations.getIsPictureInPictureEnabled() == null || !utilAppConfigurations.getIsPictureInPictureEnabled().equalsIgnoreCase("true") || Build.VERSION.SDK_INT < 26) {
return;
}
this.pictureInPictureParamsBuilder = new PictureInPictureParams.Builder();
updatePictureInPictureActions(R.drawable.ic_player_pause, this.mPause, 2, 2);
if (isInPictureInPictureMode()) {
return;
}
int i2 = this.playerCurrentState;
if ((1 == i2 || 2 == i2) && (exoPlayerFragment = (ExoPlayerFragment) this.mPlayerFragment) != null && (exoPlayer = exoPlayerFragment.player) != null && exoPlayer.getPlayWhenReady() && ((ExoPlayerFragment) this.mPlayerFragment).player.isPlaying()) {
ExoPlayerFragment exoPlayerFragment2 = (ExoPlayerFragment) this.mPlayerFragment;
if (exoPlayerFragment2.isTrailer) {
return;
}
exoPlayerFragment2.setVideoListener(this.mVideoListner);
ExoPlayerFragment exoPlayerFragment3 = (ExoPlayerFragment) this.mPlayerFragment;
if (exoPlayerFragment3 != null) {
exoPlayerFragment3.hidePipControles();
}
enterPictureInPictureMode(this.pictureInPictureParamsBuilder.build());
}
}
@Override
public void onVideoCollapse() {
if (getSupportFragmentManager().findFragmentById(R.id.contentframe) instanceof DetailsFragment) {
toggleBackButton(true);
updateToolbarItems(true, false);
enableHomeToolbar(true);
this.toolbar.setVisibility(8);
}
showSystemUI();
updateFavouritesIcon();
onVideoFullscreen(false);
this.mWatchWhileLayout.minimize(true);
if (isBottomBarVisible()) {
this.bannerAdsBottomMargin = (int) getResources().getDimension(R.dimen.banner_ad_bottom_margin_bottom_bar_and_dock_player);
} else {
this.bannerAdsBottomMargin = (int) getResources().getDimension(R.dimen.banner_ad_bottom_margin_dock_player_only);
}
setBannerAdsMargin();
WatchWhileLayout watchWhileLayout = this.mWatchWhileLayout;
if (watchWhileLayout.mIsFullscreen) {
watchWhileLayout.exitFullscreenToMinimize();
}
CastSession castSession = this.mCastSession;
if (castSession == null || !castSession.isConnected()) {
return;
}
exitMiniPlayer();
}
@Override
public void onVideoFullscreen(boolean z) {
updateWatchWhileScreen(z);
}
@Override
public void onViewScrolled(float f2) {
if (f2 <= OTTApplication.getApplicationConfig().screenHeight * 0.1f) {
LinearLayout linearLayout = this.torcai_footer_adRL;
if (linearLayout != null) {
linearLayout.setVisibility(8);
return;
}
return;
}
if (this.torcai_footer_adRL != null) {
if (!(getSupportFragmentManager().findFragmentById(R.id.contentframe) instanceof HomeFragment)) {
this.torcai_footer_adRL.setVisibility(8);
} else if (this.footerAdLoaded) {
this.torcai_footer_adRL.setVisibility(0);
} else {
this.torcai_footer_adRL.setVisibility(8);
}
}
}
@Override
public void onViewScrolledDown() {
}
@Override
public void onViewScrolledUp() {
}
public void onWindowFocusChanged(boolean z) {
super/*android.app.Activity*/.onWindowFocusChanged(z);
CustomLog.e("FusionViliteMainActivity", "Window focus changes : has focus " + z + " player state " + this.playerCurrentState);
}
public void pausePlayer() {
Fragment fragment = this.mPlayerFragment;
if (fragment == null || !(fragment instanceof ExoPlayerFragment)) {
return;
}
((ExoPlayerFragment) fragment).pausePlayer();
}
public void refreshFavourites() {
TabLayout tabLayout = this.tabLayout;
String obj = tabLayout.getTabAt(tabLayout.getSelectedTabPosition()).getTag().toString();
if (obj == null || !obj.trim().equalsIgnoreCase("favourites")) {
return;
}
FragmentManager supportFragmentManager = getSupportFragmentManager();
int i2 = R.id.contentframe;
if (supportFragmentManager.findFragmentById(i2) instanceof ViewPagerFragment) {
Fragment findFragmentById = getSupportFragmentManager().findFragmentById(i2);
if (findFragmentById instanceof ViewPagerFragment) {
((ViewPagerFragment) findFragmentById).refreshFavourites();
}
}
}
public void refreshListpage() {
if (this.doListRefresh) {
FragmentManager supportFragmentManager = getSupportFragmentManager();
int i2 = R.id.contentframe;
if (supportFragmentManager.findFragmentById(i2) instanceof GridFragment) {
if (!((GridFragment) getSupportFragmentManager().findFragmentById(i2)).isFavourites && !((GridFragment) getSupportFragmentManager().findFragmentById(i2)).isSearch) {
RestAdapter.enableCache(false);
}
((GridFragment) getSupportFragmentManager().findFragmentById(i2)).requestContent(false);
this.doListRefresh = false;
}
}
}
public void refreshPager() {
updateSubscribeimage();
if (this.currentSelectedTab.equalsIgnoreCase(AnalyticsUtils.ATTRIBUTE_VALUE_SOURCE_ACCOUNT_PAGE)) {
launchAccountPage();
return;
}
if (getSupportFragmentManager().findFragmentByTag("viewPagerFragment") != null) {
getSupportFragmentManager().beginTransaction().remove(getSupportFragmentManager().findFragmentByTag("viewPagerFragment")).commitAllowingStateLoss();
}
ViewPagerFragment viewPagerFragment = new ViewPagerFragment();
this.viewPagerFragment = viewPagerFragment;
this.clickListener = viewPagerFragment;
getSupportFragmentManager().beginTransaction().replace(R.id.contentframe, this.viewPagerFragment, "viewPagerFragment").commitAllowingStateLoss();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
if (FusionViliteMainActivity.this.viewPagerFragment != null) {
FusionViliteMainActivity.this.viewPagerFragment.setCurrentTab(FusionViliteMainActivity.this.viewPagerFragment != null ? FusionViliteMainActivity.this.viewPagerFragment.getCurrentTab() : 0);
}
TabLayout tabLayout = FusionViliteMainActivity.this.tabLayout;
if (tabLayout != null) {
if (tabLayout.getSelectedTabPosition() != -1) {
TabLayout tabLayout2 = FusionViliteMainActivity.this.tabLayout;
if (tabLayout2.getTabAt(tabLayout2.getSelectedTabPosition()) != null) {
TabLayout tabLayout3 = FusionViliteMainActivity.this.tabLayout;
tabLayout3.getTabAt(tabLayout3.getSelectedTabPosition()).select();
return;
}
}
FusionViliteMainActivity.this.tabLayout.getTabAt(0).select();
}
}
}, 20L);
}
public void refreshViewAllData() {
FragmentManager supportFragmentManager = getSupportFragmentManager();
int i2 = R.id.contentframe;
if (supportFragmentManager.findFragmentById(i2) instanceof LinearFragment) {
((LinearFragment) getSupportFragmentManager().findFragmentById(i2)).requestContent(false);
} else if (getSupportFragmentManager().findFragmentById(i2) instanceof DetailsFragment) {
((DetailsFragment) getSupportFragmentManager().findFragmentById(i2)).getNextPageResponse();
}
}
public void registerForScanResult() {
this.barcodeLauncher.launch(new ScanOptions().setOrientationLocked(false).setCaptureActivity(ActivateDeviceFragment.class));
}
public void requestContent(final String str) {
APIUtils.getmMediaManager(getApplicationContext()).getPageContent(str, new MediaCatalogManager.MediaCatalogCallback<ContentPage>() {
@Override
public void onFailure(Error error) {
}
@Override
public void onSuccess(ContentPage contentPage) {
if (contentPage == null || contentPage.getPageData() == null || contentPage.getPageData() == null || contentPage.getPageData().isEmpty() || contentPage.getPageData().get(0).getSection() == null || contentPage.getPageData().get(0).getSection().getSectionData() == null || !str.contains(contentPage.getPageData().get(0).getContentCode())) {
return;
}
if (contentPage.getPageData().get(0).getSection().getSectionInfo() != null) {
contentPage.getPageData().get(0).getSection().getSectionData().setExploreSectionTitle(contentPage.getPageData().get(0).getSection().getSectionInfo().getName());
}
OTTApplication.pageData = contentPage.getPageData().get(0).getSection().getSectionData();
if (contentPage.getPageData().get(0).getSection().getSectionData().getCards() == null || contentPage.getPageData().get(0).getSection().getSectionData().getCards().isEmpty()) {
return;
}
OTTApplication.exitPopupApiCalled = true;
}
});
}
public void resetNowPlayingPath() {
if (this.isNowPlayingPath != null) {
this.isNowPlayingPath = "";
}
ExoPlayerFragment exoPlayerFragment = (ExoPlayerFragment) this.mPlayerFragment;
ExoPlayer exoPlayer = exoPlayerFragment.player;
if (exoPlayer == null || exoPlayer.getPlayWhenReady()) {
return;
}
exoPlayerFragment.mPauseButton.setVisibility(8);
exoPlayerFragment.mPlayButton.setVisibility(0);
}
public void restrictBackgroundActions(boolean z) {
if (z) {
getWindow().setFlags(16, 16);
} else {
getWindow().clearFlags(16);
}
}
public void resumePlayer() {
Fragment fragment = this.mPlayerFragment;
if (fragment == null || !(fragment instanceof ExoPlayerFragment)) {
return;
}
((ExoPlayerFragment) fragment).resumePlayer();
}
public void saveCastObject(JSONObject jSONObject) {
mCastObject = jSONObject;
}
public void saveEpgChannelList(EPGUserChannels ePGUserChannels) {
this.mEPGUserChannels = ePGUserChannels;
}
public void setAutoplayPosterModel(AutoplayPosterModel autoplayPosterModel) {
this.autoplayPosterModel = autoplayPosterModel;
}
public void setButtonType(ButtonType buttonType) {
this.mButtonType = buttonType;
}
public void setCarouselRecycler(Carousel carousel) {
this.mRecyclerView = carousel;
}
public void setClicked(boolean z) {
this.isClick = z;
}
public void setEPGProgramData(EPGProgramsData ePGProgramsData) {
this.mEPGProgramsData = ePGProgramsData;
}
public void setEpgData(EPG epg) {
this.epgData = epg;
}
public void setEpgDataTracker(HashMap<String, Boolean> hashMap) {
this.epgDataTracker = hashMap;
}
public void setPartnerAutoplayBannerModel(PartnerAutoplayBannerModel partnerAutoplayBannerModel) {
this.partnerAutoplayBannerModel = partnerAutoplayBannerModel;
}
public void setPartnerCarouselRecycler(Carousel carousel) {
this.mPartnerRecyclerView = carousel;
}
public void setPlayerScreenSource(String str) {
this.playerScreenSource = str;
}
public void setStreamPollKey(String str) {
this.mStreamPollKey = str;
}
@Override
public void setTitle(String str) {
setToolbarTitle(str);
}
@Override
public void showBottomBar(boolean z) {
if (z) {
this.iV_Gradient_top.setVisibility(8);
if (this.footerAdLoaded) {
this.torcai_footer_adRL.setVisibility(0);
}
} else {
this.torcai_footer_adRL.setVisibility(8);
this.iV_Gradient_top.setVisibility(8);
}
this.bannerAdsBottomMargin = (int) getResources().getDimension(R.dimen.banner_ad_bottom_margin_default);
TabLayout tabLayout = this.tabLayout;
if (tabLayout != null) {
if (z) {
if (tabLayout.getTabAt(tabLayout.getSelectedTabPosition()) != null) {
TabLayout tabLayout2 = this.tabLayout;
isSubMenusAvailable(tabLayout2.getTabAt(tabLayout2.getSelectedTabPosition()).getTag().toString());
}
this.bannerAdsBottomMargin = (int) getResources().getDimension(R.dimen.banner_ad_bottom_margin_bottom_bar_only);
}
WatchWhileLayout watchWhileLayout = this.mWatchWhileLayout;
if (watchWhileLayout != null) {
if (z) {
watchWhileLayout.addBottomPadding(this, true);
if (this.mWatchWhileLayout.mState == 2) {
this.bannerAdsBottomMargin = (int) getResources().getDimension(R.dimen.banner_ad_bottom_margin_bottom_bar_and_dock_player);
}
} else {
watchWhileLayout.addBottomPadding(this, false);
if (this.mWatchWhileLayout.mState == 2) {
this.bannerAdsBottomMargin = (int) getResources().getDimension(R.dimen.banner_ad_bottom_margin_dock_player_only);
}
}
}
this.tabLayout.setVisibility(z ? 0 : 8);
this.linear_tablayout.setVisibility(z ? 0 : 8);
if (z && this.doSectionsRefresh) {
refreshSections();
}
setBannerAdsMargin();
}
}
public void showChromecastLoading(boolean z) {
CustomLog.e("chromeCast", "showChromecastLoading : " + this.itemObject);
}
public void showDetailsPage() {
NestedScrollView nestedScrollView;
UpNextFragment upNextFragment = this.mUpNextFragment;
if (upNextFragment == null || (nestedScrollView = upNextFragment.playerSuggestionNestedScrollview) == null) {
return;
}
nestedScrollView.setVisibility(0);
}
public void showHideToolBar(boolean z) {
this.accountHeaderLayout.setVisibility(z ? 0 : 8);
}
public void showProgressBar() {
LineSpinFadeLoaderView lineSpinFadeLoaderView = this.drawerProgressBar;
if (lineSpinFadeLoaderView != null && lineSpinFadeLoaderView.getVisibility() != 0) {
this.drawerProgressBar.setVisibility(0);
restrictBackgroundActions(true);
}
LineSpinFadeLoaderView lineSpinFadeLoaderView2 = this.drawerProgressBar;
if (lineSpinFadeLoaderView2 instanceof LineSpinFadeLoaderView) {
lineSpinFadeLoaderView2.startAnimation();
}
}
public void showSuggestionsLayout(Object obj) {
UpNextFragment upNextFragment = this.mUpNextFragment;
if (upNextFragment == null || !upNextFragment.isAdded()) {
return;
}
this.mUpNextFragment.updateItem(obj);
}
public void showSystemUI() {
CustomLog.e("SystemUI", "SHow system UI");
getWindow().clearFlags(1024);
if (!ViewConfiguration.get(this).hasPermanentMenuKey()) {
getWindow().getDecorView().setSystemUiVisibility(1024);
}
getWindow().setStatusBarColor(ContextCompat.getColor(this, R.color.black));
}
public void showWebViewNavigationPopup(final Params params, final boolean z) {
if (params == null || params.getPopupTitle() == null || params.getPopupTitle().trim().length() <= 0 || params.getPopupMessage() == null || params.getPopupMessage().trim().length() <= 0) {
if (params.getUrl() == null || params.getUrl().trim().length() <= 0) {
return;
}
startActivity(new Intent("android.intent.action.VIEW", Uri.parse(params.getUrl())));
return;
}
HashMap hashMap = new HashMap();
hashMap.put("title", params.getPopupTitle());
hashMap.put("message", params.getPopupMessage());
hashMap.put("ButtonText", params.getButtonTitle());
NavigationUtils.showDialog((FragmentActivity) this, DialogType.WEBVIEW_NAVIGATION_DIALOG, hashMap, new DialogListener() {
@Override
public void itemClicked(boolean z2, int i2, int i3) {
}
@Override
public void itemClicked(boolean z2, int i2, HashMap hashMap2) {
if (i2 == 1 && params.getUrl().trim().length() > 0) {
FusionViliteMainActivity.this.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(params.getUrl())));
}
FusionViliteMainActivity.this.tabLayout.getTabAt(0).select();
if (!z || FusionViliteMainActivity.this.viewPagerFragment == null) {
return;
}
FusionViliteMainActivity.this.viewPagerFragment.setCurrentTab(0);
}
});
}
public void showWebViewNavigationPopupTest(final MockTestList mockTestList, boolean z) {
if (mockTestList == null || mockTestList.getPopupTitle() == null || mockTestList.getPopupTitle().trim().length() <= 0 || mockTestList.getPopupMessage() == null || mockTestList.getPopupMessage().trim().length() <= 0) {
if (mockTestList.getRedirectionUrl() == null || mockTestList.getRedirectionUrl().trim().length() <= 0) {
return;
}
startActivity(new Intent("android.intent.action.VIEW", Uri.parse(mockTestList.getRedirectionUrl())));
return;
}
HashMap hashMap = new HashMap();
hashMap.put("title", mockTestList.getPopupTitle());
hashMap.put("message", mockTestList.getPopupMessage());
hashMap.put("ButtonText", "proceed");
NavigationUtils.showDialog((FragmentActivity) this, DialogType.WEBVIEW_NAVIGATION_DIALOG, hashMap, new DialogListener() {
@Override
public void itemClicked(boolean z2, int i2, int i3) {
}
@Override
public void itemClicked(boolean z2, int i2, HashMap hashMap2) {
if (i2 != 1 || mockTestList.getRedirectionUrl().trim().length() <= 0) {
return;
}
FusionViliteMainActivity.this.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(mockTestList.getRedirectionUrl())));
}
});
}
public void showbottomTabs() {
Fragment findFragmentById = getSupportFragmentManager().findFragmentById(R.id.contentframe);
if (((findFragmentById instanceof HomeFragment) || (findFragmentById instanceof ViewPagerFragment)) && !OTTApplication.fav) {
showBottomBar(true);
}
}
public void stopOrStartPlayer(boolean z) {
Fragment fragment = this.mPlayerFragment;
if (fragment instanceof ExoPlayerFragment) {
if (z) {
((ExoPlayerFragment) fragment).pausePlayer();
} else {
((ExoPlayerFragment) fragment).resumePlayer();
}
}
}
public void togglePlaystate(boolean z) {
Fragment fragment = this.mPlayerFragment;
if (fragment instanceof ExoPlayerFragment) {
((ExoPlayerFragment) fragment).tooglePlayer(z);
}
}
public void toggleUnFavButton(List<String> list) {
this.unfavList = list;
if (list.size() > 0) {
this.favouritesActionMenuLayout.setVisibility(0);
} else {
this.favouritesActionMenuLayout.setVisibility(8);
}
}
public void trackEvent(String str) {
try {
AnalyticsV2.getInstance().trackEvent(str);
} catch (NullPointerException unused) {
}
}
public void updateAdsMap(AdUrlResponse adUrlResponse, String str) {
if (UiUtils.showAds && adUrlResponse != null) {
if (this.adsHashMap == null) {
this.adsHashMap = new HashMap<>();
}
ViewPagerFragment viewPagerFragment = this.viewPagerFragment;
if (viewPagerFragment != null) {
int currentTab = viewPagerFragment.getCurrentTab();
if (currentTab < 0) {
currentTab = 0;
}
this.adsHashMap.put("adtab_" + str, adUrlResponse);
ViewPagerFragment viewPagerFragment2 = this.viewPagerFragment;
if (str.equalsIgnoreCase(viewPagerFragment2.getTargetPath(viewPagerFragment2.getCurrentTab()))) {
prepareAds();
}
CustomLog.e("DFP ADS", "adhash map key adtab_" + currentTab);
}
}
}
public void updateChatFragment(ContentPage contentPage) {
UpNextFragment upNextFragment = this.mUpNextFragment;
if (upNextFragment != null) {
upNextFragment.updateMetaInfoItem(contentPage);
}
}
@Override
public void updateData(Object obj) {
restrictBackgroundActions(false);
if (obj != null) {
trackPlayerEvents(AnalyticsUtils.EVENT_PLAYER, this.playerScreenSource, obj);
UpNextFragment upNextFragment = this.mUpNextFragment;
if (upNextFragment != null) {
upNextFragment.showProgressBar(false);
}
UpNextFragment upNextFragment2 = this.mUpNextFragment;
if (upNextFragment2 != null) {
upNextFragment2.updateMetaInfoItem(obj);
this.mUpNextFragment.playerSuggestionNestedScrollview.setVisibility(4);
return;
}
return;
}
int i2 = this.playerCurrentState;
if (i2 != 1) {
if (i2 != 2) {
return;
}
this.mWatchWhileLayout.slideHorizontal(true);
return;
}
Fragment fragment = this.mPlayerFragment;
if (fragment instanceof ExoPlayerFragment) {
((ExoPlayerFragment) fragment).switchFullscreen(false);
}
this.mWatchWhileLayout.minimize(true);
WatchWhileLayout watchWhileLayout = this.mWatchWhileLayout;
if (watchWhileLayout.mIsFullscreen) {
watchWhileLayout.exitFullscreenToMinimize();
}
WatchWhileLayout watchWhileLayout2 = this.mWatchWhileLayout;
watchWhileLayout2.mIsFullscreen = false;
watchWhileLayout2.mState = 2;
watchWhileLayout2.slideHorizontal(true);
}
@Override
public void updateDetailHeader(Object obj, int i2) {
if (obj == null || !(obj instanceof ContentPage)) {
return;
}
int i3 = 0;
while (true) {
ContentPage contentPage = (ContentPage) obj;
if (i3 >= contentPage.getPageData().size()) {
return;
}
PageData pageData = contentPage.getPageData().get(i3);
PageInfo pageInfo = contentPage.getPageInfo();
if (pageData.getPaneType().equalsIgnoreCase("content")) {
this.detailInfoRelativeLayout.setVisibility(0);
this.detailHeaderLayout.setVisibility(0);
boolean z = true;
if (pageInfo == null || pageInfo.getAttributes() == null || pageInfo.getAttributes().getContentType() == null || !pageInfo.getAttributes().getContentType().equalsIgnoreCase("movie")) {
if (pageInfo == null || pageInfo.getAttributes() == null || pageInfo.getAttributes().getContentType() == null || !pageInfo.getAttributes().getContentType().equalsIgnoreCase(LogSubCategory.ApiCall.NETWORK)) {
this.detailBackgroundImage.setVisibility(0);
this.detailPosterImage.setVisibility(8);
this.detatilGradientView.setVisibility(0);
this.fixedAspectRatioRL.setmAspectRatio(getResources().getFraction(R.fraction.details_bg_aspect_ratio, 1, 1));
if (APIUtils.getmMediaManager(getApplicationContext()) != null) {
try {
Glide.with(getApplicationContext()).load(APIUtils.getAbsoluteImagePath(getApplicationContext(), pageData.getContent().getBackgroundImage())).error(R.drawable.default_banner).transition(DrawableTransitionOptions.withCrossFade()).into(this.detailBackgroundImage);
} catch (IllegalArgumentException e2) {
e2.getMessage();
}
this.imgBack.setVisibility(0);
Iterator<Content.DataRow> it = pageData.getContent().getDataRows().iterator();
while (it.hasNext()) {
for (Content.Elements elements : it.next().getElements()) {
if (elements.getElementSubtype() != null && elements.getElementType() != null && elements.getElementType().equalsIgnoreCase("Image") && elements.getElementSubtype().equalsIgnoreCase("bgImage")) {
try {
Glide.with(getApplicationContext()).load(APIUtils.getAbsoluteImagePath(getApplicationContext(), elements.getData())).error(R.drawable.default_banner).transition(DrawableTransitionOptions.withCrossFade()).into(this.detailBackgroundImage);
} catch (IllegalArgumentException e3) {
e3.getMessage();
}
}
}
}
}
} else if (APIUtils.getmMediaManager(getApplicationContext()) != null && pageData.getContent() != null && pageData.getContent().getDataRows() != null && pageData.getContent().getDataRows().size() > 0) {
this.imgBack.setVisibility(0);
Iterator<Content.DataRow> it2 = pageData.getContent().getDataRows().iterator();
while (it2.hasNext()) {
for (Content.Elements elements2 : it2.next().getElements()) {
Fragment findFragmentById = getSupportFragmentManager().findFragmentById(R.id.contentframe);
if (findFragmentById == null || !(findFragmentById instanceof DetailsFragment)) {
this.detailHeaderRootLayout.setVisibility(8);
} else {
this.detailHeaderLayout.setVisibility(0);
this.detailBackgroundImage.setVisibility(0);
this.detatilGradientView.setVisibility(8);
this.detailHeaderRootLayout.setVisibility(0);
this.fixedAspectRatioRL.setmAspectRatio(getResources().getFraction(R.fraction.details_bg_partner_aspect_ratio, 1, 1));
if (elements2.getElementType().equalsIgnoreCase("Image") && elements2.getElementSubtype().equalsIgnoreCase("bgImage")) {
try {
Glide.with(getApplicationContext()).load(APIUtils.getAbsoluteImagePath(getApplicationContext(), elements2.getData())).error(R.drawable.default_banner).transition(DrawableTransitionOptions.withCrossFade()).into(this.detailBackgroundImage);
} catch (IllegalArgumentException e4) {
e4.getMessage();
}
}
}
}
}
}
z = false;
} else {
this.detailBackgroundImage.setVisibility(0);
this.detailPosterImage.setVisibility(8);
this.detatilGradientView.setVisibility(0);
this.fixedAspectRatioRL.setmAspectRatio(getResources().getFraction(R.fraction.details_bg_aspect_ratio, 1, 1));
if (APIUtils.getmMediaManager(getApplicationContext()) != null) {
try {
Glide.with(getApplicationContext()).load(APIUtils.getAbsoluteImagePath(getApplicationContext(), pageData.getContent().getBackgroundImage())).error(R.drawable.default_banner).transition(DrawableTransitionOptions.withCrossFade()).into(this.detailBackgroundImage);
} catch (IllegalArgumentException e5) {
e5.getMessage();
}
}
}
createDetailInfoDataRows(pageData.getContent().getDataRows(), z);
}
i3++;
}
}
public void updateEPGTitle(String str) {
EPGFiltersFragment ePGFiltersFragment = (EPGFiltersFragment) getSupportFragmentManager().findFragmentByTag("filter");
if (ePGFiltersFragment != null) {
ePGFiltersFragment.updateEpgTitle(str);
}
}
public void updateFavouritesIcon() {
Fragment fragment;
if (UiUtils.isNetworkConnected(this) && (fragment = this.mPlayerFragment) != null) {
((ExoPlayerFragment) fragment).updateFavouritesIcon();
}
}
public void updateLocalPlayer() {
this.mCastSession = this.mCastContext.getSessionManager().getCurrentCastSession();
CastContext castContext = this.mCastContext;
if (castContext != null && castContext.getCastState() == 4) {
maximizePlayer();
return;
}
this.isComingFromChromeCast = true;
CastSession castSession = this.mCastSession;
if (castSession != null && castSession.getRemoteMediaClient() != null && this.mCastSession.getRemoteMediaClient().getMediaInfo() != null) {
if (this.mCastContext.getSessionManager().getCurrentCastSession().getRemoteMediaClient().getStreamDuration() > 0) {
this.seekValue = this.mCastContext.getSessionManager().getCurrentCastSession().getRemoteMediaClient().getApproximateStreamPosition();
} else {
this.seekValue = 0L;
}
}
OttLog.error("itemObjTemp", "++++++++++" + this.itemObjTemp);
Object obj = this.itemObjTemp;
try {
if (obj != null) {
if (isValidStreamingContent(obj)) {
try {
Fragment fragment = this.mPlayerFragment;
if (fragment instanceof ExoPlayerFragment) {
((ExoPlayerFragment) fragment).isChromeCastStop = true;
}
} catch (Exception unused) {
}
((ExoPlayerFragment) this.mPlayerFragment).hideDocPlayer();
goToDetail(this.itemObjTemp);
return;
}
Fragment fragment2 = this.mPlayerFragment;
if (fragment2 == null || !(fragment2 instanceof ExoPlayerFragment)) {
return;
}
((ExoPlayerFragment) fragment2).hideChromeCast();
return;
}
if (this.itemObject != null || obj != null || mCastObject == null) {
if (getPlayerCurrentState() <= 0 || this.mWatchWhileLayout == null) {
return;
}
if (getPlayerCurrentState() != 1) {
this.mWatchWhileLayout.exitPlayer(this.mCastSession);
return;
} else {
this.mWatchWhileLayout.exitFullscreenToMinimize();
this.mWatchWhileLayout.exitPlayer(this.mCastSession);
return;
}
}
Gson gson = new Gson();
ContentPage contentPage = (ContentPage) gson.fromJson(mCastObject.toString(), ContentPage.class);
ContentPage contentPage2 = (contentPage == null || contentPage.getPageInfo() == null) ? (Card) gson.fromJson(mCastObject.toString(), Card.class) : null;
if (contentPage == null || contentPage.getPageInfo() == null) {
contentPage = contentPage2;
}
if (!isValidStreamingContent(contentPage)) {
Fragment fragment3 = this.mPlayerFragment;
if (fragment3 == null || !(fragment3 instanceof ExoPlayerFragment)) {
return;
}
((ExoPlayerFragment) fragment3).hideChromeCast();
return;
}
try {
Fragment fragment4 = this.mPlayerFragment;
if (fragment4 instanceof ExoPlayerFragment) {
((ExoPlayerFragment) fragment4).isChromeCastStop = true;
}
} catch (Exception unused2) {
}
if (getPlayerCurrentState() != 0) {
goToDetail(contentPage);
}
} catch (Exception unused3) {
}
}
public void updateMenutab(final String str) {
final int menuPosition = getMenuPosition(str);
if (isSubMenusAvailable(str)) {
ViewPagerFragment viewPagerFragment = new ViewPagerFragment();
this.viewPagerFragment = viewPagerFragment;
this.clickListener = viewPagerFragment;
getSupportFragmentManager().beginTransaction().replace(R.id.contentframe, this.viewPagerFragment, "viewPagerFragment").commitAllowingStateLoss();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
int i2;
if (str.equalsIgnoreCase("search") && FusionViliteMainActivity.this.viewPagerFragment != null) {
FusionViliteMainActivity.this.viewPagerFragment.setCurrentTab(0);
} else if (menuPosition >= 0 && FusionViliteMainActivity.this.viewPagerFragment != null) {
FusionViliteMainActivity.this.viewPagerFragment.setCurrentTab(menuPosition);
}
TabLayout tabLayout = FusionViliteMainActivity.this.tabLayout;
if (tabLayout == null || (i2 = menuPosition) < 0 || i2 >= tabLayout.getTabCount()) {
return;
}
FusionViliteMainActivity.this.tabLayout.getTabAt(menuPosition).select();
}
}, 20L);
return;
}
TabLayout tabLayout = this.tabLayout;
if (tabLayout == null || menuPosition < 0 || menuPosition >= tabLayout.getTabCount()) {
return;
}
this.tabLayout.getTabAt(menuPosition).select();
}
public void updateMyDownloads() {
UpNextFragment upNextFragment = this.mUpNextFragment;
if (upNextFragment != null) {
upNextFragment.updateMyDownloads();
}
}
public void updateNavigationFrom(String str) {
if (str != null) {
this.navigationFrom = str;
} else {
this.navigationFrom = "";
}
}
public void updatePictureInPictureActions(@DrawableRes int i2, String str, int i3, int i4) {
try {
ArrayList arrayList = new ArrayList();
if (Build.VERSION.SDK_INT >= 26) {
arrayList.add(new RemoteAction(Icon.createWithResource((Context) this, i2), str, str, PendingIntent.getBroadcast(this, i4, new Intent("media_control").putExtra("control_type", i3), 67108864)));
PictureInPictureParams.Builder builder = this.pictureInPictureParamsBuilder;
if (builder != null) {
builder.setActions(arrayList);
setPictureInPictureParams(this.pictureInPictureParamsBuilder.build());
}
}
} catch (Exception unused) {
}
}
@Override
public void updateSliderMenu() {
try {
APIUtils.getOTTSdkInstance(getApplicationContext()).getUserManager().getUserInfo(new UserManager.UserCallback<User>() {
@Override
public void onEmptySuccess() {
com.yupptv.ottsdk.managers.User.a.a(this);
}
@Override
public void onFailure(Error error) {
NavigationUtils.logKibanaError("FusionViliteMainActivity", "API", "/service/api/auth/user/info", "NA", "NA", "NA", f.a(error, new StringBuilder("")), error.getMessage());
FusionViliteMainActivity.this.hideProgressBar();
InAppNotificationListener inAppNotificationListener = FusionViliteMainActivity.this;
if (inAppNotificationListener == null || inAppNotificationListener.isFinishing()) {
return;
}
FusionViliteMainActivity.this.updateNonLogin();
}
@Override
public void onSuccess(User user) {
FusionViliteMainActivity.this.hideProgressBar();
InAppNotificationListener inAppNotificationListener = FusionViliteMainActivity.this;
if (inAppNotificationListener == null || inAppNotificationListener.isFinishing()) {
return;
}
CleverTap.setProperties(new HashMap(), FusionViliteMainActivity.this);
FusionViliteMainActivity.this.updateUserLayout(user);
Configs utilAppConfigurations = APIUtils.getUtilAppConfigurations(FusionViliteMainActivity.this);
if (utilAppConfigurations != null && !TextUtils.isEmpty(utilAppConfigurations.getPrepaidRenewLottieJson())) {
try {
JSONObject jSONObject = new JSONObject(utilAppConfigurations.getPrepaidRenewLottieJson());
if (jSONObject.has("enabled") && jSONObject.getBoolean("enabled") && jSONObject.has("template_code") && !TextUtils.isEmpty(jSONObject.getString("template_code")) && user.getAttributes() != null && !TextUtils.isEmpty(user.getAttributes().getTemplate()) && jSONObject.getString("template_code").equalsIgnoreCase(user.getAttributes().getTemplate())) {
FusionViliteMainActivity.this.showPrepaidRenewLottie();
}
} catch (JSONException unused) {
}
}
if (OTTApplication.SUBSCRIPTION_STATUS_SUCCESS) {
OTTApplication.SUBSCRIPTION_STATUS_SUCCESS = false;
if (OTTApplication.IS_FROM_DETAILS_PAGE) {
OTTApplication.IS_FROM_DETAILS_PAGE = false;
if (OTTApplication.item != null) {
FusionViliteMainActivity.this.onBackPressed();
FusionViliteMainActivity fusionViliteMainActivity = FusionViliteMainActivity.this;
NavigationUtils.performItemClickNavigation(null, fusionViliteMainActivity, OTTApplication.item, fusionViliteMainActivity.getPageEventName(), "");
OTTApplication.item = null;
}
}
}
if (OTTApplication.IS_FROM_PREPAID_EXTERNAL_BROWSER) {
OTTApplication.IS_FROM_PREPAID_EXTERNAL_BROWSER = false;
if (user == null || user.getPackages().size() <= 0) {
return;
}
FusionViliteMainActivity.this.completeRefresher();
}
}
});
RecyclerViewAdapter recyclerViewAdapter = this.mAdapter;
if (recyclerViewAdapter != null) {
recyclerViewAdapter.updateData();
}
} catch (Exception unused) {
}
}
public void updateSubscriptionBanner() {
UpNextFragment upNextFragment = this.mUpNextFragment;
if (upNextFragment != null) {
upNextFragment.updateSubscriptionBanner();
}
}
public void updateToolBar(boolean z, String str, boolean z2) {
this.accountHeaderLayout.setVisibility(z ? 0 : 8);
if (str != null && str.length() > 0) {
str = str.trim();
}
this.user_name.setText(str);
this.userIcon.setVisibility(8);
this.userIconText.setVisibility(8);
this.userProfileIcon.setVisibility(8);
this.rightArrow.setVisibility(8);
if (str == null || !z2 || str.trim().length() <= 0 || !(str.trim().toLowerCase().equalsIgnoreCase("favourites") || str.trim().toLowerCase().equalsIgnoreCase("favorites"))) {
this.leftArrowIv.setVisibility(8);
this.leftArrowLayout.setVisibility(8);
} else {
this.leftArrowIv.setVisibility(0);
this.leftArrowLayout.setVisibility(0);
this.leftArrowLayout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
FusionViliteMainActivity.this.accountHeaderLayout.setVisibility(8);
FusionViliteMainActivity.this.onBackPressed();
}
});
}
}
public void updateToolBarLogo(String str) {
if (str == null || str.trim().length() <= 0) {
return;
}
Glide.with(getApplicationContext()).asBitmap().load(APIUtils.getAbsoluteImagePath(getApplicationContext(), str)).into(new BitmapImageViewTarget(this.toolbar_logo) {
public void setResource(Bitmap bitmap) {
RoundedBitmapDrawable create = RoundedBitmapDrawableFactory.create(FusionViliteMainActivity.this.getResources(), bitmap);
create.setCircular(true);
FusionViliteMainActivity.this.toolbar_logo.setImageDrawable(create);
}
});
}
public void updateToolBarTheme(int i2, boolean z) {
if (i2 == 0) {
this.toolbar.setBackground(new ColorDrawable(getResources().getColor(R.color.toolbar_bg)));
} else {
this.toolbar.setBackground(new ColorDrawable(getResources().getColor(R.color.toolbar_bg)));
if (getSupportFragmentManager().getBackStackEntryCount() < 1) {
toggleBackButton(false);
}
}
invalidateOptionsMenu();
}
public void updateUI(int i2) {
CastSession castSession;
OttLog.error("updateValue", "++++++++++" + i2);
if (i2 == 0 && (castSession = this.mCastSession) != null && castSession.getRemoteMediaClient() != null && (this.mCastSession.getRemoteMediaClient().isBuffering() || this.mCastSession.getRemoteMediaClient().isPlaying())) {
OttLog.error("updateValue", "is 0 chrmecast playing");
return;
}
Fragment findFragmentById = getSupportFragmentManager().findFragmentById(R.id.contentframe);
if (findFragmentById != null && (findFragmentById instanceof DetailsFragment)) {
this.contentframeLayout.setPadding(0, 0, 0, 0);
return;
}
if (findFragmentById == null || !(findFragmentById instanceof ViewPagerFragment)) {
this.contentframeLayout.setPadding(0, 0, 0, i2);
return;
}
this.contentframeLayout.setPadding(0, 0, 0, 0);
this.tabLayout.setVisibility(0);
this.linear_tablayout.setVisibility(0);
}
public void updateToolBar(boolean z, String str, boolean z2, String str2) {
String str3;
this.accountHeaderLayout.setVisibility(z ? 0 : 8);
this.leftArrowIv.setVisibility(8);
this.leftArrowLayout.setVisibility(8);
if (str != null && str.length() > 0) {
str = str.trim();
}
this.user_name.setText(str);
if (this.preferenceManager == null) {
getPreferenceManager();
}
PreferenceManager preferenceManager = this.preferenceManager;
if (preferenceManager != null && preferenceManager.getLoggedUser() == null) {
this.userIcon.setVisibility(0);
this.userIconText.setVisibility(8);
this.userProfileIcon.setVisibility(8);
} else {
this.userIcon.setVisibility(8);
String[] split = str.split(" ");
if (split.length > 1) {
if (split[0].trim().length() > 0) {
str3 = "" + split[0].charAt(0);
} else {
str3 = "";
}
if (split[1].trim().length() > 0) {
str3 = str3 + "" + split[1].charAt(0);
}
this.userIconText.setVisibility(0);
this.userIconText.setText(str3);
} else if (split.length == 1) {
this.userIcon.setVisibility(0);
this.userIconText.setVisibility(8);
}
}
this.rightArrow.setVisibility(z2 ? 0 : 8);
if (Constants.IS_USER_PROFILES_SUPPORTED) {
if (getSupportFragmentManager().findFragmentById(R.id.contentframe) instanceof ListFragment) {
PreferenceManager preferenceManager2 = this.preferenceManager;
if (preferenceManager2 != null && preferenceManager2.getLoggedUser() != null) {
this.userIcon.setVisibility(8);
this.userIconText.setVisibility(8);
this.userProfileIcon.setVisibility(0);
}
if (str2 != null) {
Glide.with(getApplicationContext()).load(APIUtils.getAbsoluteImagePath(getApplicationContext(), str2)).placeholder(R.drawable.ic_user_profile_default).transform(new Transformation[]{new CenterCrop(), new RoundedCorners((int) getResources().getDimension(R.dimen.margin_default_6))}).into(this.userProfileIcon);
}
this.rightArrow.setVisibility(0);
setArrowImage();
return;
}
return;
}
this.userProfileIcon.setVisibility(8);
setArrowImage();
}
public void launchWebviewPlansPage(String str, String str2, String str3, String str4, String str5) {
String str6;
String a;
if (!UiUtils.isNetworkConnected(this)) {
Toast.makeText((Context) this, (CharSequence) "please check your internet connection", 0).show();
return;
}
Configs utilAppConfigurations = APIUtils.getUtilAppConfigurations(getApplicationContext());
String siteURL = (utilAppConfigurations == null || utilAppConfigurations.getSiteURL() == null) ? "" : utilAppConfigurations.getSiteURL();
if (this.preferenceManager == null) {
getPreferenceManager();
}
PreferenceManager preferenceManager = this.preferenceManager;
if (preferenceManager != null) {
String sessionId = preferenceManager.getSessionId() != null ? this.preferenceManager.getSessionId() : "";
String deviceUniqueId = this.preferenceManager.getDeviceUniqueId() != null ? this.preferenceManager.getDeviceUniqueId() : "";
int yuppDeviceId = this.preferenceManager.getYuppDeviceId();
CustomLog.d("DEBUG", "sessionId " + sessionId);
CustomLog.d("DEBUG", "boxId " + deviceUniqueId);
CustomLog.d("DEBUG", "clientId " + yuppDeviceId);
String str7 = "bi===" + deviceUniqueId + "&&&si===" + sessionId + "&&&ci===" + yuppDeviceId + "&&&theme===w&&&source===" + str3 + "&&&platform===lsdk&&&ucv===15";
if (str != null && str.trim().length() > 0) {
str7 = b.a(str7, "&&&contentPath===", str);
}
if (str2 != null && str2.trim().length() > 0) {
str6 = b.a(str7, "&&&redirect===", str2);
if (!TextUtils.isEmpty(str4) && !TextUtils.isEmpty(str5)) {
str6 = b.a(b.a(str6, "&&&pi===", str5), "&&&gw===", str4);
}
} else {
str6 = str7 + "&&&redirect===plans/list";
}
CustomLog.d("DEBUG", "siteurl string to encode " + str6);
String encodeToString = Base64.encodeToString(str6.getBytes(), 0);
try {
encodeToString = URLEncoder.encode(encodeToString, "UTF-8");
} catch (UnsupportedEncodingException unused) {
}
if (siteURL.endsWith("/")) {
a = b.a(siteURL, "sso/manage?ut=", encodeToString);
} else {
a = b.a(siteURL, "/sso/manage?ut=", encodeToString);
}
g.a("siteurl ", a, "DEBUG");
if (OTTApplication.IS_FROM_SIGNIN) {
NavigationUtils.onBoardWebViewNavigationForResult((FragmentActivity) this, NavigationConstants.NAV_ACCOUNT, a, "signinPage");
OTTApplication.IS_FROM_SIGNIN = false;
} else {
NavigationUtils.onBoardWebViewNavigationForResult(str3, (FragmentActivity) this, NavigationConstants.NAV_ACCOUNT, a);
}
hideProgressBar();
return;
}
Toast.makeText((Context) this, (CharSequence) "Something went wrong", 0).show();
hideProgressBar();
}
}