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


package com.kwad.components.core.page;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import com.kwad.components.core.c.a.c;
import com.kwad.components.core.j.b;
import com.kwad.components.core.kwai.a;
import com.kwad.components.core.playable.PlayableSource;
import com.kwad.components.core.webview.KsAdWebView;
import com.kwad.components.core.webview.jshandler.z;
import com.kwad.sdk.R;
import com.kwad.sdk.api.proxy.app.BaseFragmentActivity;
import com.kwad.sdk.core.response.model.AdTemplate;
import com.kwad.sdk.core.view.AdBaseFrameLayout;
import org.json.JSONObject;

public class a extends b implements a.AbstractC0101a, z.b {
    private boolean Ik = true;
    private AdTemplate mAdTemplate;
    private c mApkDownloadHelper;
    private AdBaseFrameLayout mRootContainer;
    private com.kwad.components.core.kwai.a mTitleBarHelper;
    private com.kwad.components.core.playable.a ol;

    private void d(Intent intent) {
        String stringExtra = intent.getStringExtra("key_template_json");
        if (!TextUtils.isEmpty(stringExtra)) {
            try {
                this.mAdTemplate = new AdTemplate();
                this.mAdTemplate.parseJson(new JSONObject(stringExtra));
                this.mApkDownloadHelper = new c(this.mAdTemplate);
            } catch (Exception e) {
                com.kwad.sdk.core.e.b.printStackTraceOnly(e);
            }
        }
    }

    public static void launch(Context context, AdTemplate adTemplate) {
        com.kwad.sdk.service.a.g(BaseFragmentActivity.FragmentActivity8.class, a.class);
        Intent intent = new Intent(context, BaseFragmentActivity.FragmentActivity8.class);
        intent.putExtra("key_template_json", adTemplate.toJson().toString());
        context.startActivity(intent);
    }

    private void ns() {
        com.kwad.components.core.kwai.a aVar = new com.kwad.components.core.kwai.a(this.mRootContainer);
        this.mTitleBarHelper = aVar;
        aVar.a(this);
        this.mTitleBarHelper.a(new com.kwad.components.core.kwai.b(""));
    }

    public static void register() {
        com.kwad.sdk.service.a.g(BaseFragmentActivity.FragmentActivity8.class, a.class);
    }

    @Override // com.kwad.components.core.webview.jshandler.z.b
    public final void a(z.a aVar) {
        com.kwad.components.core.playable.a aVar2;
        com.kwad.sdk.core.e.b.d("AdPlayableActivityProxy", "updatePageStatus status: " + aVar);
        if (aVar.status == 1 && (aVar2 = this.ol) != null) {
            aVar2.e(PlayableSource.UNKNOWN_TRYPLAY_ENTRY_SOURCE);
        }
    }

    @Override // com.kwad.components.core.j.b
    public String getPageName() {
        return "AdPlayableActivityProxy";
    }

    @Override // com.kwad.sdk.api.proxy.IActivityProxy, com.kwad.components.core.j.b
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        getActivity().setTheme(R.style.Theme_AppCompat_Light_NoActionBar);
        setContentView(R.layout.ksad_activity_playable);
        d(getIntent());
        this.mRootContainer = (AdBaseFrameLayout) findViewById(R.id.ksad_playable_activity_root);
        ns();
        com.kwad.components.core.playable.a aVar = new com.kwad.components.core.playable.a((KsAdWebView) findViewById(R.id.ksad_playable_webview));
        this.ol = aVar;
        aVar.a(this.mAdTemplate, this.mRootContainer, this.mApkDownloadHelper);
        this.ol.a(this);
        this.ol.nY();
    }

    @Override // com.kwad.sdk.api.proxy.IActivityProxy, com.kwad.components.core.j.b
    public void onDestroy() {
        super.onDestroy();
        this.ol.b(this);
    }

    @Override // com.kwad.sdk.api.proxy.IActivityProxy
    public void onPause() {
        super.onPause();
    }

    @Override // com.kwad.sdk.api.proxy.IActivityProxy
    public void onRestart() {
        super.onRestart();
    }

    @Override // com.kwad.sdk.api.proxy.IActivityProxy, com.kwad.components.core.j.b
    public void onResume() {
        super.onResume();
    }

    @Override // com.kwad.components.core.kwai.a.AbstractC0101a
    public final void p(View view) {
        onBackPressed();
    }

    @Override // com.kwad.components.core.kwai.a.AbstractC0101a
    public final void q(View view) {
        finish();
    }
}