翰林优商.apk(点击下载) / b0.java


package com.xlx.speech.m0;

import android.content.Context;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.xlx.speech.i.b;
import com.xlx.speech.voicereadsdk.R;
import com.xlx.speech.voicereadsdk.bean.resp.RetryInstallResult;
import com.xlx.speech.y.t;
import java.util.HashMap;

public class b0 {
    public static void a(Context context, RetryInstallResult retryInstallResult, View view) {
        HashMap hashMap;
        if (retryInstallResult.getAdId() != 0) {
            if (!(context.getPackageManager().getLaunchIntentForPackage(retryInstallResult.getPackageName()) != null)) {
                u a = u.a(context, String.valueOf(retryInstallResult.getAdId()), String.valueOf(retryInstallResult.getLogId()), retryInstallResult.getPackageName());
                if (!a.c()) {
                    return;
                }
                if (retryInstallResult.getShowType() == 1) {
                    new t(context, retryInstallResult).show();
                    return;
                }
                if (retryInstallResult.getShowType() == 2) {
                    a.h();
                    try {
                        hashMap = new HashMap();
                        hashMap.put("landingretain_type", 1);
                        hashMap.put("adId", Integer.valueOf(retryInstallResult.getAdId()));
                    } catch (Throwable unused) {
                        return;
                    }
                } else if (retryInstallResult.getShowType() == 3) {
                    View rootView = view.getRootView();
                    if (rootView instanceof ViewGroup) {
                        ViewGroup viewGroup = (ViewGroup) rootView;
                        ViewGroup viewGroup2 = (ViewGroup) LayoutInflater.from(context).inflate(R.layout.xlx_voice_layout_retry_install, viewGroup, false);
                        ViewGroup.MarginLayoutParams marginLayoutParams = new ViewGroup.MarginLayoutParams(-1, -2);
                        int dimensionPixelOffset = context.getResources().getDimensionPixelOffset(R.dimen.xlx_voice_dp_5);
                        marginLayoutParams.setMargins(dimensionPixelOffset, e0.a(context) + dimensionPixelOffset, dimensionPixelOffset, 0);
                        viewGroup.addView(viewGroup2, marginLayoutParams);
                        viewGroup2.findViewById(R.id.xlx_voice_iv_close).setOnClickListener(new z(viewGroup, viewGroup2));
                        j.a().loadImage(context, retryInstallResult.getSponsorLogo(), (ImageView) viewGroup2.findViewById(R.id.xlx_voice_iv_icon));
                        viewGroup2.findViewById(R.id.xlx_voice_tv_install).setOnClickListener(new a0(a));
                        ((TextView) viewGroup2.findViewById(R.id.xlx_voice_tv_retry_tips)).setText(Html.fromHtml(String.format("<font color='#FF295B'>“%s”</font>已下载完成!<br>请点击安装,前往试玩</font>", retryInstallResult.getSponsorName())));
                        hashMap = new HashMap();
                        hashMap.put("landingretain_type", 2);
                        hashMap.put("adId", Integer.valueOf(retryInstallResult.getAdId()));
                    } else {
                        return;
                    }
                } else {
                    return;
                }
                b.a("landingretain_page_view", hashMap);
            }
        }
    }
}