得物.apk(点击下载) / VideoDetailsFragment.java
package com.shizhuang.duapp.modules.du_trend_details.video.fragment;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.res.Configuration;
import android.os.Build;
import android.os.Bundle;
import android.os.SystemClock;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.SeekBar;
import android.widget.TextView;
import androidx.annotation.Keep;
import androidx.annotation.NonNull;
import androidx.appcompat.widget.AppCompatImageView;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.content.ContextCompat;
import androidx.core.view.ViewCompat;
import androidx.core.view.ViewKt;
import androidx.core.view.accessibility.AccessibilityEventCompat;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.Observer;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager2.widget.DuExViewPager2;
import bj1.e;
import com.danikula.videocache.UrlResourceManager;
import com.knightboost.weaver.api.Scope;
import com.knightboost.weaver.api.annotations.Insert;
import com.knightboost.weaver.api.annotations.TargetClass;
import com.meituan.robust.ChangeQuickRedirect;
import com.meituan.robust.PatchProxy;
import com.meituan.robust.PatchProxyResult;
import com.shizhuang.duapp.R;
import com.shizhuang.duapp.common.bean.BaseResponse;
import com.shizhuang.duapp.common.event.FavoriteChangeEvent;
import com.shizhuang.duapp.common.event.FollowUserSyncEvent;
import com.shizhuang.duapp.common.extension.ViewExtensionKt;
import com.shizhuang.duapp.common.extension.ViewModelLifecycleAwareLazy;
import com.shizhuang.duapp.common.ui.BaseFragment;
import com.shizhuang.duapp.common.utils.livebus.BusObservable;
import com.shizhuang.duapp.common.utils.livebus.LiveEventBus;
import com.shizhuang.duapp.common.utils.screenshot.ScreenShotUtils;
import com.shizhuang.duapp.libs.bpm.BM;
import com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView;
import com.shizhuang.duapp.libs.video.view.DuVideoView;
import com.shizhuang.duapp.modules.du_community_common.base.viewmodel.EventObserver;
import com.shizhuang.duapp.modules.du_community_common.bean.FeedExcessBean;
import com.shizhuang.duapp.modules.du_community_common.events.EditTrendEvent;
import com.shizhuang.duapp.modules.du_community_common.facade.request.DuHttpRequest;
import com.shizhuang.duapp.modules.du_community_common.facade.request.paged.DuPagedHttpRequest;
import com.shizhuang.duapp.modules.du_community_common.helper.CommunityCommonHelper;
import com.shizhuang.duapp.modules.du_community_common.model.CommunityFeedContentModel;
import com.shizhuang.duapp.modules.du_community_common.model.CommunityFeedInteractModel;
import com.shizhuang.duapp.modules.du_community_common.model.CommunityFeedLabelModel;
import com.shizhuang.duapp.modules.du_community_common.model.CommunityFeedModel;
import com.shizhuang.duapp.modules.du_community_common.model.CommunityFeedProductModel;
import com.shizhuang.duapp.modules.du_community_common.model.CommunityListItemModel;
import com.shizhuang.duapp.modules.du_community_common.model.CommunityListModel;
import com.shizhuang.duapp.modules.du_community_common.sensor.SensorContentType;
import com.shizhuang.duapp.modules.du_community_common.util.VideoViewManager;
import com.shizhuang.duapp.modules.du_trend_details.trend.api.TrendDetailsApi;
import com.shizhuang.duapp.modules.du_trend_details.trend.dialogs.SuntanAwardDialogV2;
import com.shizhuang.duapp.modules.du_trend_details.trend.helper.AdminHelper;
import com.shizhuang.duapp.modules.du_trend_details.trend.interfaces.IFeedDetailsFragment;
import com.shizhuang.duapp.modules.du_trend_details.trend.manager.TrendAdminManager;
import com.shizhuang.duapp.modules.du_trend_details.trend.model.SuntanTaskEntryInfo;
import com.shizhuang.duapp.modules.du_trend_details.trend.utils.FeedDetailsTrackUtil;
import com.shizhuang.duapp.modules.du_trend_details.trend.viewmodel.SuntanAwardViewModel;
import com.shizhuang.duapp.modules.du_trend_details.trend.viewmodel.TrackViewModel;
import com.shizhuang.duapp.modules.du_trend_details.trend.viewmodel.TrendTopicViewModel;
import com.shizhuang.duapp.modules.du_trend_details.video.activity.VideoDetailsActivity;
import com.shizhuang.duapp.modules.du_trend_details.video.adapter.VideoFragmentAdapter;
import com.shizhuang.duapp.modules.du_trend_details.video.event.ChangeNextVideoTrendEvent;
import com.shizhuang.duapp.modules.du_trend_details.video.interfaces.GestureType;
import com.shizhuang.duapp.modules.du_trend_details.video.interfaces.IVideoHost;
import com.shizhuang.duapp.modules.du_trend_details.video.interfaces.IVideoLandscapeController;
import com.shizhuang.duapp.modules.du_trend_details.video.interfaces.SlideUpType;
import com.shizhuang.duapp.modules.du_trend_details.video.model.DetailConfigModel;
import com.shizhuang.duapp.modules.du_trend_details.video.model.ShareOrderAwardModel;
import com.shizhuang.duapp.modules.du_trend_details.video.model.TrendVideoHot;
import com.shizhuang.duapp.modules.du_trend_details.video.model.TrendVideoHotItem;
import com.shizhuang.duapp.modules.du_trend_details.video.util.VideoDetailsPreLoader;
import com.shizhuang.duapp.modules.du_trend_details.video.viewmodel.VideoDetailsViewModel;
import df.b0;
import df.r0;
import df.u0;
import fa0.a0;
import gg0.n;
import hf.d;
import ia0.f;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import kotlin.Lazy;
import kotlin.LazyKt__LazyJVMKt;
import kotlin.LazyThreadSafetyMode;
import kotlin.Metadata;
import kotlin.Pair;
import kotlin.TuplesKt;
import kotlin.collections.CollectionsKt__CollectionsJVMKt;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.collections.MapsKt__MapsJVMKt;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Ref;
import kotlin.ranges.RangesKt___RangesKt;
import kotlin.text.StringsKt__StringsJVMKt;
import m30.e0;
import mj1.i;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import rd.l;
import td.s;
import v20.j;
@Metadata(bv = {}, d1 = {"\u00006\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\u0018\u00002\u00020\u00012\u00020\u00022\u00020\u0003:\u0001\u0013B\u0007¢\u0006\u0004\b\u0011\u0010\u0012J\b\u0010\u0005\u001a\u00020\u0004H\u0016J\b\u0010\u0006\u001a\u00020\u0004H\u0016J\u0010\u0010\t\u001a\u00020\u00042\u0006\u0010\b\u001a\u00020\u0007H\u0007J\u0010\u0010\u000b\u001a\u00020\u00042\u0006\u0010\b\u001a\u00020\nH\u0007J\u0010\u0010\u000e\u001a\u00020\u00042\u0006\u0010\r\u001a\u00020\fH\u0007J\u0010\u0010\u0010\u001a\u00020\u00042\u0006\u0010\b\u001a\u00020\u000fH\u0007¨\u0006\u0014"}, d2 = {"Lcom/shizhuang/duapp/modules/du_trend_details/video/fragment/VideoDetailsFragment;", "Lcom/shizhuang/duapp/common/ui/BaseFragment;", "Lcom/shizhuang/duapp/modules/du_trend_details/video/interfaces/IVideoHost;", "Lcom/shizhuang/duapp/modules/du_trend_details/trend/interfaces/IFeedDetailsFragment;", "", "onResume", "onPause", "Lcom/shizhuang/duapp/modules/du_community_common/events/EditTrendEvent;", "event", "editRefreshEvent", "Lcom/shizhuang/duapp/modules/du_trend_details/video/event/ChangeNextVideoTrendEvent;", "changeNextVideo", "Lcom/shizhuang/duapp/common/event/FollowUserSyncEvent;", "followUserSyncEvent", "syncFollowChanged", "Lcom/shizhuang/duapp/common/event/FavoriteChangeEvent;", "onFavoriteChange", "<init>", "()V", "a", "du_trend_details_release"}, k = 1, mv = {1, 4, 2})
/* compiled from: VideoDetailsFragment.kt */
public final class VideoDetailsFragment extends BaseFragment implements IVideoHost, IFeedDetailsFragment {
private static String PRODUCT_FLOATING_EVENT = "product_detail_floating_expanded";
public static ChangeQuickRedirect changeQuickRedirect;
@NotNull
public static final a o0 = new a(null);
public boolean A;
public int B;
public boolean C;
public float D;
public SlideUpType E = SlideUpType.Finger;
public boolean F = true;
public u80.a G;
public Map<Integer, TrendVideoHotItem> H;
public int I;
@NotNull
public GestureType J = GestureType.UP;
public int K;
public ArrayList<String> L;
public String M;
public int N;
public boolean O;
public int P;
public int Q;
public String R;
public String S = "";
public int T;
@NotNull
public final Lazy U = new ViewModelLifecycleAwareLazy(this, new VideoDetailsFragment$$special$$inlined$duActivityViewModel$2(this));
public String V = "";
public String W = "";
public boolean X = true;
public boolean Y = true;
public boolean Z = true;
/* renamed from: a0 reason: collision with root package name */
public boolean f14809a0 = true;
public final Lazy b = LazyKt__LazyJVMKt.lazy(LazyThreadSafetyMode.NONE, (Function0) new VideoDetailsFragment$$special$$inlined$duViewModel$1(this, this));
public boolean b0;
/* renamed from: c reason: collision with root package name */
public final Lazy f14810c = new ViewModelLifecycleAwareLazy(this, new VideoDetailsFragment$$special$$inlined$duActivityViewModel$1(this));
/* renamed from: c0 reason: collision with root package name */
public boolean f14811c0;
public int d = 1;
/* renamed from: d0 reason: collision with root package name */
public final Lazy f14812d0 = new ViewModelLifecycleAwareLazy(this, new VideoDetailsFragment$$special$$inlined$duActivityViewModel$3(this));
public int e = -1;
/* renamed from: e0 reason: collision with root package name */
public final Lazy f14813e0 = new ViewModelLifecycleAwareLazy(this, new VideoDetailsFragment$$special$$inlined$duActivityViewModel$4(this));
public boolean f = true;
public int f0;
/* renamed from: g reason: collision with root package name */
public boolean f14814g;
@Nullable
public Integer g0;
/* renamed from: h reason: collision with root package name */
public FeedExcessBean f14815h;
public boolean h0 = true;
public String i = "";
public boolean i0;
public String j = "";
/* renamed from: j0 reason: collision with root package name */
public int f14816j0;
public String k = "";
/* renamed from: k0 reason: collision with root package name */
public boolean f14817k0;
public String l = "";
/* renamed from: l0 reason: collision with root package name */
public final BusObservable<d> f14818l0 = LiveEventBus.g().c(PRODUCT_FLOATING_EVENT);
public String m = "";
@NotNull
/* renamed from: m0 reason: collision with root package name */
public final Observer<d> f14819m0 = new VideoDetailsFragment$productObserver$1(this);
public int n;
/* renamed from: n0 reason: collision with root package name */
public HashMap f14820n0;
public String o = SensorContentType.TREND_VIDEO.getType();
public int p;
/* renamed from: q reason: collision with root package name */
public int f14821q = -1;
public int r = 1;
public int s;
public long t;
/* renamed from: u reason: collision with root package name */
public CommunityListItemModel f14822u;
/* renamed from: v reason: collision with root package name */
public Disposable f14823v;
public VideoFragmentAdapter w;
public DuExViewPager2 x;
public ka0.a y;
public long z = -1;
public class _boostWeave {
public static ChangeQuickRedirect changeQuickRedirect;
@TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.fragment.app.Fragment")
@Insert(mayCreateSuper = true, value = "onCreate")
@Keep
public static void FragmentMethodWeaver_onCreate(VideoDetailsFragment videoDetailsFragment, Bundle bundle) {
if (!PatchProxy.proxy(new Object[]{videoDetailsFragment, bundle}, null, changeQuickRedirect, true, 140827, new Class[]{VideoDetailsFragment.class, Bundle.class}, Void.TYPE).isSupported) {
long currentTimeMillis = System.currentTimeMillis();
VideoDetailsFragment.d(videoDetailsFragment, bundle);
long currentTimeMillis2 = System.currentTimeMillis();
if (videoDetailsFragment.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.du_trend_details.video.fragment.VideoDetailsFragment")) {
jn.b.f34396a.fragmentOnCreateMethod(videoDetailsFragment, currentTimeMillis, currentTimeMillis2);
}
}
}
@TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.fragment.app.Fragment")
@Insert(mayCreateSuper = true, value = "onCreateView")
@Keep
public static View FragmentMethodWeaver_onCreateView(@NonNull VideoDetailsFragment videoDetailsFragment, @androidx.annotation.Nullable LayoutInflater layoutInflater, @androidx.annotation.Nullable ViewGroup viewGroup, Bundle bundle) {
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{videoDetailsFragment, layoutInflater, viewGroup, bundle}, null, changeQuickRedirect, true, 140829, new Class[]{VideoDetailsFragment.class, LayoutInflater.class, ViewGroup.class, Bundle.class}, View.class);
if (proxy.isSupported) {
return (View) proxy.result;
}
long currentTimeMillis = System.currentTimeMillis();
View f = VideoDetailsFragment.f(videoDetailsFragment, layoutInflater, viewGroup, bundle);
long currentTimeMillis2 = System.currentTimeMillis();
if (videoDetailsFragment.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.du_trend_details.video.fragment.VideoDetailsFragment")) {
jn.b.f34396a.fragmentOnCreateViewMethod(videoDetailsFragment, currentTimeMillis, currentTimeMillis2);
}
return f;
}
@TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.fragment.app.Fragment")
@Insert(mayCreateSuper = true, value = "onResume")
@Keep
public static void FragmentMethodWeaver_onResume(VideoDetailsFragment videoDetailsFragment) {
if (!PatchProxy.proxy(new Object[]{videoDetailsFragment}, null, changeQuickRedirect, true, 140826, new Class[]{VideoDetailsFragment.class}, Void.TYPE).isSupported) {
long currentTimeMillis = System.currentTimeMillis();
VideoDetailsFragment.c(videoDetailsFragment);
long currentTimeMillis2 = System.currentTimeMillis();
if (videoDetailsFragment.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.du_trend_details.video.fragment.VideoDetailsFragment")) {
jn.b.f34396a.fragmentOnResumeMethod(videoDetailsFragment, currentTimeMillis, currentTimeMillis2);
}
}
}
@TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.fragment.app.Fragment")
@Insert(mayCreateSuper = true, value = "onStart")
@Keep
public static void FragmentMethodWeaver_onStart(VideoDetailsFragment videoDetailsFragment) {
if (!PatchProxy.proxy(new Object[]{videoDetailsFragment}, null, changeQuickRedirect, true, 140828, new Class[]{VideoDetailsFragment.class}, Void.TYPE).isSupported) {
long currentTimeMillis = System.currentTimeMillis();
VideoDetailsFragment.e(videoDetailsFragment);
long currentTimeMillis2 = System.currentTimeMillis();
if (videoDetailsFragment.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.du_trend_details.video.fragment.VideoDetailsFragment")) {
jn.b.f34396a.fragmentOnStartMethod(videoDetailsFragment, currentTimeMillis, currentTimeMillis2);
}
}
}
@TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.fragment.app.Fragment")
@Insert(mayCreateSuper = true, value = "onViewCreated")
@Keep
public static void FragmentMethodWeaver_onViewCreated(@NonNull VideoDetailsFragment videoDetailsFragment, @androidx.annotation.Nullable View view, Bundle bundle) {
if (!PatchProxy.proxy(new Object[]{videoDetailsFragment, view, bundle}, null, changeQuickRedirect, true, 140830, new Class[]{VideoDetailsFragment.class, View.class, Bundle.class}, Void.TYPE).isSupported) {
long currentTimeMillis = System.currentTimeMillis();
VideoDetailsFragment.g(videoDetailsFragment, view, bundle);
long currentTimeMillis2 = System.currentTimeMillis();
if (videoDetailsFragment.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.du_trend_details.video.fragment.VideoDetailsFragment")) {
jn.b.f34396a.fragmentOnViewCreatedMethod(videoDetailsFragment, currentTimeMillis, currentTimeMillis2);
}
}
}
}
/* compiled from: VideoDetailsFragment.kt */
public static final class a {
public static ChangeQuickRedirect changeQuickRedirect;
public a(DefaultConstructorMarker defaultConstructorMarker) {
}
}
/* compiled from: VideoDetailsFragment.kt */
public static final class b extends s<CommunityListModel> {
public static ChangeQuickRedirect changeQuickRedirect;
public final /* synthetic */ VideoDetailsFragment b;
/* renamed from: c reason: collision with root package name */
public final /* synthetic */ int f14832c;
public b(VideoDetailsFragment videoDetailsFragment, int i) {
this.b = videoDetailsFragment;
this.f14832c = i;
}
@Override // com.shizhuang.duapp.common.helper.net.facade.IViewHandler, td.s, td.a
public void onBzError(@Nullable l<CommunityListModel> lVar) {
if (!PatchProxy.proxy(new Object[]{lVar}, this, changeQuickRedirect, false, 140832, new Class[]{l.class}, Void.TYPE).isSupported) {
super.onBzError(lVar);
if (this.b.s() != 11) {
this.b.f14814g = false;
} else if (this.f14832c == 0) {
this.b.f14811c0 = false;
} else {
this.b.b0 = false;
}
}
}
@Override // com.shizhuang.duapp.common.helper.net.facade.IViewHandler, td.a
public void onSuccess(Object obj) {
CommunityListModel communityListModel = (CommunityListModel) obj;
boolean z = true;
if (!PatchProxy.proxy(new Object[]{communityListModel}, this, changeQuickRedirect, false, 140831, new Class[]{CommunityListModel.class}, Void.TYPE).isSupported) {
super.onSuccess(communityListModel);
if (communityListModel != null) {
ArrayList<CommunityListItemModel> list = communityListModel.getList();
if (list != null) {
int i = 0;
for (T t : list) {
int i3 = i + 1;
if (i < 0) {
CollectionsKt__CollectionsKt.throwIndexOverflow();
}
t.setRelativePosition(i3);
i = i3;
}
}
Iterator<T> it2 = communityListModel.getSafeList().iterator();
while (it2.hasNext()) {
it2.next().setRequestId(communityListModel.getRequestId());
}
int s = this.b.s();
if (s != 11) {
if (s != 14) {
if (s == 41) {
VideoDetailsFragment videoDetailsFragment = this.b;
videoDetailsFragment.F = false;
videoDetailsFragment.f14814g = false;
VideoDetailsFragment.i(videoDetailsFragment).appendItems(communityListModel.getSafeList());
return;
} else if (!(s == 46 || s == 49 || s == 50)) {
VideoDetailsFragment videoDetailsFragment2 = this.b;
videoDetailsFragment2.f14814g = false;
videoDetailsFragment2.r++;
VideoDetailsFragment.i(videoDetailsFragment2).appendItems(communityListModel.getSafeList());
return;
}
}
VideoDetailsFragment videoDetailsFragment3 = this.b;
videoDetailsFragment3.f14814g = false;
videoDetailsFragment3.i = communityListModel.getSafeLastId();
VideoDetailsFragment videoDetailsFragment4 = this.b;
if ((videoDetailsFragment4.i.length() == 0) || Intrinsics.areEqual(this.b.i, "0")) {
z = false;
}
videoDetailsFragment4.F = z;
VideoDetailsFragment.i(this.b).appendItems(communityListModel.getSafeList());
} else if (this.f14832c == 0) {
VideoDetailsFragment videoDetailsFragment5 = this.b;
videoDetailsFragment5.f14811c0 = false;
videoDetailsFragment5.W = communityListModel.getSafeLastId();
VideoDetailsFragment videoDetailsFragment6 = this.b;
videoDetailsFragment6.f14809a0 = true ^ StringsKt__StringsJVMKt.isBlank(videoDetailsFragment6.W);
VideoDetailsFragment.i(this.b).appendItems(communityListModel.getSafeList());
} else {
VideoDetailsFragment videoDetailsFragment7 = this.b;
videoDetailsFragment7.b0 = false;
videoDetailsFragment7.V = communityListModel.getSafeLastId();
VideoDetailsFragment videoDetailsFragment8 = this.b;
videoDetailsFragment8.Z = true ^ StringsKt__StringsJVMKt.isBlank(videoDetailsFragment8.V);
int currentItem = this.b.y().getCurrentItem();
VideoDetailsFragment.i(this.b).a(communityListModel.getSafeList(), 0);
this.b.f0 = communityListModel.getSafeList().size() + currentItem;
this.b.y().setCurrentItem(communityListModel.getSafeList().size() + currentItem, false);
this.b.T = communityListModel.getSafeList().size() + currentItem;
}
}
}
}
}
/* compiled from: VideoDetailsFragment.kt */
public static final class c implements View.OnTouchListener {
public static ChangeQuickRedirect changeQuickRedirect;
public final /* synthetic */ VideoDetailsFragment b;
public c(VideoDetailsFragment videoDetailsFragment) {
this.b = videoDetailsFragment;
}
public final boolean onTouch(View view, MotionEvent motionEvent) {
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{view, motionEvent}, this, changeQuickRedirect, false, 140854, new Class[]{View.class, MotionEvent.class}, Boolean.TYPE);
if (proxy.isSupported) {
return ((Boolean) proxy.result).booleanValue();
}
this.b.l();
return false;
}
}
public static void c(VideoDetailsFragment videoDetailsFragment) {
int i3;
if (!PatchProxy.proxy(new Object[0], videoDetailsFragment, changeQuickRedirect, false, 140762, new Class[0], Void.TYPE).isSupported) {
super.onResume();
videoDetailsFragment.t = System.currentTimeMillis();
if (!PatchProxy.proxy(new Object[0], videoDetailsFragment, changeQuickRedirect, false, 140781, new Class[0], Void.TYPE).isSupported && (i3 = videoDetailsFragment.P) != 100) {
if (i3 != 11 && i3 != 14 && i3 != 41) {
((TextView) videoDetailsFragment._$_findCachedViewById(R.id.slidingUpTips2)).setVisibility(8);
((TextView) videoDetailsFragment._$_findCachedViewById(R.id.slidingUpTips)).setVisibility(0);
Integer num = (Integer) b0.f("is_sliding_up_key", 0);
boolean z4 = num != null && num.intValue() == 1;
if (videoDetailsFragment.s < 2 && !z4) {
((ConstraintLayout) videoDetailsFragment._$_findCachedViewById(R.id.guideContainer)).setVisibility(0);
((DuImageLoaderView) videoDetailsFragment._$_findCachedViewById(R.id.slidingUpGuide)).i("https://cdn.poizon.com/node-common/12358f83dd1bcc889b15f95263f6c465.webp").x();
}
} else if (videoDetailsFragment.s < 1) {
((TextView) videoDetailsFragment._$_findCachedViewById(R.id.slidingUpTips)).setVisibility(8);
((TextView) videoDetailsFragment._$_findCachedViewById(R.id.slidingUpTips2)).setVisibility(0);
((TextView) videoDetailsFragment._$_findCachedViewById(R.id.slidingUpTips2)).setText(videoDetailsFragment.getString(R.string.du_trend_detail_video_guide));
((ConstraintLayout) videoDetailsFragment._$_findCachedViewById(R.id.guideContainer)).setVisibility(0);
((DuImageLoaderView) videoDetailsFragment._$_findCachedViewById(R.id.slidingUpGuide)).i("https://apk.poizon.com/duApp/Android_Config/resource/community/du_trend_video_guide2.webp").x();
}
int i12 = bj1.b.b;
videoDetailsFragment.f14823v = new i(1).a(4, TimeUnit.SECONDS).j(Schedulers.io()).d(ej1.a.c()).f(new f(videoDetailsFragment));
}
if (!PatchProxy.proxy(new Object[0], videoDetailsFragment, changeQuickRedirect, false, 140782, new Class[0], Void.TYPE).isSupported) {
FeedDetailsTrackUtil.o(FeedDetailsTrackUtil.f14690a, videoDetailsFragment.j, videoDetailsFragment.d, videoDetailsFragment.P, videoDetailsFragment.Q, videoDetailsFragment.l, videoDetailsFragment.m, null, videoDetailsFragment.R, 64);
}
d30.a.b.b();
EventBus.b().f(new zc.b());
FragmentActivity activity = videoDetailsFragment.getActivity();
if (activity != null) {
r0.m(activity, ContextCompat.getColor(activity, R.color.transparent), 0);
r0.p(activity, true);
if (!PatchProxy.proxy(new Object[]{activity, new Integer(0)}, null, r0.changeQuickRedirect, true, 8932, new Class[]{Activity.class, Integer.TYPE}, Void.TYPE).isSupported) {
r0.E(activity);
r0.b(activity, 0);
}
activity.getWindow().clearFlags(512);
r0.u(activity, ViewCompat.MEASURED_STATE_MASK);
}
}
}
public static void d(VideoDetailsFragment videoDetailsFragment, Bundle bundle) {
if (!PatchProxy.proxy(new Object[]{bundle}, videoDetailsFragment, changeQuickRedirect, false, 140811, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
super.onCreate(bundle);
}
}
public static void e(VideoDetailsFragment videoDetailsFragment) {
if (!PatchProxy.proxy(new Object[0], videoDetailsFragment, changeQuickRedirect, false, 140813, new Class[0], Void.TYPE).isSupported) {
super.onStart();
}
}
public static View f(VideoDetailsFragment videoDetailsFragment, LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{layoutInflater, viewGroup, bundle}, videoDetailsFragment, changeQuickRedirect, false, 140815, new Class[]{LayoutInflater.class, ViewGroup.class, Bundle.class}, View.class);
return proxy.isSupported ? (View) proxy.result : super.onCreateView(layoutInflater, viewGroup, bundle);
}
public static void g(VideoDetailsFragment videoDetailsFragment, View view, Bundle bundle) {
if (!PatchProxy.proxy(new Object[]{view, bundle}, videoDetailsFragment, changeQuickRedirect, false, 140817, new Class[]{View.class, Bundle.class}, Void.TYPE).isSupported) {
super.onViewCreated(view, bundle);
}
}
public static final /* synthetic */ Map h(VideoDetailsFragment videoDetailsFragment) {
Map<Integer, TrendVideoHotItem> map = videoDetailsFragment.H;
if (map == null) {
Intrinsics.throwUninitializedPropertyAccessException("trendVideoHotMap");
}
return map;
}
public static final /* synthetic */ VideoFragmentAdapter i(VideoDetailsFragment videoDetailsFragment) {
VideoFragmentAdapter videoFragmentAdapter = videoDetailsFragment.w;
if (videoFragmentAdapter == null) {
Intrinsics.throwUninitializedPropertyAccessException("videoAdapter");
}
return videoFragmentAdapter;
}
public final boolean A() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 140772, new Class[0], Boolean.TYPE);
if (proxy.isSupported) {
return ((Boolean) proxy.result).booleanValue();
}
if (isAdded() && getResources().getConfiguration().orientation != 1) {
return false;
}
return true;
}
public final Pair<e<BaseResponse<CommunityListModel>>, s<CommunityListModel>> B(int i3) {
FeedExcessBean feedExcessBean;
CommunityFeedModel feed;
CommunityFeedInteractModel interact;
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 140791, new Class[]{Integer.TYPE}, Pair.class);
if (proxy.isSupported) {
return (Pair) proxy.result;
}
if ((this.b0 && i3 == 1) || (i3 == 0 && this.f14811c0)) {
return null;
}
if ((!this.Z && i3 == 1) || ((i3 == 0 && !this.f14809a0) || (feedExcessBean = this.f14815h) == null)) {
return null;
}
VideoDetailsViewModel.MoreVideoParams moreVideoParams = new VideoDetailsViewModel.MoreVideoParams(null, null, 0, 0, 0, 0, 0, false, false, 0, 0, 0, 4095, null);
moreVideoParams.setContentType(this.d);
moreVideoParams.setSlidingDirection(i3);
CommunityListItemModel communityListItemModel = this.f14822u;
moreVideoParams.setProfileTop((communityListItemModel == null || (feed = communityListItemModel.getFeed()) == null || (interact = feed.getInteract()) == null) ? 0 : interact.isProfileTop());
moreVideoParams.setFirstPersonalUpLoad(this.X);
moreVideoParams.setFirstPersonalDownLoad(this.Y);
moreVideoParams.setContentId(this.j);
if (i3 == 1) {
String valueOf = this.X ? String.valueOf(feedExcessBean.getCreateAt()) : this.V;
this.V = valueOf;
moreVideoParams.setLastId(valueOf);
this.X = false;
} else {
String valueOf2 = this.Y ? String.valueOf(feedExcessBean.getCreateAt()) : this.W;
this.W = valueOf2;
moreVideoParams.setLastId(valueOf2);
this.Y = false;
}
e<BaseResponse<CommunityListModel>> loadMoreRecommendObservable = x().getLoadMoreRecommendObservable(this.P, feedExcessBean, moreVideoParams);
if (loadMoreRecommendObservable != null) {
return new Pair<>(loadMoreRecommendObservable, m(i3));
}
return null;
}
public final Pair<e<BaseResponse<CommunityListModel>>, s<CommunityListModel>> C() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 140792, new Class[0], Pair.class);
if (proxy.isSupported) {
return (Pair) proxy.result;
}
if (this.P == 100 || this.f14814g || !this.F) {
return null;
}
VideoDetailsViewModel.MoreVideoParams moreVideoParams = new VideoDetailsViewModel.MoreVideoParams(null, null, 0, 0, 0, 0, 0, false, false, 0, 0, 0, 4095, null);
int i3 = this.P;
if (i3 != 41) {
if (i3 == 46) {
moreVideoParams.setLastId(this.i);
moreVideoParams.setContentType(this.d);
} else if (i3 == 49) {
String str = this.f ? this.j : null;
moreVideoParams.setLastId(this.i);
moreVideoParams.setContentId(str);
this.f = false;
} else if (i3 != 50) {
switch (i3) {
case 14:
FeedExcessBean feedExcessBean = this.f14815h;
if (feedExcessBean != null) {
moreVideoParams.setPageNum(feedExcessBean.getPageNum());
moreVideoParams.setContentId(this.j);
moreVideoParams.setLastId(this.i);
moreVideoParams.setCheck(this.f14816j0);
break;
} else {
return null;
}
case 15:
case 16:
u().loadFeeds();
this.f14814g = true;
return null;
default:
moreVideoParams.setPageNum(this.r);
moreVideoParams.setContentId(this.j);
moreVideoParams.setContentType(this.d);
break;
}
} else {
String str2 = this.f ? this.j : null;
moreVideoParams.setLastId(this.i);
moreVideoParams.setContentId(str2);
this.f = false;
}
}
e<BaseResponse<CommunityListModel>> loadMoreRecommendObservable = x().getLoadMoreRecommendObservable(this.P, this.f14815h, moreVideoParams);
if (loadMoreRecommendObservable == null) {
return null;
}
this.f14814g = true;
return new Pair<>(loadMoreRecommendObservable, m(0));
}
public final void D(@NotNull GestureType gestureType) {
if (!PatchProxy.proxy(new Object[]{gestureType}, this, changeQuickRedirect, false, 140742, new Class[]{GestureType.class}, Void.TYPE).isSupported) {
this.J = gestureType;
}
}
public final void E(FeedExcessBean feedExcessBean) {
if (!PatchProxy.proxy(new Object[]{feedExcessBean}, this, changeQuickRedirect, false, 140780, new Class[]{FeedExcessBean.class}, Void.TYPE).isSupported && feedExcessBean.isSpecialTrend()) {
x().fetchShareOrderAwardDetail(this.j);
}
}
public final void F() {
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 140779, new Class[0], Void.TYPE).isSupported) {
SuntanAwardDialogV2.i.a().j(this);
}
}
public final void G(CommunityListItemModel communityListItemModel) {
CommunityFeedModel feed;
boolean z4 = true;
int i3 = 0;
if (!PatchProxy.proxy(new Object[]{communityListItemModel}, this, changeQuickRedirect, false, 140790, new Class[]{CommunityListItemModel.class}, Void.TYPE).isSupported && (feed = communityListItemModel.getFeed()) != null && cd.l.c(this)) {
((AppCompatImageView) _$_findCachedViewById(R.id.ivTools)).setVisibility(AdminHelper.f(AdminHelper.f14661a, getContext(), feed, false, 4) ? 0 : 8);
ImageView imageView = (ImageView) _$_findCachedViewById(R.id.ivHideTrend);
if (feed.getContent().isHide() != 1 || !TrendAdminManager.b().e()) {
z4 = false;
}
if (!z4) {
i3 = 8;
}
imageView.setVisibility(i3);
}
}
public final void H() {
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 140801, new Class[0], Void.TYPE).isSupported && !this.A) {
this.A = true;
BM.community().b("community_video_detail_load", SystemClock.elapsedRealtime() - this.z, false, MapsKt__MapsJVMKt.mapOf(TuplesKt.to("cdnType", String.valueOf(UrlResourceManager.CURRENT_URL_SOURCE))));
}
}
public View _$_findCachedViewById(int i3) {
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 140808, new Class[]{Integer.TYPE}, View.class);
if (proxy.isSupported) {
return (View) proxy.result;
}
if (this.f14820n0 == null) {
this.f14820n0 = new HashMap();
}
View view = (View) this.f14820n0.get(Integer.valueOf(i3));
if (view != null) {
return view;
}
View view2 = getView();
if (view2 == null) {
return null;
}
View findViewById = view2.findViewById(i3);
this.f14820n0.put(Integer.valueOf(i3), findViewById);
return findViewById;
}
@Subscribe(threadMode = ThreadMode.MAIN)
public final void changeNextVideo(@NotNull ChangeNextVideoTrendEvent changeNextVideoTrendEvent) {
if (!PatchProxy.proxy(new Object[]{changeNextVideoTrendEvent}, this, changeQuickRedirect, false, 140804, new Class[]{ChangeNextVideoTrendEvent.class}, Void.TYPE).isSupported && isResumed()) {
try {
int i3 = this.e + 1;
VideoFragmentAdapter videoFragmentAdapter = this.w;
if (videoFragmentAdapter == null) {
Intrinsics.throwUninitializedPropertyAccessException("videoAdapter");
}
if (i3 < videoFragmentAdapter.d().size()) {
DuExViewPager2 duExViewPager2 = this.x;
if (duExViewPager2 == null) {
Intrinsics.throwUninitializedPropertyAccessException("viewpager");
}
duExViewPager2.setCurrentItem(this.e + 1, true);
}
} catch (Exception e6) {
e6.printStackTrace();
}
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
public final void editRefreshEvent(@NotNull EditTrendEvent editTrendEvent) {
CommunityFeedModel communityFeedModel;
if (!PatchProxy.proxy(new Object[]{editTrendEvent}, this, changeQuickRedirect, false, 140803, new Class[]{EditTrendEvent.class}, Void.TYPE).isSupported && (communityFeedModel = editTrendEvent.trendModel) != null) {
communityFeedModel.getContent().setContentType(1);
VideoFragmentAdapter videoFragmentAdapter = this.w;
if (videoFragmentAdapter == null) {
Intrinsics.throwUninitializedPropertyAccessException("videoAdapter");
}
if (videoFragmentAdapter.getItemCount() > 0) {
DuExViewPager2 duExViewPager2 = this.x;
if (duExViewPager2 == null) {
Intrinsics.throwUninitializedPropertyAccessException("viewpager");
}
int currentItem = duExViewPager2.getCurrentItem();
VideoFragmentAdapter videoFragmentAdapter2 = this.w;
if (videoFragmentAdapter2 == null) {
Intrinsics.throwUninitializedPropertyAccessException("videoAdapter");
}
CommunityFeedModel feed = videoFragmentAdapter2.d().get(currentItem).getFeed();
if (feed != null && !(true ^ Intrinsics.areEqual(feed.getContent().getContentId(), communityFeedModel.getContent().getContentId()))) {
VideoFragmentAdapter videoFragmentAdapter3 = this.w;
if (videoFragmentAdapter3 == null) {
Intrinsics.throwUninitializedPropertyAccessException("videoAdapter");
}
CommunityFeedModel feed2 = videoFragmentAdapter3.d().get(currentItem).getFeed();
if (feed2 != null) {
feed2.setContent(communityFeedModel.getContent());
}
VideoFragmentAdapter videoFragmentAdapter4 = this.w;
if (videoFragmentAdapter4 == null) {
Intrinsics.throwUninitializedPropertyAccessException("videoAdapter");
}
Fragment c5 = videoFragmentAdapter4.c(currentItem);
if (!(c5 instanceof VideoItemFragment)) {
c5 = null;
}
VideoItemFragment videoItemFragment = (VideoItemFragment) c5;
if (videoItemFragment != null) {
VideoFragmentAdapter videoFragmentAdapter5 = this.w;
if (videoFragmentAdapter5 == null) {
Intrinsics.throwUninitializedPropertyAccessException("videoAdapter");
}
videoItemFragment.w(videoFragmentAdapter5.d().get(currentItem));
}
}
}
}
}
@Override // com.shizhuang.duapp.common.base.inter.IViewController, com.shizhuang.duapp.common.ui.BaseFragment
public int getLayout() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 140755, new Class[0], Integer.TYPE);
return proxy.isSupported ? ((Integer) proxy.result).intValue() : R.layout.du_trend_detail_fragment_video_details;
}
@Override // com.shizhuang.duapp.common.base.inter.IViewController, com.shizhuang.duapp.common.ui.BaseFragment
public void initData() {
e0 e0Var;
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 140759, new Class[0], Void.TYPE).isSupported) {
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 140775, new Class[0], Void.TYPE).isSupported) {
t().setContentId(this.j);
t().setContentType(this.d);
ImageView imageView = (ImageView) _$_findCachedViewById(R.id.ivSuntanAward);
if (imageView != null) {
ViewExtensionKt.h(imageView, new VideoDetailsFragment$initSuntanViewModel$1(this));
}
}
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 140776, new Class[0], Void.TYPE).isSupported) {
DuPagedHttpRequest<CommunityListModel, CommunityListItemModel> tagFeedsReq = u().getTagFeedsReq();
j jVar = new j(this, tagFeedsReq.isShowErrorToast(), null);
Ref.BooleanRef booleanRef = new Ref.BooleanRef();
booleanRef.element = tagFeedsReq.getMutableAllStateLiveData().getValue() instanceof DuPagedHttpRequest.b.a;
Ref.ObjectRef objectRef = new Ref.ObjectRef();
objectRef.element = null;
Ref.BooleanRef booleanRef2 = new Ref.BooleanRef();
boolean isViewNull = tagFeedsReq.isViewNull(this);
booleanRef2.element = isViewNull;
if (!isViewNull) {
objectRef.element = (T) jVar.b(this);
}
MutableLiveData<DuPagedHttpRequest.b<CommunityListModel, CommunityListItemModel>> mutableAllStateLiveData = tagFeedsReq.getMutableAllStateLiveData();
v20.i iVar = v20.i.f39125a;
mutableAllStateLiveData.observe(iVar.a(this), new VideoDetailsFragment$initLiveData$$inlined$observe$1(tagFeedsReq, jVar, booleanRef, booleanRef2, objectRef, this, this));
DuHttpRequest<SuntanTaskEntryInfo> suntanAwardEntryRequest = t().getSuntanAwardEntryRequest();
j jVar2 = new j(this, suntanAwardEntryRequest.isShowErrorToast(), null);
Ref.BooleanRef booleanRef3 = new Ref.BooleanRef();
booleanRef3.element = suntanAwardEntryRequest.getMutableAllStateLiveData().getValue() instanceof DuHttpRequest.b.a;
suntanAwardEntryRequest.getMutableAllStateLiveData().observe(iVar.a(this), new VideoDetailsFragment$initLiveData$$inlined$observe$2(suntanAwardEntryRequest, jVar2, booleanRef3, this));
t().getGoToEditEvent().observe(getViewLifecycleOwner(), new EventObserver(new VideoDetailsFragment$initLiveData$4(this)));
DuHttpRequest<DetailConfigModel> videoGuideRequest = x().getVideoGuideRequest();
j jVar3 = new j(this, videoGuideRequest.isShowErrorToast(), null);
Ref.BooleanRef booleanRef4 = new Ref.BooleanRef();
booleanRef4.element = videoGuideRequest.getMutableAllStateLiveData().getValue() instanceof DuHttpRequest.b.a;
videoGuideRequest.getMutableAllStateLiveData().observe(iVar.a(this), new VideoDetailsFragment$initLiveData$$inlined$observe$3(videoGuideRequest, jVar3, booleanRef4, this));
DuHttpRequest<CommunityListModel> dressingRecommendRequest = x().getDressingRecommendRequest();
j jVar4 = new j(this, dressingRecommendRequest.isShowErrorToast(), null);
Ref.BooleanRef booleanRef5 = new Ref.BooleanRef();
booleanRef5.element = dressingRecommendRequest.getMutableAllStateLiveData().getValue() instanceof DuHttpRequest.b.a;
dressingRecommendRequest.getMutableAllStateLiveData().observe(iVar.a(this), new VideoDetailsFragment$initLiveData$$inlined$observe$4(dressingRecommendRequest, jVar4, booleanRef5, this));
DuHttpRequest<TrendVideoHot> videoRankRequest = x().getVideoRankRequest();
j jVar5 = new j(this, videoRankRequest.isShowErrorToast(), null);
Ref.BooleanRef booleanRef6 = new Ref.BooleanRef();
booleanRef6.element = videoRankRequest.getMutableAllStateLiveData().getValue() instanceof DuHttpRequest.b.a;
videoRankRequest.getMutableAllStateLiveData().observe(iVar.a(this), new VideoDetailsFragment$initLiveData$$inlined$observe$5(videoRankRequest, jVar5, booleanRef6, this));
DuHttpRequest<ShareOrderAwardModel> shareOrderAwardDetailRequest = x().getShareOrderAwardDetailRequest();
j jVar6 = new j(this, shareOrderAwardDetailRequest.isShowErrorToast(), null);
Ref.BooleanRef booleanRef7 = new Ref.BooleanRef();
booleanRef7.element = shareOrderAwardDetailRequest.getMutableAllStateLiveData().getValue() instanceof DuHttpRequest.b.a;
shareOrderAwardDetailRequest.getMutableAllStateLiveData().observe(iVar.a(this), new VideoDetailsFragment$initLiveData$$inlined$observe$6(shareOrderAwardDetailRequest, jVar6, booleanRef7, this));
}
ja0.b bVar = ja0.b.f34257a;
if (bVar.d(this.P)) {
o();
} else if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 140778, new Class[0], Void.TYPE).isSupported) {
String b2 = bVar.b(this.P);
e0 e0Var2 = new e0();
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{this}, e0Var2, e0.changeQuickRedirect, false, 108906, new Class[]{Fragment.class}, e0.class);
if (proxy.isSupported) {
e0Var = (e0) proxy.result;
} else {
e0Var2.e();
e0Var2.e = new nq.a(this);
e0Var = e0Var2;
}
e0.a(e0Var, ((TrendDetailsApi) td.j.getJavaGoApi(TrendDetailsApi.class)).getTrendDetailV2(this.j, b2, String.valueOf(n20.a.i()), this.P == 2 ? 1 : 0), new ia0.c(this, this), 0, false, 8);
int i3 = this.P;
if (i3 == 100) {
e0Var2.f();
boolean z4 = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 140800, new Class[0], Void.TYPE).isSupported;
} else if (i3 == 11) {
Pair<e<BaseResponse<CommunityListModel>>, s<CommunityListModel>> B2 = B(0);
Pair<e<BaseResponse<CommunityListModel>>, s<CommunityListModel>> B3 = B(1);
if (B2 == null || B3 == null) {
e0Var2.f();
} else {
e0.a(e0.a(e0Var2, B3.getFirst(), B3.getSecond(), 1, false, 8), B2.getFirst(), B2.getSecond(), 2, false, 8).f();
this.f14811c0 = true;
this.b0 = true;
}
} else {
Pair<e<BaseResponse<CommunityListModel>>, s<CommunityListModel>> C2 = C();
if (C2 == null) {
e0Var2.f();
} else {
e0.a(e0Var2, C2.getFirst(), C2.getSecond(), 1, false, 8).f();
}
}
}
x().getVideoRank();
x().getVideoGuide();
}
}
@Override // com.shizhuang.duapp.common.base.inter.IViewController, com.shizhuang.duapp.common.ui.BaseFragment
@SuppressLint({"ClickableViewAccessibility"})
public void initView(@Nullable Bundle bundle) {
int i3;
int i12;
int i13;
VideoDetailsFragment videoDetailsFragment;
int i14;
Context context;
int i15;
if (!PatchProxy.proxy(new Object[]{bundle}, this, changeQuickRedirect, false, 140756, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
this.z = SystemClock.elapsedRealtime();
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 140765, new Class[0], Void.TYPE).isSupported) {
if (getActivity() instanceof VideoDetailsActivity) {
VideoDetailsActivity videoDetailsActivity = (VideoDetailsActivity) getActivity();
this.d = videoDetailsActivity.f14734c;
String str = videoDetailsActivity.d;
String str2 = "";
if (str == null) {
str = str2;
}
this.j = str;
this.P = videoDetailsActivity.h();
this.f14822u = videoDetailsActivity.f;
this.f14815h = videoDetailsActivity.f14735g;
this.Q = videoDetailsActivity.j;
this.R = videoDetailsActivity.i;
String str3 = videoDetailsActivity.k;
if (str3 != null) {
str2 = str3;
}
this.S = str2;
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], videoDetailsActivity, VideoDetailsActivity.changeQuickRedirect, false, 140024, new Class[0], Integer.TYPE);
if (proxy.isSupported) {
i15 = ((Integer) proxy.result).intValue();
} else {
i15 = videoDetailsActivity.w;
}
this.f14816j0 = i15;
}
FeedExcessBean feedExcessBean = this.f14815h;
if (feedExcessBean != null) {
this.i = feedExcessBean.getLastId();
this.k = feedExcessBean.getAcm();
this.f14821q = feedExcessBean.getCategoryId();
this.p = feedExcessBean.getAnchorReplyId();
this.l = feedExcessBean.getRecommendTabId();
this.m = feedExcessBean.getRecommendTabTitle();
this.L = feedExcessBean.getSearchKeyWords();
this.M = feedExcessBean.getSearchId();
this.N = feedExcessBean.getSearchPosition();
this.n = feedExcessBean.getFeedPosition();
feedExcessBean.getShowHeightWeightProp();
}
}
((ViewGroup.MarginLayoutParams) ((ImageView) _$_findCachedViewById(R.id.backIcon)).getLayoutParams()).topMargin = fi.b.j(getContext());
((ViewGroup.MarginLayoutParams) ((AppCompatImageView) _$_findCachedViewById(R.id.ivTools)).getLayoutParams()).topMargin = fi.b.j(getContext());
ViewExtensionKt.h((ImageView) _$_findCachedViewById(R.id.backIcon), new VideoDetailsFragment$initView$1(this));
CommunityFeedModel communityFeedModel = null;
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 140767, new Class[0], Void.TYPE).isSupported && (context = getContext()) != null) {
((FrameLayout) _$_findCachedViewById(R.id.gestureLayer)).removeAllViews();
this.x = new DuExViewPager2(context);
FrameLayout frameLayout = (FrameLayout) _$_findCachedViewById(R.id.gestureLayer);
DuExViewPager2 duExViewPager2 = this.x;
if (duExViewPager2 == null) {
Intrinsics.throwUninitializedPropertyAccessException("viewpager");
}
int i16 = -1;
frameLayout.addView(duExViewPager2, new FrameLayout.LayoutParams(-1, -1));
DuExViewPager2 duExViewPager22 = this.x;
if (duExViewPager22 == null) {
Intrinsics.throwUninitializedPropertyAccessException("viewpager");
}
if (Build.VERSION.SDK_INT >= 29) {
i16 = 1;
}
duExViewPager22.setOffscreenPageLimit(i16);
videoDetailsFragment = this;
videoDetailsFragment.w = new VideoFragmentAdapter(this, this.P, this.j, this.o, this.p, false, this.k, this.l, this.m, this.L, this.M, this.N, this.n, false, AccessibilityEventCompat.TYPE_VIEW_TEXT_SELECTION_CHANGED);
DuExViewPager2 duExViewPager23 = videoDetailsFragment.x;
if (duExViewPager23 == null) {
Intrinsics.throwUninitializedPropertyAccessException("viewpager");
}
i13 = 1;
duExViewPager23.setOrientation(1);
DuExViewPager2 duExViewPager24 = videoDetailsFragment.x;
if (duExViewPager24 == null) {
Intrinsics.throwUninitializedPropertyAccessException("viewpager");
}
VideoFragmentAdapter videoFragmentAdapter = videoDetailsFragment.w;
if (videoFragmentAdapter == null) {
Intrinsics.throwUninitializedPropertyAccessException("videoAdapter");
}
duExViewPager24.setAdapter(videoFragmentAdapter);
DuExViewPager2 duExViewPager25 = videoDetailsFragment.x;
if (duExViewPager25 == null) {
Intrinsics.throwUninitializedPropertyAccessException("viewpager");
}
i12 = 0;
View childAt = duExViewPager25.getChildAt(0);
if (!(childAt instanceof RecyclerView)) {
childAt = null;
}
RecyclerView recyclerView = (RecyclerView) childAt;
i3 = 2;
if (recyclerView != null) {
recyclerView.setItemViewCacheSize(2);
}
DuExViewPager2 duExViewPager26 = videoDetailsFragment.x;
if (duExViewPager26 == null) {
Intrinsics.throwUninitializedPropertyAccessException("viewpager");
}
duExViewPager26.registerOnPageChangeCallback(new VideoDetailsFragment$initViewPager$1(videoDetailsFragment));
Context context2 = getContext();
VideoDetailsFragment$initViewPager$itemGestureDetector$1 videoDetailsFragment$initViewPager$itemGestureDetector$1 = new VideoDetailsFragment$initViewPager$itemGestureDetector$1(videoDetailsFragment);
DuExViewPager2 duExViewPager27 = videoDetailsFragment.x;
if (duExViewPager27 == null) {
Intrinsics.throwUninitializedPropertyAccessException("viewpager");
}
q30.i iVar = new q30.i(600, context2, videoDetailsFragment$initViewPager$itemGestureDetector$1, duExViewPager27);
DuExViewPager2 duExViewPager28 = videoDetailsFragment.x;
if (duExViewPager28 == null) {
Intrinsics.throwUninitializedPropertyAccessException("viewpager");
}
View childAt2 = duExViewPager28.getChildAt(0);
if (childAt2 != null) {
childAt2.setOnTouchListener(new ia0.e(videoDetailsFragment, iVar));
}
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 140768, new Class[0], Void.TYPE).isSupported) {
DuExViewPager2 duExViewPager29 = videoDetailsFragment.x;
if (duExViewPager29 == null) {
Intrinsics.throwUninitializedPropertyAccessException("viewpager");
}
new VideoDetailsPreLoader((RecyclerView) duExViewPager29.getChildAt(0), getViewLifecycleOwner(), videoDetailsFragment);
}
} else {
videoDetailsFragment = this;
i13 = 1;
i12 = 0;
i3 = 2;
}
Integer valueOf = Integer.valueOf(i12);
if (!PatchProxy.proxy(new Object[i12], this, changeQuickRedirect, false, 140757, new Class[i12], Void.TYPE).isSupported && (i14 = videoDetailsFragment.P) != 100) {
if (i14 == 11) {
int intValue = ((Number) b0.f("enter_personal_count_key", valueOf)).intValue();
videoDetailsFragment.s = intValue;
if (intValue < i13) {
b0.l("enter_personal_count_key", Integer.valueOf(intValue + i13));
}
} else if (i14 == 14) {
int intValue2 = ((Number) b0.f("enter_dressing_count_key", valueOf)).intValue();
videoDetailsFragment.s = intValue2;
if (intValue2 < i13) {
b0.l("enter_dressing_count_key", Integer.valueOf(intValue2 + i13));
}
} else if (i14 != 41) {
int intValue3 = ((Number) b0.f("enter_count_key", valueOf)).intValue();
videoDetailsFragment.s = intValue3;
if (intValue3 <= i3) {
b0.l("enter_count_key", Integer.valueOf(intValue3 + i13));
}
} else {
int intValue4 = ((Number) b0.f("enter_recommend_count_key", valueOf)).intValue();
videoDetailsFragment.s = intValue4;
if (intValue4 < i13) {
b0.l("enter_recommend_count_key", Integer.valueOf(intValue4 + i13));
}
}
}
CommunityListItemModel communityListItemModel = videoDetailsFragment.f14822u;
if (communityListItemModel != null) {
communityFeedModel = communityListItemModel.getFeed();
}
if (communityFeedModel != null) {
VideoFragmentAdapter videoFragmentAdapter2 = videoDetailsFragment.w;
if (videoFragmentAdapter2 == null) {
Intrinsics.throwUninitializedPropertyAccessException("videoAdapter");
}
videoFragmentAdapter2.appendItems(CollectionsKt__CollectionsJVMKt.listOf(communityListItemModel));
}
((AppCompatImageView) videoDetailsFragment._$_findCachedViewById(R.id.ivTools)).setOnClickListener(new VideoDetailsFragment$initView$2(videoDetailsFragment));
try {
ka0.a aVar = new ka0.a(new WeakReference(videoDetailsFragment));
videoDetailsFragment.y = aVar;
VideoDetailsFragment$initView$3 videoDetailsFragment$initView$3 = new VideoDetailsFragment$initView$3(videoDetailsFragment);
Object[] objArr = new Object[i13];
objArr[i12] = videoDetailsFragment$initView$3;
ChangeQuickRedirect changeQuickRedirect2 = ka0.a.changeQuickRedirect;
Class[] clsArr = new Class[i13];
clsArr[i12] = Function1.class;
if (!PatchProxy.proxy(objArr, aVar, changeQuickRedirect2, false, 141046, clsArr, Void.TYPE).isSupported) {
aVar.d = videoDetailsFragment$initView$3;
}
ka0.a aVar2 = videoDetailsFragment.y;
if (aVar2 == null) {
Intrinsics.throwUninitializedPropertyAccessException("orientationEventListener");
}
aVar2.enable();
} catch (Exception unused) {
}
videoDetailsFragment.B = getResources().getConfiguration().orientation;
if (!PatchProxy.proxy(new Object[i12], this, changeQuickRedirect, false, 140766, new Class[i12], Void.TYPE).isSupported && getContext() != null) {
mn.a.f35714a.g(videoDetailsFragment.P == 11 ? "https://apk.poizon.com/duApp/Android_Config/resource/community/du_trend_video_guide2.webp" : "https://cdn.poizon.com/node-common/12358f83dd1bcc889b15f95263f6c465.webp").G(videoDetailsFragment).y();
}
z();
((ConstraintLayout) videoDetailsFragment._$_findCachedViewById(R.id.guideContainer)).setOnTouchListener(new c(videoDetailsFragment));
if (!PatchProxy.proxy(new Object[i12], this, changeQuickRedirect, false, 140758, new Class[i12], Void.TYPE).isSupported) {
ScreenShotUtils.e(videoDetailsFragment, new ia0.d(videoDetailsFragment));
}
videoDetailsFragment.f14818l0.observeForever(videoDetailsFragment.f14819m0);
}
}
@Override // com.shizhuang.duapp.modules.du_trend_details.video.interfaces.IVideoHost
public boolean isUserProfileShow() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 140789, new Class[0], Boolean.TYPE);
return proxy.isSupported ? ((Boolean) proxy.result).booleanValue() : !isResumed();
}
public final void j(CommunityListModel communityListModel) {
T t4;
T t12;
if (!PatchProxy.proxy(new Object[]{communityListModel}, this, changeQuickRedirect, false, 140777, new Class[]{CommunityListModel.class}, Void.TYPE).isSupported) {
ArrayList<CommunityListItemModel> list = communityListModel.getList();
VideoItemFragment videoItemFragment = null;
if (list != null) {
Iterator<T> it2 = list.iterator();
while (true) {
if (!it2.hasNext()) {
t12 = null;
break;
}
t12 = it2.next();
if (Intrinsics.areEqual(t12.getFeedId(), this.j)) {
break;
}
}
t4 = t12;
} else {
t4 = null;
}
if (t4 == null) {
u0.a(getActivity(), "动态已删除,看看其他的吧");
FragmentActivity activity = getActivity();
if (activity != null) {
activity.finish();
return;
}
return;
}
ArrayList<CommunityListItemModel> list2 = communityListModel.getList();
Integer valueOf = list2 != null ? Integer.valueOf(list2.indexOf(t4)) : null;
this.g0 = valueOf;
if (valueOf != null) {
int intValue = valueOf.intValue();
Fragment q8 = q();
if (q8 instanceof VideoItemFragment) {
videoItemFragment = q8;
}
VideoItemFragment videoItemFragment2 = videoItemFragment;
if (videoItemFragment2 == null) {
VideoFragmentAdapter videoFragmentAdapter = this.w;
if (videoFragmentAdapter == null) {
Intrinsics.throwUninitializedPropertyAccessException("videoAdapter");
}
videoFragmentAdapter.d().add(communityListModel.getSafeList().get(intValue));
} else {
VideoFragmentAdapter videoFragmentAdapter2 = this.w;
if (videoFragmentAdapter2 == null) {
Intrinsics.throwUninitializedPropertyAccessException("videoAdapter");
}
videoFragmentAdapter2.d().get(0).setFeed(communityListModel.getSafeList().get(intValue).getFeed());
VideoFragmentAdapter videoFragmentAdapter3 = this.w;
if (videoFragmentAdapter3 == null) {
Intrinsics.throwUninitializedPropertyAccessException("videoAdapter");
}
videoFragmentAdapter3.d().get(0).setLight(communityListModel.getSafeList().get(intValue).getLight());
VideoFragmentAdapter videoFragmentAdapter4 = this.w;
if (videoFragmentAdapter4 == null) {
Intrinsics.throwUninitializedPropertyAccessException("videoAdapter");
}
videoFragmentAdapter4.d().get(0).setReason(communityListModel.getSafeList().get(intValue).getReason());
VideoFragmentAdapter videoFragmentAdapter5 = this.w;
if (videoFragmentAdapter5 == null) {
Intrinsics.throwUninitializedPropertyAccessException("videoAdapter");
}
videoFragmentAdapter5.d().get(0).setLightUsers(communityListModel.getSafeList().get(intValue).getLightUsers());
VideoFragmentAdapter videoFragmentAdapter6 = this.w;
if (videoFragmentAdapter6 == null) {
Intrinsics.throwUninitializedPropertyAccessException("videoAdapter");
}
videoItemFragment2.w(videoFragmentAdapter6.d().get(0));
}
VideoFragmentAdapter videoFragmentAdapter7 = this.w;
if (videoFragmentAdapter7 == null) {
Intrinsics.throwUninitializedPropertyAccessException("videoAdapter");
}
videoFragmentAdapter7.notifyDataSetChanged();
VideoFragmentAdapter videoFragmentAdapter8 = this.w;
if (videoFragmentAdapter8 == null) {
Intrinsics.throwUninitializedPropertyAccessException("videoAdapter");
}
int i3 = intValue + 1;
videoFragmentAdapter8.appendItems(communityListModel.getSafeList().subList(i3, communityListModel.getSafeList().size()));
VideoFragmentAdapter videoFragmentAdapter9 = this.w;
if (videoFragmentAdapter9 == null) {
Intrinsics.throwUninitializedPropertyAccessException("videoAdapter");
}
videoFragmentAdapter9.a(communityListModel.getSafeList().subList(0, intValue), 0);
DuExViewPager2 duExViewPager2 = this.x;
if (duExViewPager2 == null) {
Intrinsics.throwUninitializedPropertyAccessException("viewpager");
}
duExViewPager2.setCurrentItem(intValue, false);
H();
G(t4);
if (n.t(CommunityCommonHelper.f12820a.h(t4))) {
t().loadSuntanAwardEntryInfo();
}
if (this.P == 14) {
if (this.I == 1) {
this.b0 = false;
} else {
this.f14811c0 = false;
}
String safeLastId = communityListModel.getSafeLastId();
this.V = safeLastId;
this.Z = !StringsKt__StringsJVMKt.isBlank(safeLastId);
String safeLastId2 = communityListModel.getSafeLastId();
this.W = safeLastId2;
this.f14809a0 = !StringsKt__StringsJVMKt.isBlank(safeLastId2);
if (!(!StringsKt__StringsJVMKt.isBlank(communityListModel.getSafeLastId()))) {
return;
}
if (intValue == 0) {
this.b0 = true;
this.I = 1;
x().getDressingRecommendData(this.P, this.f14815h, this.j, this.V, String.valueOf(this.I), this.f14816j0, getContext());
} else if (i3 == communityListModel.getSafeList().size()) {
this.f14811c0 = true;
this.I = 0;
x().getDressingRecommendData(this.P, this.f14815h, this.j, this.W, String.valueOf(this.I), this.f14816j0, getContext());
}
} else {
this.b0 = false;
String safeLastId3 = communityListModel.getSafeLastId();
this.V = safeLastId3;
this.Z = !StringsKt__StringsJVMKt.isBlank(safeLastId3);
this.f14811c0 = false;
String safeLastId4 = communityListModel.getSafeLastId();
this.W = safeLastId4;
this.f14809a0 = !StringsKt__StringsJVMKt.isBlank(safeLastId4);
}
}
}
}
public final void k() {
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 140786, new Class[0], Void.TYPE).isSupported) {
((ImageView) _$_findCachedViewById(R.id.backIcon)).setVisibility(0);
((ImageView) _$_findCachedViewById(R.id.shareVideoIcon)).setVisibility(0);
((ImageView) _$_findCachedViewById(R.id.shareVideoIcon)).setImageResource(R.drawable.du_trend_detail_video_share_icon_round);
}
}
public final void l() {
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 140771, new Class[0], Void.TYPE).isSupported) {
int i3 = this.P;
if (i3 == 11 || i3 == 14 || i3 == 41) {
((ConstraintLayout) _$_findCachedViewById(R.id.guideContainer)).setVisibility(8);
return;
}
((ConstraintLayout) _$_findCachedViewById(R.id.guideContainer)).setVisibility(8);
b0.l("is_sliding_up_key", 1);
}
}
public final s<CommunityListModel> m(int i3) {
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 140793, new Class[]{Integer.TYPE}, s.class);
return proxy.isSupported ? (s) proxy.result : new b(this, i3);
}
public final void n(boolean z4) {
if (!PatchProxy.proxy(new Object[]{new Byte(z4 ? (byte) 1 : 0)}, this, changeQuickRedirect, false, 140794, new Class[]{Boolean.TYPE}, Void.TYPE).isSupported) {
DuExViewPager2 duExViewPager2 = this.x;
if (duExViewPager2 == null) {
Intrinsics.throwUninitializedPropertyAccessException("viewpager");
}
duExViewPager2.setUserInputEnabled(z4);
}
}
public final void o() {
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 140760, new Class[0], Void.TYPE).isSupported) {
if (!this.b0 || this.I != 1) {
int i3 = this.I;
if (i3 == 0 && this.f14811c0) {
return;
}
if (!this.Z && i3 == 1) {
return;
}
if (i3 == 0 && !this.f14809a0) {
return;
}
if (i3 == 1) {
this.b0 = true;
x().getDressingRecommendData(this.P, this.f14815h, this.j, this.V, String.valueOf(this.I), this.f14816j0, getContext());
return;
}
this.f14811c0 = true;
x().getDressingRecommendData(this.P, this.f14815h, this.j, this.W, String.valueOf(this.I), this.f14816j0, getContext());
}
}
}
@Override // androidx.fragment.app.Fragment
public void onConfigurationChanged(@NotNull Configuration configuration) {
VideoItemFragment w4;
boolean z4 = true;
if (!PatchProxy.proxy(new Object[]{configuration}, this, changeQuickRedirect, false, 140785, new Class[]{Configuration.class}, Void.TYPE).isSupported) {
super.onConfigurationChanged(configuration);
if (this.B != configuration.orientation) {
if (A() || (w4 = w()) == null || w4.i()) {
l();
int i3 = configuration.orientation;
this.B = i3;
if (i3 == 2) {
((ImageView) _$_findCachedViewById(R.id.backIcon)).setVisibility(8);
((AppCompatImageView) _$_findCachedViewById(R.id.ivTools)).setVisibility(8);
((ImageView) _$_findCachedViewById(R.id.ivHideTrend)).setVisibility(8);
((ImageView) _$_findCachedViewById(R.id.shareVideoIcon)).setVisibility(8);
((ImageView) _$_findCachedViewById(R.id.ivSuntanAward)).setVisibility(8);
return;
}
k();
VideoFragmentAdapter videoFragmentAdapter = this.w;
if (videoFragmentAdapter == null) {
Intrinsics.throwUninitializedPropertyAccessException("videoAdapter");
}
if (!videoFragmentAdapter.d().isEmpty()) {
VideoFragmentAdapter videoFragmentAdapter2 = this.w;
if (videoFragmentAdapter2 == null) {
Intrinsics.throwUninitializedPropertyAccessException("videoAdapter");
}
G(videoFragmentAdapter2.d().get(Math.max(this.e, 0)));
}
ImageView imageView = (ImageView) _$_findCachedViewById(R.id.ivSuntanAward);
if (imageView != null) {
SuntanTaskEntryInfo currentData = t().getSuntanAwardEntryRequest().getCurrentData();
if (!(currentData != null && currentData.isShow() && this.e == this.T)) {
z4 = false;
}
ViewKt.setVisible(imageView, z4);
}
}
}
}
}
@Override // com.shizhuang.duapp.common.ui.BaseFragment, androidx.fragment.app.Fragment
public void onCreate(Bundle bundle) {
if (!PatchProxy.proxy(new Object[]{bundle}, this, changeQuickRedirect, false, 140810, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
_boostWeave.FragmentMethodWeaver_onCreate(this, bundle);
}
}
@Override // com.shizhuang.duapp.common.ui.BaseFragment, androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{layoutInflater, viewGroup, bundle}, this, changeQuickRedirect, false, 140814, new Class[]{LayoutInflater.class, ViewGroup.class, Bundle.class}, View.class);
return proxy.isSupported ? (View) proxy.result : _boostWeave.FragmentMethodWeaver_onCreateView(this, layoutInflater, viewGroup, bundle);
}
@Override // com.shizhuang.duapp.common.ui.BaseFragment, androidx.fragment.app.Fragment
public void onDestroyView() {
HashMap hashMap;
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 140784, new Class[0], Void.TYPE).isSupported) {
super.onDestroyView();
try {
ka0.a aVar = this.y;
if (aVar != null) {
if (aVar == null) {
Intrinsics.throwUninitializedPropertyAccessException("orientationEventListener");
}
aVar.disable();
}
} catch (Exception unused) {
}
this.f14818l0.removeObserver(this.f14819m0);
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 140809, new Class[0], Void.TYPE).isSupported && (hashMap = this.f14820n0) != null) {
hashMap.clear();
}
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
public final void onFavoriteChange(@NotNull FavoriteChangeEvent favoriteChangeEvent) {
CommunityListItemModel communityListItemModel;
CommunityFeedModel feed;
CommunityFeedContentModel content;
CommunityFeedLabelModel label;
List<CommunityFeedProductModel> spuList;
T t4;
boolean z4 = true;
if (!PatchProxy.proxy(new Object[]{favoriteChangeEvent}, this, changeQuickRedirect, false, 140806, new Class[]{FavoriteChangeEvent.class}, Void.TYPE).isSupported) {
DuExViewPager2 duExViewPager2 = this.x;
if (duExViewPager2 == null) {
Intrinsics.throwUninitializedPropertyAccessException("viewpager");
}
int currentItem = duExViewPager2.getCurrentItem();
VideoFragmentAdapter videoFragmentAdapter = this.w;
if (videoFragmentAdapter == null) {
Intrinsics.throwUninitializedPropertyAccessException("videoAdapter");
}
Fragment c5 = videoFragmentAdapter.c(currentItem);
if (c5 instanceof VideoItemFragment) {
VideoItemFragment videoItemFragment = (VideoItemFragment) c5;
if (!PatchProxy.proxy(new Object[]{favoriteChangeEvent}, videoItemFragment, VideoItemFragment.changeQuickRedirect, false, 140943, new Class[]{FavoriteChangeEvent.class}, Void.TYPE).isSupported && (communityListItemModel = videoItemFragment.n) != null && (feed = communityListItemModel.getFeed()) != null && (content = feed.getContent()) != null && (label = content.getLabel()) != null && (spuList = label.getSpuList()) != null) {
Iterator<T> it2 = spuList.iterator();
while (true) {
if (!it2.hasNext()) {
t4 = null;
break;
}
t4 = it2.next();
if (Intrinsics.areEqual(t4.getSpuId(), String.valueOf(favoriteChangeEvent.getSpuId()))) {
break;
}
}
T t12 = t4;
if (t12 != null) {
if (favoriteChangeEvent.getFavoriteCount() <= 0) {
z4 = false;
}
t12.setCollection(t20.b.a(z4));
}
}
}
}
}
@Override // com.shizhuang.duapp.modules.du_trend_details.trend.interfaces.IFeedDetailsFragment
public boolean onKeyDown(int i3, @Nullable KeyEvent keyEvent) {
a0 a0Var;
Object[] objArr = {new Integer(i3), keyEvent};
ChangeQuickRedirect changeQuickRedirect2 = changeQuickRedirect;
Class cls = Integer.TYPE;
Class cls2 = Boolean.TYPE;
PatchProxyResult proxy = PatchProxy.proxy(objArr, this, changeQuickRedirect2, false, 140795, new Class[]{cls, KeyEvent.class}, cls2);
if (proxy.isSupported) {
return ((Boolean) proxy.result).booleanValue();
}
Fragment q8 = q();
if (!(q8 instanceof VideoItemFragment)) {
return false;
}
this.f14817k0 = true;
VideoItemFragment videoItemFragment = (VideoItemFragment) q8;
PatchProxyResult proxy2 = PatchProxy.proxy(new Object[]{new Integer(i3), keyEvent}, videoItemFragment, VideoItemFragment.changeQuickRedirect, false, 140934, new Class[]{cls, KeyEvent.class}, cls2);
if (proxy2.isSupported) {
return ((Boolean) proxy2.result).booleanValue();
}
if ((i3 == 24 || i3 == 25) && (a0Var = videoItemFragment.i) != null) {
PatchProxyResult proxy3 = PatchProxy.proxy(new Object[]{new Integer(i3)}, a0Var, a0.changeQuickRedirect, false, 140589, new Class[]{cls}, cls2);
if (proxy3.isSupported) {
return ((Boolean) proxy3.result).booleanValue();
}
try {
int streamVolume = a0Var.e.getStreamVolume(3);
if (i3 == 24) {
streamVolume += a0Var.f32151a;
a0Var.e.setStreamVolume(3, streamVolume, 4);
} else if (i3 == 25) {
streamVolume -= a0Var.f32151a;
a0Var.e.setStreamVolume(3, streamVolume, 4);
}
a0Var.f32152c.setVisibility(0);
SeekBar seekBar = a0Var.f32152c;
seekBar.setProgress((seekBar.getMax() * streamVolume) / a0Var.b);
if (!PatchProxy.proxy(new Object[0], a0Var, a0.changeQuickRedirect, false, 140591, new Class[0], Void.TYPE).isSupported) {
a0Var.d.removeCallbacks(a0Var.f);
a0Var.d.postDelayed(a0Var.f, 2000);
}
} catch (Exception unused) {
return false;
}
} else if (i3 != 4) {
return false;
} else {
if (!videoItemFragment.u()) {
IVideoLandscapeController iVideoLandscapeController = videoItemFragment.l;
if (iVideoLandscapeController == null) {
Intrinsics.throwUninitializedPropertyAccessException("landscapeVideoLayoutHolder");
}
iVideoLandscapeController.switchOrientation();
} else {
DuVideoView duVideoView = videoItemFragment.y;
if (duVideoView == null) {
Intrinsics.throwUninitializedPropertyAccessException("duVideoView");
}
duVideoView.e();
if (VideoViewManager.b.a().b(videoItemFragment.e, videoItemFragment.b)) {
return false;
}
DuVideoView duVideoView2 = videoItemFragment.y;
if (duVideoView2 == null) {
Intrinsics.throwUninitializedPropertyAccessException("duVideoView");
}
duVideoView2.o();
return false;
}
}
return true;
}
@Override // com.shizhuang.duapp.common.ui.BaseFragment, androidx.fragment.app.Fragment
public void onPause() {
VideoItemFragment w4;
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 140763, new Class[0], Void.TYPE).isSupported) {
super.onPause();
if (this.f14817k0 && (w4 = w()) != null) {
w4.x();
}
d30.a.b.a();
Disposable disposable = this.f14823v;
if (disposable != null) {
disposable.dispose();
}
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 140783, new Class[0], Void.TYPE).isSupported) {
FeedDetailsTrackUtil feedDetailsTrackUtil = FeedDetailsTrackUtil.f14690a;
String str = this.j;
int i3 = this.d;
int i12 = this.P;
String str2 = this.l;
String str3 = this.m;
long currentTimeMillis = System.currentTimeMillis() - this.t;
FeedExcessBean feedExcessBean = this.f14815h;
feedDetailsTrackUtil.i(str, i3, i12, str2, str3, currentTimeMillis, feedExcessBean != null ? feedExcessBean.getAcm() : null);
}
u80.a aVar = this.G;
if (aVar != null) {
aVar.a(R.drawable.du_trend_detail_video_share_icon_round);
}
this.G = null;
}
}
@Override // com.shizhuang.duapp.common.ui.BaseFragment, androidx.fragment.app.Fragment
public void onResume() {
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 140761, new Class[0], Void.TYPE).isSupported) {
_boostWeave.FragmentMethodWeaver_onResume(this);
}
}
@Override // androidx.fragment.app.Fragment
public void onSaveInstanceState(@NotNull Bundle bundle) {
if (!PatchProxy.proxy(new Object[]{bundle}, this, changeQuickRedirect, false, 140787, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
super.onSaveInstanceState(new Bundle());
}
}
@Override // com.shizhuang.duapp.common.ui.BaseFragment, androidx.fragment.app.Fragment
public void onStart() {
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 140812, new Class[0], Void.TYPE).isSupported) {
_boostWeave.FragmentMethodWeaver_onStart(this);
}
}
@Override // com.shizhuang.duapp.common.ui.BaseFragment, androidx.fragment.app.Fragment
public void onViewCreated(View view, Bundle bundle) {
if (!PatchProxy.proxy(new Object[]{view, bundle}, this, changeQuickRedirect, false, 140816, new Class[]{View.class, Bundle.class}, Void.TYPE).isSupported) {
_boostWeave.FragmentMethodWeaver_onViewCreated(this, view, bundle);
}
}
public final VideoDetailsViewModel p() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 140738, new Class[0], VideoDetailsViewModel.class);
return (VideoDetailsViewModel) (proxy.isSupported ? proxy.result : this.f14810c.getValue());
}
@Override // com.shizhuang.duapp.modules.du_trend_details.trend.interfaces.IFeedDetailsFragment
public boolean parentCanIntercept(float f12, float f13) {
Object[] objArr = {new Float(f12), new Float(f13)};
ChangeQuickRedirect changeQuickRedirect2 = changeQuickRedirect;
Class cls = Float.TYPE;
PatchProxyResult proxy = PatchProxy.proxy(objArr, this, changeQuickRedirect2, false, 140807, new Class[]{cls, cls}, Boolean.TYPE);
if (proxy.isSupported) {
return ((Boolean) proxy.result).booleanValue();
}
return true;
}
@Nullable
public final Fragment q() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 140796, new Class[0], Fragment.class);
if (proxy.isSupported) {
return (Fragment) proxy.result;
}
if (this.e < 0 || !isAdded()) {
return null;
}
int i3 = this.e;
VideoFragmentAdapter videoFragmentAdapter = this.w;
if (videoFragmentAdapter == null) {
Intrinsics.throwUninitializedPropertyAccessException("videoAdapter");
}
if (i3 >= videoFragmentAdapter.d().size()) {
return null;
}
VideoFragmentAdapter videoFragmentAdapter2 = this.w;
if (videoFragmentAdapter2 == null) {
Intrinsics.throwUninitializedPropertyAccessException("videoAdapter");
}
return videoFragmentAdapter2.c(this.e);
}
@Nullable
public final VideoItemFragment r(int i3) {
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 140797, new Class[]{Integer.TYPE}, VideoItemFragment.class);
if (proxy.isSupported) {
return (VideoItemFragment) proxy.result;
}
VideoItemFragment videoItemFragment = null;
if (i3 < 0 || !isAdded()) {
return null;
}
VideoFragmentAdapter videoFragmentAdapter = this.w;
if (videoFragmentAdapter == null) {
Intrinsics.throwUninitializedPropertyAccessException("videoAdapter");
}
if (i3 >= videoFragmentAdapter.d().size()) {
return null;
}
VideoFragmentAdapter videoFragmentAdapter2 = this.w;
if (videoFragmentAdapter2 == null) {
Intrinsics.throwUninitializedPropertyAccessException("videoAdapter");
}
Fragment c5 = videoFragmentAdapter2.c(i3);
if (c5 instanceof VideoItemFragment) {
videoItemFragment = c5;
}
return videoItemFragment;
}
public final int s() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 140745, new Class[0], Integer.TYPE);
return proxy.isSupported ? ((Integer) proxy.result).intValue() : this.P;
}
@Override // com.shizhuang.duapp.modules.du_trend_details.video.interfaces.IVideoHost
public void scrollToNextPage(@NotNull SlideUpType slideUpType) {
if (!PatchProxy.proxy(new Object[]{slideUpType}, this, changeQuickRedirect, false, 140798, new Class[]{SlideUpType.class}, Void.TYPE).isSupported) {
int i3 = this.e + 1;
VideoFragmentAdapter videoFragmentAdapter = this.w;
if (videoFragmentAdapter == null) {
Intrinsics.throwUninitializedPropertyAccessException("videoAdapter");
}
if (i3 < videoFragmentAdapter.getItemCount()) {
this.E = slideUpType;
DuExViewPager2 duExViewPager2 = this.x;
if (duExViewPager2 == null) {
Intrinsics.throwUninitializedPropertyAccessException("viewpager");
}
int i12 = this.e + 1;
VideoFragmentAdapter videoFragmentAdapter2 = this.w;
if (videoFragmentAdapter2 == null) {
Intrinsics.throwUninitializedPropertyAccessException("videoAdapter");
}
duExViewPager2.setCurrentItem(RangesKt___RangesKt.coerceAtMost(i12, videoFragmentAdapter2.getItemCount() - 1));
}
}
}
@Override // com.shizhuang.duapp.modules.du_trend_details.video.interfaces.IVideoHost
public void setCommentGroupVisibility(boolean z4) {
boolean z5 = PatchProxy.proxy(new Object[]{new Byte(z4 ? (byte) 1 : 0)}, this, changeQuickRedirect, false, 140774, new Class[]{Boolean.TYPE}, Void.TYPE).isSupported;
}
public final void setHasDialogShow(boolean z4) {
if (!PatchProxy.proxy(new Object[]{new Byte(z4 ? (byte) 1 : 0)}, this, changeQuickRedirect, false, 140744, new Class[]{Boolean.TYPE}, Void.TYPE).isSupported) {
this.O = z4;
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
public final void syncFollowChanged(@NotNull FollowUserSyncEvent followUserSyncEvent) {
CommunityFeedInteractModel safeInteract;
if (!PatchProxy.proxy(new Object[]{followUserSyncEvent}, this, changeQuickRedirect, false, 140805, new Class[]{FollowUserSyncEvent.class}, Void.TYPE).isSupported) {
VideoFragmentAdapter videoFragmentAdapter = this.w;
if (videoFragmentAdapter == null) {
Intrinsics.throwUninitializedPropertyAccessException("videoAdapter");
}
LinkedList<CommunityListItemModel> d12 = videoFragmentAdapter.d();
ArrayList<CommunityListItemModel> arrayList = new ArrayList();
for (T t4 : d12) {
CommunityFeedModel feed = t4.getFeed();
if (Intrinsics.areEqual(feed != null ? feed.getUserId() : null, followUserSyncEvent.getUserId())) {
arrayList.add(t4);
}
}
for (CommunityListItemModel communityListItemModel : arrayList) {
CommunityFeedModel feed2 = communityListItemModel.getFeed();
if (!(feed2 == null || (safeInteract = feed2.getSafeInteract()) == null)) {
safeInteract.setFollow(followUserSyncEvent.isFollow());
}
}
}
}
@NotNull
public final SuntanAwardViewModel t() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 140747, new Class[0], SuntanAwardViewModel.class);
return (SuntanAwardViewModel) (proxy.isSupported ? proxy.result : this.U.getValue());
}
public final TrendTopicViewModel u() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 140737, new Class[0], TrendTopicViewModel.class);
return (TrendTopicViewModel) (proxy.isSupported ? proxy.result : this.b.getValue());
}
public final TrackViewModel v() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 140749, new Class[0], TrackViewModel.class);
return (TrackViewModel) (proxy.isSupported ? proxy.result : this.f14813e0.getValue());
}
@Nullable
public final VideoItemFragment w() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 140788, new Class[0], VideoItemFragment.class);
if (proxy.isSupported) {
return (VideoItemFragment) proxy.result;
}
Fragment q8 = q();
if (!(q8 instanceof VideoItemFragment)) {
q8 = null;
}
return (VideoItemFragment) q8;
}
public final VideoDetailsViewModel x() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 140748, new Class[0], VideoDetailsViewModel.class);
return (VideoDetailsViewModel) (proxy.isSupported ? proxy.result : this.f14812d0.getValue());
}
@NotNull
public final DuExViewPager2 y() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 140739, new Class[0], DuExViewPager2.class);
if (proxy.isSupported) {
return (DuExViewPager2) proxy.result;
}
DuExViewPager2 duExViewPager2 = this.x;
if (duExViewPager2 == null) {
Intrinsics.throwUninitializedPropertyAccessException("viewpager");
}
return duExViewPager2;
}
public final void z() {
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 140764, new Class[0], Void.TYPE).isSupported) {
u80.a aVar = this.G;
if (aVar != null) {
if (aVar != null) {
aVar.a(R.drawable.du_trend_detail_video_share_icon_round);
}
this.G = null;
}
u80.a aVar2 = new u80.a((ImageView) _$_findCachedViewById(R.id.shareVideoIcon));
((ImageView) _$_findCachedViewById(R.id.shareVideoIcon)).setVisibility(0);
p().getStartPlayShareAnim().observe(this, new VideoDetailsFragment$initShareIcon$1(this));
this.G = aVar2;
ViewExtensionKt.j((ImageView) _$_findCachedViewById(R.id.shareVideoIcon), 0, new VideoDetailsFragment$initShareIcon$2(this), 1);
}
}
}