得物.apk(点击下载) / ImgSimilarGuideController.java


package com.shizhuang.duapp.modules.du_community_common.controller;

import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.view.ViewStub;
import co.c;
import co.d;
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.extension.ViewExtensionKt;
import com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView;
import df.b0;
import fi.b;
import org.jetbrains.annotations.Nullable;

/* compiled from: ImgSimilarGuideController.kt */
public final class ImgSimilarGuideController {
    public static ChangeQuickRedirect changeQuickRedirect;

    /* renamed from: a  reason: collision with root package name */
    public ViewGroup f12698a;
    public boolean b;
    @Nullable

    /* renamed from: c  reason: collision with root package name */
    public View.OnLongClickListener f12699c;

    /* compiled from: ImgSimilarGuideController.kt */
    public static final class a implements View.OnLongClickListener {
        public static ChangeQuickRedirect changeQuickRedirect;
        public final /* synthetic */ ImgSimilarGuideController b;

        public a(ImgSimilarGuideController imgSimilarGuideController) {
            this.b = imgSimilarGuideController;
        }

        public final boolean onLongClick(View view) {
            View.OnLongClickListener onLongClickListener;
            PatchProxyResult proxy = PatchProxy.proxy(new Object[]{view}, this, changeQuickRedirect, false, 98852, new Class[]{View.class}, Boolean.TYPE);
            if (proxy.isSupported) {
                return ((Boolean) proxy.result).booleanValue();
            }
            ViewParent parent = view.getParent();
            if (parent != null) {
                parent.requestDisallowInterceptTouchEvent(true);
            }
            this.b.b();
            ImgSimilarGuideController imgSimilarGuideController = this.b;
            PatchProxyResult proxy2 = PatchProxy.proxy(new Object[0], imgSimilarGuideController, ImgSimilarGuideController.changeQuickRedirect, false, 98847, new Class[0], View.OnLongClickListener.class);
            if (proxy2.isSupported) {
                onLongClickListener = (View.OnLongClickListener) proxy2.result;
            } else {
                onLongClickListener = imgSimilarGuideController.f12699c;
            }
            if (onLongClickListener != null) {
                onLongClickListener.onLongClick(view);
            }
            return true;
        }
    }

    public final void a(@Nullable ViewStub viewStub) {
        if (!PatchProxy.proxy(new Object[]{viewStub}, this, changeQuickRedirect, false, 98849, new Class[]{ViewStub.class}, Void.TYPE).isSupported && !this.b) {
            ViewGroup viewGroup = (ViewGroup) (viewStub != null ? viewStub.inflate() : null);
            this.f12698a = viewGroup;
            this.b = true;
            if (((Boolean) b0.f("trend_detail_img_similar_guide_key", Boolean.TRUE)).booleanValue()) {
                viewGroup.setVisibility(0);
                ViewExtensionKt.j(viewGroup, 0, new ImgSimilarGuideController$handleGuide$1(viewGroup), 1);
                viewGroup.setOnLongClickListener(new a(this));
                ((c) ((DuImageLoaderView) viewGroup.findViewById(R.id.ivSameStyleGuide)).i("https://apk.poizon.com/duApp/Android_Config/resource/community/du_trend_detail_img_similar_guide.webp").v(new d(b.b((float) 55), b.b((float) 100)))).x();
                b0.l("trend_detail_img_similar_guide_key", Boolean.FALSE);
            }
        }
    }

    public final void b() {
        ViewGroup viewGroup;
        boolean z = false;
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 98850, new Class[0], Void.TYPE).isSupported && (viewGroup = this.f12698a) != null) {
            if (viewGroup.getVisibility() == 0) {
                z = true;
            }
            if (z) {
                viewGroup.setVisibility(8);
            }
        }
    }

    public final void c(@Nullable View.OnLongClickListener onLongClickListener) {
        if (!PatchProxy.proxy(new Object[]{onLongClickListener}, this, changeQuickRedirect, false, 98848, new Class[]{View.OnLongClickListener.class}, Void.TYPE).isSupported) {
            this.f12699c = onLongClickListener;
        }
    }
}