admin
2021-04-07 cbb88109494ffc7916f6639c20ce05c0cec941a9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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();
    }
 
}