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


package com.shizhuang.duapp.modules.mall_dynamic.channel.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.ViewGroup;
import android.widget.Space;
import androidx.constraintlayout.widget.ConstraintLayout;
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 com.shizhuang.duapp.libs.duimageloaderview.options.DuRequestOptions;
import com.shizhuang.duapp.libs.duimageloaderview.options.DuScaleType;
import com.tencent.cloud.huiyansdkface.analytics.h;
import j60.t;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.JvmOverloads;
import mn.a;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

@Metadata(bv = {}, d1 = {"\u00004\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u0002\n\u0002\b\b\n\u0002\u0010\u000b\n\u0002\b\u0007\n\u0002\u0010\u000e\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\u0018\u00002\u00020\u0001B'\b\u0007\u0012\u0006\u0010\u001e\u001a\u00020\u001d\u0012\n\b\u0002\u0010 \u001a\u0004\u0018\u00010\u001f\u0012\b\b\u0002\u0010!\u001a\u00020\u0002¢\u0006\u0004\b\"\u0010#J\u000e\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u0002J\u000e\u0010\u0007\u001a\u00020\u00042\u0006\u0010\u0006\u001a\u00020\u0002R\u0017\u0010\f\u001a\u00020\u00018\u0006¢\u0006\f\n\u0004\b\b\u0010\t\u001a\u0004\b\n\u0010\u000bR*\u0010\u0011\u001a\u00020\r2\u0006\u0010\u000e\u001a\u00020\r8\u0006@FX†\u000e¢\u0006\u0012\n\u0004\b\u000f\u0010\u0010\u001a\u0004\b\u0011\u0010\u0012\"\u0004\b\u0013\u0010\u0014R\"\u0010\u001c\u001a\u00020\u00158\u0006@\u0006X†\u000e¢\u0006\u0012\n\u0004\b\u0016\u0010\u0017\u001a\u0004\b\u0018\u0010\u0019\"\u0004\b\u001a\u0010\u001b¨\u0006$"}, d2 = {"Lcom/shizhuang/duapp/modules/mall_dynamic/channel/widget/ChannelFemaleHeaderConstraintLayout;", "Landroidx/constraintlayout/widget/ConstraintLayout;", "", "marginHorizantol", "", "setMarginHorizantol", h.f27021a, "setTopSpace", "e", "Landroidx/constraintlayout/widget/ConstraintLayout;", "getContentView", "()Landroidx/constraintlayout/widget/ConstraintLayout;", "contentView", "", "value", "f", "Z", "isShowBg", "()Z", "setShowBg", "(Z)V", "", "g", "Ljava/lang/String;", "getDefaultMaskUrl", "()Ljava/lang/String;", "setDefaultMaskUrl", "(Ljava/lang/String;)V", "defaultMaskUrl", "Landroid/content/Context;", "context", "Landroid/util/AttributeSet;", "attrs", "defStyleAttr", "<init>", "(Landroid/content/Context;Landroid/util/AttributeSet;I)V", "du_mall_dynamic_release"}, k = 1, mv = {1, 4, 2})
/* compiled from: ChannelFemaleHeaderConstraintLayout.kt */
public final class ChannelFemaleHeaderConstraintLayout extends ConstraintLayout {
    public static ChangeQuickRedirect changeQuickRedirect;
    public final DuImageLoaderView b;

    /* renamed from: c  reason: collision with root package name */
    public final DuImageLoaderView f19411c;
    public final Space d;
    @NotNull
    public final ConstraintLayout e;
    public boolean f;
    @NotNull

    /* renamed from: g  reason: collision with root package name */
    public String f19412g;

    @JvmOverloads
    public ChannelFemaleHeaderConstraintLayout(@NotNull Context context) {
        this(context, null, 0, 6);
    }

    @JvmOverloads
    public ChannelFemaleHeaderConstraintLayout(@NotNull Context context, @Nullable AttributeSet attributeSet) {
        this(context, attributeSet, 0, 4);
    }

    /* JADX INFO: this call moved to the top of the method (can break code semantics) */
    public /* synthetic */ ChannelFemaleHeaderConstraintLayout(Context context, AttributeSet attributeSet, int i, int i3) {
        this(context, (i3 & 2) != 0 ? null : attributeSet, (i3 & 4) != 0 ? 0 : i);
    }

    public final void a(@NotNull String str, boolean z) {
        if (!PatchProxy.proxy(new Object[]{str, new Byte(z ? (byte) 1 : 0)}, this, changeQuickRedirect, false, 212374, new Class[]{String.class, Boolean.TYPE}, Void.TYPE).isSupported) {
            ChannelFemaleHeaderConstraintLayout$loadBlur$loadNormal$1 channelFemaleHeaderConstraintLayout$loadBlur$loadNormal$1 = new ChannelFemaleHeaderConstraintLayout$loadBlur$loadNormal$1(this, str);
            if (z) {
                ((DuRequestOptions) ((DuRequestOptions) a.f35714a.g(str).G(ViewExtensionKt.g(this)).u(new ChannelFemaleHeaderConstraintLayout$loadBlur$1(this, ChannelFemaleHeaderConstraintLayout$loadBlur$execTopConvert$1.INSTANCE, channelFemaleHeaderConstraintLayout$loadBlur$loadNormal$1))).t(new ChannelFemaleHeaderConstraintLayout$loadBlur$2(channelFemaleHeaderConstraintLayout$loadBlur$loadNormal$1))).y();
                return;
            }
            channelFemaleHeaderConstraintLayout$loadBlur$loadNormal$1.invoke();
        }
    }

