|
@@ -155,38 +155,41 @@ public class SplashAct extends BaseActivity {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void loadAdvertising() {
|
|
private void loadAdvertising() {
|
|
|
|
|
+ if (this.isDestroyed()) return;
|
|
|
if (advertising.isImage()) {
|
|
if (advertising.isImage()) {
|
|
|
Glide.with(this).load(advertising.getDisplay_src()).into(splash_image_view);
|
|
Glide.with(this).load(advertising.getDisplay_src()).into(splash_image_view);
|
|
|
- splash_video_view.setVisibility(View.GONE);
|
|
|
|
|
|
|
+ ViewUtil.setVisibility(splash_video_view, View.GONE);
|
|
|
} else {
|
|
} else {
|
|
|
Uri uri = Uri.parse(advertising.getDisplay_src());
|
|
Uri uri = Uri.parse(advertising.getDisplay_src());
|
|
|
- splash_video_view.setVisibility(View.VISIBLE);
|
|
|
|
|
- splash_video_view.setOnInfoListener(new MediaPlayer.OnInfoListener() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public boolean onInfo(MediaPlayer mediaPlayer, int what, int extra) {
|
|
|
|
|
- if (!mediaPlayer.isLooping())
|
|
|
|
|
- mediaPlayer.setLooping(true);
|
|
|
|
|
- LogUtil.println("onInfo what = " + what + " extra = " + extra);
|
|
|
|
|
- if (MediaPlayer.MEDIA_INFO_BUFFERING_START == what) {
|
|
|
|
|
- splash_image_view.setVisibility(View.GONE);
|
|
|
|
|
|
|
+ if (splash_video_view != null) {
|
|
|
|
|
+ splash_video_view.setVisibility(View.VISIBLE);
|
|
|
|
|
+ splash_video_view.setOnInfoListener(new MediaPlayer.OnInfoListener() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public boolean onInfo(MediaPlayer mediaPlayer, int what, int extra) {
|
|
|
|
|
+ if (!mediaPlayer.isLooping())
|
|
|
|
|
+ mediaPlayer.setLooping(true);
|
|
|
|
|
+ LogUtil.println("onInfo what = " + what + " extra = " + extra);
|
|
|
|
|
+ if (MediaPlayer.MEDIA_INFO_BUFFERING_START == what) {
|
|
|
|
|
+ splash_image_view.setVisibility(View.GONE);
|
|
|
|
|
+ }
|
|
|
|
|
+ return false;
|
|
|
}
|
|
}
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- splash_video_view.setVideoURI(uri);
|
|
|
|
|
- splash_video_view.start();
|
|
|
|
|
- splash_video_view.requestFocus();
|
|
|
|
|
|
|
+ });
|
|
|
|
|
+ splash_video_view.setVideoURI(uri);
|
|
|
|
|
+ splash_video_view.start();
|
|
|
|
|
+ splash_video_view.requestFocus();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
mHandler.removeMessages(0);
|
|
mHandler.removeMessages(0);
|
|
|
if (advertising.getShow_time() > 0) {
|
|
if (advertising.getShow_time() > 0) {
|
|
|
- splash_skip.setVisibility(View.VISIBLE);
|
|
|
|
|
|
|
+ ViewUtil.setVisibility(splash_skip, View.VISIBLE);
|
|
|
timer = RxjavaCountDownTimer.getInstance(advertising.getShow_time())
|
|
timer = RxjavaCountDownTimer.getInstance(advertising.getShow_time())
|
|
|
.setOnTickListener(new RxjavaCountDownTimer.OnTickListener() {
|
|
.setOnTickListener(new RxjavaCountDownTimer.OnTickListener() {
|
|
|
@Override
|
|
@Override
|
|
|
public void onFinish() {
|
|
public void onFinish() {
|
|
|
if (!isDestroyed()) {
|
|
if (!isDestroyed()) {
|
|
|
- splash_skip.setVisibility(View.INVISIBLE);//设置为INVISIBLE代表定时器结束
|
|
|
|
|
|
|
+ ViewUtil.setVisibility(splash_skip, View.INVISIBLE);//设置为INVISIBLE代表定时器结束
|
|
|
if (!goLink) {
|
|
if (!goLink) {
|
|
|
sendHandlerMessages(10);
|
|
sendHandlerMessages(10);
|
|
|
}
|
|
}
|