| | |
| | | import android.widget.Toast; |
| | | |
| | | import com.androidquery.AQuery; |
| | | import com.bytedance.sdk.dp.DPSdk; |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.reflect.TypeToken; |
| | | import com.lcjian.library.util.FragmentSwitchHelper; |
| | |
| | | |
| | | return new Fragment[]{ |
| | | new HomeFragment(), new DrawVideoFragment(getSupportFragmentManager()), |
| | | new DYNewsFragment(getSupportFragmentManager()),new DYDramaVideoFragment(getSupportFragmentManager()), new MineFragment() |
| | | new DYNewsFragment(getSupportFragmentManager()), new DYDramaVideoFragment(getSupportFragmentManager()), new MineFragment() |
| | | |
| | | }; |
| | | } |
| | |
| | | findViewById(R.id.ll_activity_login).setOnClickListener(this); |
| | | findViewById(R.id.fl_category).setOnClickListener(this); |
| | | |
| | | if (AndroidManifestUtil.isHuaWeiChannel(getApplicationContext())) { |
| | | mAQuery.id(R.id.rb_nav_short_tv).visibility(View.GONE); |
| | | } else { |
| | | mAQuery.id(R.id.rb_nav_short_tv).visibility(View.VISIBLE); |
| | | } |
| | | |
| | | |
| | | initialer.run(); |
| | | |
| | |
| | | // }); |
| | | //显示广告 |
| | | showInterstitialAd(); |
| | | // 运行 |
| | | DPSdk.start(new DPSdk.StartListener() { |
| | | @Override |
| | | public void onStartComplete(boolean b, String s) { |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | |
| | | if (YouthUtil.isOpenYouthMode(getApplicationContext())) { |
| | | mAQuery.id(R.id.ll_top).visibility(View.GONE); |
| | | } else { |
| | | if (mAQuery.id(R.id.rb_nav_draw_video).isChecked() || mAQuery.id(R.id.rb_nav_novel).isChecked() || mAQuery.id(R.id.rb_nav_discover).isChecked()|| mAQuery.id(R.id.rb_nav_short_tv).isChecked()) { |
| | | if (mAQuery.id(R.id.rb_nav_draw_video).isChecked() || mAQuery.id(R.id.rb_nav_novel).isChecked() || mAQuery.id(R.id.rb_nav_discover).isChecked() || mAQuery.id(R.id.rb_nav_short_tv).isChecked()) { |
| | | mAQuery.id(R.id.ll_top).visibility(View.GONE); |
| | | } else { |
| | | mAQuery.id(R.id.ll_top).visibility(View.VISIBLE); |
| | | } |
| | | if (mAQuery.id(R.id.rb_nav_draw_video).isChecked()||mAQuery.id(R.id.rb_nav_short_tv).isChecked()) { |
| | | if (mAQuery.id(R.id.rb_nav_draw_video).isChecked() || mAQuery.id(R.id.rb_nav_short_tv).isChecked()) { |
| | | // mAQuery.id(R.id.v_status_bar).background(Color.BLACK); |
| | | //TODO 设置状态栏为深色 |
| | | TopStatusSettings.setStatusViewAndLightColor(this); |
| | |
| | | |
| | | //显示插屏广告 |
| | | private void showInterstitialAd() { |
| | | final AdUtil.AD_TYPE adType = AdUtil.getAdType(getApplicationContext(), AdPositionEnum.homeInterstitial); |
| | | final AdUtil.AD_TYPE adType = AdUtil.getAdType(getApplicationContext(), AdPositionEnum.homeInterstitial); |
| | | if (adType == null) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | |
| | | adCallback = new Runnable() { |
| | |
| | | } |
| | | |
| | | if (type == AdUtil.AD_TYPE.csj) { |
| | | InterstitialAdUtil.showAd(MainActivity.this, type, CSJConstant.HOME_INTERSTITIALAD); |
| | | }else if(type == AdUtil.AD_TYPE.hw){ |
| | | |
| | | InterstitialAdUtil.showAd(MainActivity.this, type, AndroidManifestUtil.isVIVOChannel(getApplicationContext()) ? CSJConstant.HOME_INTERSTITIALAD_VIVO : CSJConstant.HOME_INTERSTITIALAD); |
| | | } else if (type == AdUtil.AD_TYPE.hw) { |
| | | if (AndroidManifestUtil.isHuaWeiChannel(getApplicationContext())) { |
| | | // 华为平台的弹出广告每天只能弹出一次 |
| | | if (!AdUtil.canShowAdHuaWei(getApplicationContext(), AdPositionEnum.homeInterstitial)) { |
| | | return; |
| | | } |
| | | AdUtil.setAdHuaWeiShown(getApplicationContext(),AdPositionEnum.homeInterstitial); |
| | | AdUtil.setAdHuaWeiShown(getApplicationContext(), AdPositionEnum.homeInterstitial); |
| | | } |
| | | InterstitialAdUtil.showAd(MainActivity.this, type, HuaWeiAdConstant.HW_AD_HOME_INTERSTITIAL); |
| | | } else { |