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


package on0;

import android.content.Context;
import android.graphics.drawable.Drawable;
import androidx.core.content.ContextCompat;
import com.meituan.robust.ChangeQuickRedirect;
import com.meituan.robust.PatchProxy;
import com.meituan.robust.PatchProxyResult;
import com.shizhuang.duapp.R;
import com.shizhuang.duapp.modules.live.common.model.live.LiveLevelItem;
import com.shizhuang.duapp.modules.live.common.model.live.message.BaseLiveChatMessage;
import com.shizhuang.duapp.modules.live.common.model.user.LiveLiteUserModel;
import java.util.List;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/* compiled from: LiveLevelHelper.kt */
public final class o {
    @NotNull

    /* renamed from: a  reason: collision with root package name */
    public static final o f36656a = new o();
    public static ChangeQuickRedirect changeQuickRedirect;

    @Nullable
    public final Drawable a(@NotNull Context context, int i) {
        int i3 = 0;
        PatchProxyResult proxy = PatchProxy.proxy(new Object[]{context, new Integer(i)}, this, changeQuickRedirect, false, 193516, new Class[]{Context.class, Integer.TYPE}, Drawable.class);
        if (proxy.isSupported) {
            return (Drawable) proxy.result;
        }
        if (i != 0) {
            i3 = (1 <= i && 9 >= i) ? R.drawable.du_live_fans_level_1_9 : (10 <= i && 19 >= i) ? R.drawable.du_live_fans_level_10_19 : (20 <= i && 29 >= i) ? R.drawable.du_live_fans_level_20_29 : (30 <= i && 39 >= i) ? R.drawable.du_live_fans_level_30_39 : (40 <= i && 49 >= i) ? R.drawable.du_live_fans_level_40_49 : R.drawable.du_live_fans_level_50;
        }
        if (i3 == 0) {
            return null;
        }
        return ContextCompat.getDrawable(context, i3);
    }

    @Nullable
    public final LiveLevelItem b(@NotNull BaseLiveChatMessage baseLiveChatMessage) {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[]{baseLiveChatMessage}, this, changeQuickRedirect, false, 193515, new Class[]{BaseLiveChatMessage.class}, LiveLevelItem.class);
        if (proxy.isSupported) {
            return (LiveLevelItem) proxy.result;
        }
        LiveLiteUserModel liveLiteUserModel = baseLiveChatMessage.userInfo;
        r0 = null;
        List<LiveLevelItem> list = liveLiteUserModel != null ? liveLiteUserModel.extraLevel : null;
        if (list != null) {
            for (LiveLevelItem liveLevelItem : list) {
            }
        }
        return liveLevelItem;
    }

    @NotNull
    public final String c(int i, boolean z) {
        String str;
        String str2;
        String str3;
        PatchProxyResult proxy = PatchProxy.proxy(new Object[]{new Integer(i), new Byte(z ? (byte) 1 : 0)}, this, changeQuickRedirect, false, 193514, new Class[]{Integer.TYPE, Boolean.TYPE}, String.class);
        if (proxy.isSupported) {
            return (String) proxy.result;
        }
        if (!z && i > 50) {
            i = 50;
        }
        if (z && i > 21) {
            i = 21;
        }
        if (z) {
            str = "du_live_chat_kol_level";
            str3 = "https://apk.poizon.com/duApp/Android_Config/live/anchor/";
            str2 = ".png";
        } else {
            str = "du_live_chat_user_level";
            str3 = "https://apk.poizon.com/duApp/Android_Config/live/user/";
            str2 = ".jpg";
        }
        return str3 + str + i + str2;
    }

    @NotNull
    public final String d(int i, int i3) {
        boolean z = false;
        Object[] objArr = {new Integer(i), new Integer(i3)};
        ChangeQuickRedirect changeQuickRedirect2 = changeQuickRedirect;
        Class cls = Integer.TYPE;
        PatchProxyResult proxy = PatchProxy.proxy(objArr, this, changeQuickRedirect2, false, 193517, new Class[]{cls, cls}, String.class);
        if (proxy.isSupported) {
            return (String) proxy.result;
        }
        if (i < 1) {
            return "";
        }
        if (i > 4) {
            i = 4;
        }
        String str = i3 != 1 ? i3 != 2 ? "" : "bg_live_popularity_rank_" : "bg_live_commerce_rank_";
        if (str.length() == 0) {
            z = true;
        }
        if (z) {
            return "";
        }
        return "https://apk.poizon.com/duApp/Android_Config/live/rank/" + str + i + ".jpg";
    }
}