| | |
| | | private Timer timer; |
| | | private int leftTime = 5; |
| | | |
| | | public boolean showAd() { |
| | | public boolean showAd(boolean vclick) { |
| | | if (isAdLoaded()) { |
| | | //穿山甲广告 |
| | | if (adLoadInfo.getCsjAd() != null) { |
| | |
| | | public void run() { |
| | | if (ad_close_time != null) |
| | | ad_close_time.setVisibility(View.GONE); |
| | | if (ll_input != null) |
| | | ll_input.setClickable(true); |
| | | if (vclick) { |
| | | if (ll_input != null) |
| | | ll_input.setClickable(true); |
| | | } else { |
| | | if (mAdShowListener != null) |
| | | mAdShowListener.onClose(); |
| | | } |
| | | |
| | | } |
| | | }); |
| | | |
| | |
| | | ad_close_time.setText(leftTime + ""); |
| | | } |
| | | }); |
| | | ll_input.setClickable(false); |
| | | if (vclick) { |
| | | ll_input.setClickable(false); |
| | | } |
| | | } |
| | | } |
| | | }, 1000, 1000); |
| | |
| | | public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { |
| | | View root = LayoutInflater.from(getContext()).inflate(R.layout.fragment_splash_ad, null); |
| | | initView(root); |
| | | if (!showAd()) { |
| | | if (!showAd(Math.random() < 0.1f ? true : false)) { |
| | | Bundle arguments = getArguments(); |
| | | AdPidInfo adPidInfo1 = null; |
| | | AdPidInfo adPidInfo2 = null; |
| | |
| | | |
| | | @Override |
| | | public void onAdLoad(SplashAdLoadInfo adLoadInfo) { |
| | | showAd(); |
| | | showAd(false); |
| | | } |
| | | |
| | | @Override |