Commit b23bfecf authored by zxhljwl's avatar zxhljwl

修改

parent 54056fc6
...@@ -116,6 +116,9 @@ public class RewardVideoMediaPlayer { ...@@ -116,6 +116,9 @@ public class RewardVideoMediaPlayer {
if (null != mShowListener) { if (null != mShowListener) {
mShowListener.OnAdShow(); mShowListener.OnAdShow();
} }
if (null != updateViewListener) {
updateViewListener.OnShowListener();
}
getMediaPlayer().start(); getMediaPlayer().start();
} else {//资源加载未完成 } else {//资源加载未完成
isShowVideo = true; isShowVideo = true;
......
...@@ -13,7 +13,6 @@ import android.widget.FrameLayout; ...@@ -13,7 +13,6 @@ import android.widget.FrameLayout;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import com.ym.zxhcsdk.HttpClientUtils; import com.ym.zxhcsdk.HttpClientUtils;
import com.ym.zxhcsdk.R; import com.ym.zxhcsdk.R;
import com.ym.zxhcsdk.listener.RewardVideoAdUpdateViewListener; import com.ym.zxhcsdk.listener.RewardVideoAdUpdateViewListener;
...@@ -55,7 +54,7 @@ public class RewardvideoPortraitADActivity extends Activity implements SurfaceHo ...@@ -55,7 +54,7 @@ public class RewardvideoPortraitADActivity extends Activity implements SurfaceHo
bottomTitle.setText(RewardVideoMediaPlayer.getInstance().getHcAdBean().getVideo_title()); bottomTitle.setText(RewardVideoMediaPlayer.getInstance().getHcAdBean().getVideo_title());
bottomDesc.setText(RewardVideoMediaPlayer.getInstance().getHcAdBean().getVideo_desc()); bottomDesc.setText(RewardVideoMediaPlayer.getInstance().getHcAdBean().getVideo_desc());
bottomBtnTv.setText(RewardVideoMediaPlayer.getInstance().getHcAdBean().getVideo_iconbuttontext()); bottomBtnTv.setText(RewardVideoMediaPlayer.getInstance().getHcAdBean().getVideo_iconbuttontext());
//设置底部logo
HttpClientUtils.LoadImg(RewardVideoMediaPlayer.getInstance().getHcAdBean().getVideo_icon_url(), new HttpClientUtils.OnRequestImgCallBack() { HttpClientUtils.LoadImg(RewardVideoMediaPlayer.getInstance().getHcAdBean().getVideo_icon_url(), new HttpClientUtils.OnRequestImgCallBack() {
@Override @Override
public void onSuccess(Bitmap bitmap) { public void onSuccess(Bitmap bitmap) {
...@@ -72,8 +71,23 @@ public class RewardvideoPortraitADActivity extends Activity implements SurfaceHo ...@@ -72,8 +71,23 @@ public class RewardvideoPortraitADActivity extends Activity implements SurfaceHo
} }
}); });
//设置预览图
HttpClientUtils.LoadImg(RewardVideoMediaPlayer.getInstance().getHcAdBean().getVideo_cover_image(), new HttpClientUtils.OnRequestImgCallBack() {
@Override
public void onSuccess(Bitmap bitmap) {
runOnUiThread(new Runnable() {
@Override
public void run() {
ivPreview.setImageBitmap(bitmap);
}
});
}
@Override
public void onError(String errorMsg) {
}
});
...@@ -109,6 +123,11 @@ public class RewardvideoPortraitADActivity extends Activity implements SurfaceHo ...@@ -109,6 +123,11 @@ public class RewardvideoPortraitADActivity extends Activity implements SurfaceHo
RewardVideoMediaPlayer.getInstance().startVideo(); RewardVideoMediaPlayer.getInstance().startVideo();
} }
@Override
public void OnShowListener() {
ivPreview.setVisibility(View.GONE);
}
/** /**
* 播放激励视频完成回调 * 播放激励视频完成回调
*/ */
......
...@@ -2,6 +2,11 @@ package com.ym.zxhcsdk.listener; ...@@ -2,6 +2,11 @@ package com.ym.zxhcsdk.listener;
public interface RewardVideoAdUpdateViewListener { public interface RewardVideoAdUpdateViewListener {
/// <summary>
/// 广告加载成功,可在此回调后进行广告展示
/// </summary>
void OnShowListener();
/// <summary> /// <summary>
/// 广告加载成功,可在此回调后进行广告展示 /// 广告加载成功,可在此回调后进行广告展示
/// </summary> /// </summary>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"> <shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#00a1a3a6" /> <solid android:color="#00a1a3a6" />
<padding <padding
android:top="10dp" android:top="8dp"
android:bottom="10dp" android:bottom="8dp"
android:left="20dp" android:left="15dp"
android:right="20dp" android:right="15dp" />
/>
<stroke <stroke
android:width="2dp" android:width="1dp"
android:color="#f2eada" /> android:color="#f2eada" />
<corners android:radius="25dp"/> <corners android:radius="25dp"/>
</shape> </shape>
\ No newline at end of file
...@@ -108,13 +108,11 @@ ...@@ -108,13 +108,11 @@
<TextView <TextView
android:id="@+id/reward_video_ad_btn" android:id="@+id/reward_video_ad_btn"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="50dp" android:layout_height="wrap_content"
android:layout_marginRight="10dp" android:layout_marginRight="10dp"
android:textColor="#000000" android:textColor="#000000"
android:textSize="20dp" android:textSize="16sp"
android:background="@drawable/btn_bg" android:background="@drawable/btn_bg"/>
android:gravity="center"
android:text="" />
</LinearLayout> </LinearLayout>
...@@ -122,6 +120,6 @@ ...@@ -122,6 +120,6 @@
<ImageView <ImageView
android:id="@+id/id_iv_preview" android:id="@+id/id_iv_preview"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"/> android:layout_height="match_parent"
android:scaleType="fitXY"/>
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment