package com.weikou.beibeivideo.ui.ad;
|
|
import android.os.Bundle;
|
import android.view.KeyEvent;
|
|
import com.weikou.beibeivideo.R;
|
import com.weikou.beibeivideo.entity.ad.SplashAdLoadInfo;
|
import com.weikou.beibeivideo.ui.BaseActivity;
|
import com.weikou.beibeivideo.util.ui.TopStatusSettings;
|
|
import de.greenrobot.event.EventBus;
|
|
|
public class SplashAdActivity extends BaseActivity {
|
|
|
private SplashADFragment splashADFragment;
|
|
@Override
|
protected void onSaveInstanceState(Bundle outState) {
|
super.onSaveInstanceState(outState);
|
}
|
|
@Override
|
public void onCreate(Bundle savedInstanceState) {
|
super.onCreate(savedInstanceState);
|
setContentView(R.layout.activity_splash_ad);
|
TopStatusSettings.setStatusViewAndDeepColor(this);
|
EventBus.getDefault().register(this);
|
splashADFragment = SplashADFragment.newInstance(null, null);
|
splashADFragment.setAdShowListener(new SplashADFragment.AdShowListener() {
|
@Override
|
public void onClose() {
|
finish();
|
}
|
});
|
getSupportFragmentManager().beginTransaction().replace(R.id.fl_splash_ad, splashADFragment).commitAllowingStateLoss();
|
}
|
|
|
@Override
|
protected void onDestroy() {
|
super.onDestroy();
|
EventBus.getDefault().unregister(this);
|
}
|
|
|
@Override
|
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
if (keyCode == KeyEvent.KEYCODE_BACK)
|
return false;
|
else
|
return super.onKeyDown(keyCode, event);
|
}
|
|
public void onEventMainThread(SplashAdLoadInfo adLoadInfo) {
|
finish();
|
}
|
|
}
|