| | |
| | | package com.weikou.beibeivideo.ui.main; |
| | | |
| | | import android.Manifest; |
| | | import android.app.ProgressDialog; |
| | | import android.content.Context; |
| | | import android.content.DialogInterface; |
| | |
| | | import android.content.SharedPreferences; |
| | | import android.content.SharedPreferences.Editor; |
| | | import android.content.pm.ActivityInfo; |
| | | import android.content.pm.PackageManager; |
| | | import android.database.Cursor; |
| | | import android.graphics.Color; |
| | | import android.graphics.ColorMatrix; |
| | |
| | | import java.util.Random; |
| | | |
| | | import androidx.annotation.Nullable; |
| | | import androidx.core.app.ActivityCompat; |
| | | import androidx.fragment.app.Fragment; |
| | | import androidx.loader.app.LoaderManager; |
| | | import androidx.loader.content.CursorLoader; |
| | |
| | | |
| | | return new Fragment[]{ |
| | | new HomeFragment(), new DrawVideoFragment(getSupportFragmentManager()), |
| | | new DYNovelFragment(getSupportFragmentManager()), |
| | | new DYNewsFragment(getSupportFragmentManager()), new DYDramaVideoFragment(getSupportFragmentManager()), new MineFragment() |
| | | |
| | | }; |
| | | } |
| | | |
| | |
| | | case R.id.rb_nav_draw_video: { |
| | | mFragmentSwitchHelper |
| | | .changeFragment(DrawVideoFragment.class); |
| | | } |
| | | break; |
| | | case R.id.rb_nav_novel: { |
| | | mFragmentSwitchHelper |
| | | .changeFragment(DYNovelFragment.class); |
| | | } |
| | | break; |
| | | case R.id.rb_nav_short_tv: { |
| | |
| | | public void onStartComplete(boolean b, String s) { |
| | | } |
| | | }); |
| | | |
| | | if (ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) { |
| | | String[] permissions={ |
| | | Manifest.permission.READ_PHONE_STATE |
| | | }; |
| | | ActivityCompat.requestPermissions(MainActivity.this, permissions, 10010); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | AdUtil.setAdHuaWeiShown(getApplicationContext(), AdPositionEnum.homeInterstitial); |
| | | } |
| | | InterstitialAdUtil.showAd(MainActivity.this, type, HuaWeiAdConstant.HW_AD_HOME_INTERSTITIAL); |
| | | } else { |
| | | }else if (type == AdUtil.AD_TYPE.vivo) { |
| | | InterstitialAdUtil.showAd(MainActivity.this, type, "33fcac40272e43e1b52d18e9988afeef"); |
| | | } |
| | | else { |
| | | InterstitialAdUtil.showAd(MainActivity.this, type, GDTConstant.HOME_INTERSTITIAL); |
| | | } |
| | | |
| | | |
| | | } |
| | | }; |
| | | //延迟三秒显示 |