Commit 6b344ded authored by 王雪伟's avatar 王雪伟

声音按钮

parent 05d46653
......@@ -113,6 +113,11 @@ public class RewardVideoPortraitADActivity extends Activity implements SurfaceHo
RewardVideoAdClick();
}
});
//初始化SurfaceHolder类,SurfaceView的控制器
surfaceHolder = sfv_reward_show.getHolder();
surfaceHolder.addCallback(this);
......@@ -151,10 +156,6 @@ public class RewardVideoPortraitADActivity extends Activity implements SurfaceHo
}
};
//TODO 点击按钮,跳转的落地页, 或者是软件下载地
//址。(可通过 target_type 字段判断是到普通
//落地页还是下载 app,唤醒则通过 deeplink 是
//否为空判断) 确认video_endbutoonurl 具体含义 以及跳转Web的路径
private void RewardVideoAdClick() {
boolean IsSuccess = true;
if (TextUtils.isEmpty(RewardVideoMediaPlayer.getInstance().getHcAdBean().getDeeplink())) {
......@@ -242,6 +243,30 @@ public class RewardVideoPortraitADActivity extends Activity implements SurfaceHo
private void SetAdVideo(){
TopClose.setVisibility(View.GONE);
TopTimeTv.setVisibility(View.VISIBLE);
//设置声音按钮
ImageView soundImgOpen = findViewById(R.id.reward_ad_sound_open);
ImageView soundImgClose = findViewById(R.id.reward_ad_sound_close);
soundImgOpen.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
soundImgOpen.setVisibility(View.GONE);
soundImgClose.setVisibility(View.VISIBLE);
RewardVideoMediaPlayer.getInstance().getMediaPlayer().setVolume(0,0);
}
});
soundImgClose.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
soundImgClose.setVisibility(View.GONE);
soundImgOpen.setVisibility(View.VISIBLE);
RewardVideoMediaPlayer.getInstance().getMediaPlayer().setVolume(1,1);
}
});
}
@Override
......
......@@ -2,6 +2,7 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/frame_content"
android:layout_width="match_parent"
......@@ -16,23 +17,30 @@
android:id="@+id/id_iv_preview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"/>
android:scaleType="fitXY" />
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="60dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/reward_ad_Voice"
android:id="@+id/reward_ad_sound_open"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:src="@mipmap/video_sound_open" />
<ImageView
android:id="@+id/reward_ad_sound_close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:src="@mipmap/video_sound_close"
android:visibility="gone" />
<View
android:layout_width="0dp"
android:layout_height="0dp"
......@@ -42,7 +50,6 @@
android:id="@+id/reward_ad_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginRight="20dp"
android:textColor="#FFFFFF"
android:textSize="20dp" />
......@@ -51,7 +58,6 @@
android:id="@+id/reward_ad_close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginRight="20dp"
android:src="@mipmap/feedad_close" />
......@@ -71,8 +77,8 @@
android:id="@+id/reward_ad_app_icon"
android:layout_width="70dp"
android:layout_height="70dp"
android:scaleType="fitCenter"
android:layout_marginLeft="10dp" />
android:layout_marginLeft="10dp"
android:scaleType="fitCenter" />
<LinearLayout
android:id="@+id/reward_ad_desc_view"
......@@ -111,9 +117,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:background="@drawable/btn_bg"
android:textColor="#000000"
android:textSize="16sp"
android:background="@drawable/btn_bg"/>
android:textSize="16sp" />
</LinearLayout>
</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