导航菜单

页面标题

页面副标题

凤凰之城 v1.0.3 - StopoverDialogActivity.java 源代码

正在查看: 凤凰之城 v1.0.3 应用的 StopoverDialogActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.octopus.ad.internal.activity;

import android.app.Activity;
import android.app.AlertDialog;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AlphaAnimation;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.Nullable;
import com.octopus.ad.R;
import com.octopus.ad.a.b;
import com.octopus.ad.internal.k;
import com.octopus.ad.internal.utilities.ImageManager;
import com.octopus.ad.internal.utilities.ViewUtil;
import com.octopus.ad.utils.b.f;
import com.sigmob.sdk.base.blurkit.c;
import java.util.Map;

public class StopoverDialogActivity extends Activity {
    private String a;
    private String b;
    private String c;
    private String d;
    private boolean e;
    private com.octopus.ad.a.a f;
    private ImageView g;
    private RelativeLayout h;
    private RelativeLayout i;
    private TextView j;
    private TextView k;
    private TextView l;

    @Override
    public void onCreate(@Nullable Bundle bundle) {
        Map map;
        super.onCreate(bundle);
        try {
            Bundle bundleExtra = getIntent().getBundleExtra("bundleData");
            if (bundleExtra == null || (map = (Map) bundleExtra.getSerializable("mapData")) == null) {
                return;
            }
            this.a = (String) map.get("icon");
            this.b = (String) map.get("title");
            this.c = (String) map.get("description");
            this.d = (String) map.get("landingPageUrl");
            a();
        } catch (Exception e) {
            f.a("OctopusAd", "An Exception Caught", e);
        }
    }

    @Override
    public void onDestroy() {
        k.a().a("StopoverFinish");
        super.onDestroy();
    }

    @Override
    public void onResume() {
        super.onResume();
        com.octopus.ad.a.a aVar = this.f;
        if (aVar != null) {
            aVar.b();
        }
    }

    public void b() {
        com.octopus.ad.a.a aVar = this.f;
        if (aVar != null) {
            aVar.c();
            return;
        }
        com.octopus.ad.a.a aVar2 = new com.octopus.ad.a.a(15000L, 50L);
        this.f = aVar2;
        aVar2.a(new b() {
            public void a(long j) {
                int i = (int) ((j / 1000) + 1);
                if (StopoverDialogActivity.this.j != null) {
                    StopoverDialogActivity.this.j.setText(String.valueOf(i));
                }
            }

            public void b() {
            }

            public void a() {
                k.a().a("getReward");
                StopoverDialogActivity.this.e = true;
                StopoverDialogActivity.this.a(2);
            }
        });
        this.f.a();
    }

    private void a() {
        try {
            AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.OctopusAlertDialogStyle);
            View inflate = LayoutInflater.from(this).inflate(R.layout.oct_dialog_stopover, (ViewGroup) null);
            builder.setView(inflate);
            AlertDialog create = builder.create();
            create.setCancelable(false);
            create.setCanceledOnTouchOutside(false);
            this.g = (ImageView) inflate.findViewById(R.id.iv_gift);
            this.h = (RelativeLayout) inflate.findViewById(R.id.rl_tip_start);
            this.i = (RelativeLayout) inflate.findViewById(R.id.rl_tip_countdown);
            this.j = (TextView) inflate.findViewById(R.id.tv_tip_time);
            this.k = (TextView) inflate.findViewById(R.id.tv_tip_end);
            ImageView imageView = (ImageView) inflate.findViewById(R.id.iv_app_icon);
            TextView textView = (TextView) inflate.findViewById(R.id.tv_ad_title);
            TextView textView2 = (TextView) inflate.findViewById(R.id.tv_ad_description);
            this.l = (TextView) inflate.findViewById(R.id.tv_button);
            ImageView imageView2 = (ImageView) inflate.findViewById(R.id.iv_click);
            ImageManager.with(this).load(this.a).into(imageView);
            textView.setText(this.b);
            textView2.setText(this.c);
            AlphaAnimation alphaAnimation = new AlphaAnimation(1.0f, c.d);
            alphaAnimation.setDuration(300L);
            alphaAnimation.setRepeatCount(-1);
            alphaAnimation.setRepeatMode(2);
            imageView2.startAnimation(alphaAnimation);
            TextView textView3 = (TextView) inflate.findViewById(R.id.tv_continue);
            textView3.setPaintFlags(textView3.getPaintFlags() | 8);
            this.l.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    if (StopoverDialogActivity.this.e) {
                        StopoverDialogActivity.this.finish();
                        return;
                    }
                    ViewUtil.openLocalBrowser(StopoverDialogActivity.this.d, 1);
                    StopoverDialogActivity.this.a(1);
                    StopoverDialogActivity.this.b();
                }
            });
            textView3.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    StopoverDialogActivity.this.finish();
                }
            });
            create.show();
        } catch (Exception e) {
            f.a("OctopusAd", "An Exception Caught", e);
        }
    }

    public void a(int i) {
        if (i == 1) {
            this.g.setVisibility(8);
            this.h.setVisibility(8);
            this.k.setVisibility(8);
            this.i.setVisibility(0);
            this.l.setText("返回页面");
            return;
        }
        if (i != 2) {
            this.i.setVisibility(8);
            this.k.setVisibility(8);
            this.g.setVisibility(0);
            this.h.setVisibility(0);
            this.l.setText("立即前往");
            return;
        }
        this.g.setVisibility(8);
        this.h.setVisibility(8);
        this.i.setVisibility(8);
        this.k.setVisibility(0);
        this.l.setText("返回视频");
    }
}