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


package com.qq.e.ads;

import android.app.Activity;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import com.qq.e.comm.managers.GDTADManager;
import com.qq.e.comm.pi.ACTD;
import com.qq.e.comm.pi.POFactory;
import com.qq.e.comm.util.GDTLogger;

public class ADActivity extends Activity {
    public static final String NOTCH_CONTAINER_TAG = "NOTCH_CONTAINER";
    protected ACTD a;
    private FrameLayout b;

    private void a() {
        LinearLayout linearLayout = new LinearLayout(this);
        linearLayout.setLayoutParams(new ViewGroup.LayoutParams(-1, -1));
        linearLayout.setOrientation(1);
        super.setContentView(linearLayout);
        FrameLayout frameLayout = new FrameLayout(this);
        frameLayout.setTag(NOTCH_CONTAINER_TAG);
        frameLayout.setLayoutParams(new LinearLayout.LayoutParams(-1, -2));
        linearLayout.addView(frameLayout);
        this.b = new FrameLayout(this);
        this.b.setLayoutParams(new LinearLayout.LayoutParams(-1, -1));
        linearLayout.addView(this.b);
    }

    /* access modifiers changed from: protected */
    public void onActivityResult(int i, int i2, Intent intent) {
        super.onActivityResult(i, i2, intent);
        ACTD actd = this.a;
        if (actd != null) {
            actd.onActivityResult(i, i2, intent);
        }
    }

    public void onBackPressed() {
        ACTD actd = this.a;
        if (actd != null) {
            actd.onBackPressed();
        }
    }

    public void onConfigurationChanged(Configuration configuration) {
        super.onConfigurationChanged(configuration);
        ACTD actd = this.a;
        if (actd != null) {
            actd.onConfigurationChanged(configuration);
        }
    }

    /* access modifiers changed from: protected */
    public void onCreate(Bundle bundle) {
        try {
            POFactory pOFactory = GDTADManager.getInstance().getPM().getPOFactory();
            if (pOFactory != null) {
                Intent intent = getIntent();
                intent.setExtrasClassLoader(pOFactory.getClass().getClassLoader());
                Bundle extras = intent.getExtras();
                if (extras != null) {
                    String string = extras.getString(ACTD.DELEGATE_NAME_KEY);
                    String string2 = extras.getString("appid");
                    if (!TextUtils.isEmpty(string)) {
                        if (!TextUtils.isEmpty(string2)) {
                            if (GDTADManager.getInstance().isInitialized()) {
                                ACTD activityDelegate = pOFactory.getActivityDelegate(string, this);
                                this.a = activityDelegate;
                                if (activityDelegate == null) {
                                    GDTLogger.e("创建 ADActivity Delegate " + string + " 失败");
                                }
                            }
                        }
                    }
                }
            }
        } catch (Throwable th) {
            GDTLogger.e("创建ADActivity Delegate" + ((String) null) + "发生异常", th);
        }
        ACTD actd = this.a;
        if (actd != null) {
            actd.onBeforeCreate(bundle);
        } else {
            try {
                finish();
            } catch (Throwable th2) {
                GDTLogger.e("ADActivity onCreate 发生异常", th2);
            }
        }
        try {
            super.onCreate(bundle);
        } catch (Throwable th3) {
            GDTLogger.e("ADActivity onCreate 发生异常", th3);
        }
        ACTD actd2 = this.a;
        if (actd2 != null) {
            actd2.onAfterCreate(bundle);
        }
    }

    /* access modifiers changed from: protected */
    public void onDestroy() {
        super.onDestroy();
        ACTD actd = this.a;
        if (actd != null) {
            actd.onDestroy();
        }
    }

    public void onPause() {
        ACTD actd = this.a;
        if (actd != null) {
            actd.onPause();
        }
        super.onPause();
    }

    /* access modifiers changed from: protected */
    public void onResume() {
        super.onResume();
        ACTD actd = this.a;
        if (actd != null) {
            actd.onResume();
        }
    }

    /* access modifiers changed from: protected */
    public void onStop() {
        ACTD actd = this.a;
        if (actd != null) {
            actd.onStop();
        }
        super.onStop();
    }

    @Override // android.app.Activity
    public void setContentView(int i) {
        a();
        LayoutInflater.from(this).inflate(i, (ViewGroup) this.b, true);
    }

    @Override // android.app.Activity
    public void setContentView(View view) {
        a();
        this.b.addView(view);
    }

    public void setContentView(View view, ViewGroup.LayoutParams layoutParams) {
        a();
        this.b.addView(view, layoutParams);
    }
}