    public final void b(@Nullable String str) {
        if (!PatchProxy.proxy(new Object[]{str}, this, changeQuickRedirect, false, 212373, new Class[]{String.class}, Void.TYPE).isSupported) {
            DuImageLoaderView duImageLoaderView = this.f19411c;
            if (str == null) {
                str = this.f19412g;
            }
            duImageLoaderView.i(str).p0(DuScaleType.FIT_X_CROP_TOP).x();
        }
    }

    @NotNull
    public final ConstraintLayout getContentView() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 212367, new Class[0], ConstraintLayout.class);
        return proxy.isSupported ? (ConstraintLayout) proxy.result : this.e;
    }

    @NotNull
    public final String getDefaultMaskUrl() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 212370, new Class[0], String.class);
        return proxy.isSupported ? (String) proxy.result : this.f19412g;
    }

    public final void setDefaultMaskUrl(@NotNull String str) {
        if (!PatchProxy.proxy(new Object[]{str}, this, changeQuickRedirect, false, 212371, new Class[]{String.class}, Void.TYPE).isSupported) {
            this.f19412g = str;
        }
    }

    public final void setMarginHorizantol(int i) {
        if (!PatchProxy.proxy(new Object[]{new Integer(i)}, this, changeQuickRedirect, false, 212372, new Class[]{Integer.TYPE}, Void.TYPE).isSupported) {
            com.shizhuang.duapp.modules.du_mall_common.extension.ViewExtensionKt.r(this.e, Integer.valueOf(i), null, Integer.valueOf(i), null, null, null, 58);
        }
    }

    public final void setShowBg(boolean z) {
        int i = 0;
        if (!PatchProxy.proxy(new Object[]{new Byte(z ? (byte) 1 : 0)}, this, changeQuickRedirect, false, 212369, new Class[]{Boolean.TYPE}, Void.TYPE).isSupported) {
            this.f = z;
            this.b.setVisibility(z ? 0 : 8);
            this.f19411c.setVisibility(z ? 0 : 8);
            Space space = this.d;
            if (!z) {
                i = 8;
            }
            space.setVisibility(i);
        }
    }

    public final void setTopSpace(int i) {
        if (!PatchProxy.proxy(new Object[]{new Integer(i)}, this, changeQuickRedirect, false, 212375, new Class[]{Integer.TYPE}, Void.TYPE).isSupported) {
            Space space = this.d;
            ConstraintLayout.LayoutParams layoutParams = (ConstraintLayout.LayoutParams) space.getLayoutParams();
            ((ViewGroup.MarginLayoutParams) layoutParams).height = i;
            space.setLayoutParams(layoutParams);
            DuImageLoaderView duImageLoaderView = this.b;
            ConstraintLayout.LayoutParams layoutParams2 = (ConstraintLayout.LayoutParams) duImageLoaderView.getLayoutParams();
            int d12 = t.d(91);
            int d13 = t.d(259);
            if (d12 > i) {
                d13 -= d12 - i;
            }
            ((ViewGroup.MarginLayoutParams) layoutParams2).height = d13;
            duImageLoaderView.setLayoutParams(layoutParams2);
        }
    }

    @JvmOverloads
    public ChannelFemaleHeaderConstraintLayout(@NotNull Context context, @Nullable AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        DuImageLoaderView duImageLoaderView = new DuImageLoaderView(context);
        duImageLoaderView.setId(R.id.channel_female_header_bg);
        Unit unit = Unit.INSTANCE;
        this.b = duImageLoaderView;
        DuImageLoaderView duImageLoaderView2 = new DuImageLoaderView(context);
        this.f19411c = duImageLoaderView2;
        Space space = new Space(context);
        space.setId(R.id.channel_female_header_top_space);
        this.d = space;
        ConstraintLayout constraintLayout = new ConstraintLayout(context);
        constraintLayout.setId(R.id.channel_female_header_content);
        this.e = constraintLayout;
        this.f = true;
        this.f19412g = "https://apk.poizon.com/duApp/Android_Config/resource/mall/app/dynamic/bg_channel_female_header_mask.png";
        ConstraintLayout.LayoutParams layoutParams = new ConstraintLayout.LayoutParams(-1, 0);
        layoutParams.topToTop = 0;
        layoutParams.dimensionRatio = "H,375:259";
        addView(duImageLoaderView, layoutParams);
        ConstraintLayout.LayoutParams layoutParams2 = new ConstraintLayout.LayoutParams(0, 0);
        layoutParams2.topToTop = duImageLoaderView.getId();
        layoutParams2.bottomToBottom = duImageLoaderView.getId();
        layoutParams2.startToStart = duImageLoaderView.getId();
        layoutParams2.endToEnd = duImageLoaderView.getId();
        addView(duImageLoaderView2, layoutParams2);
        ConstraintLayout.LayoutParams layoutParams3 = new ConstraintLayout.LayoutParams(-1, 0);
        layoutParams3.topToTop = 0;
        layoutParams3.dimensionRatio = "H,375:91";
        addView(space, layoutParams3);
        ConstraintLayout.LayoutParams layoutParams4 = new ConstraintLayout.LayoutParams(-1, -2);
        layoutParams4.topToBottom = space.getId();
        addView(constraintLayout, layoutParams4);
    }
}