添加关闭按钮

This commit is contained in:
liujing
2020-09-30 15:35:31 +08:00
parent 0bae46b652
commit 0c44ef65db
2 changed files with 16 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ import android.net.Uri;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import androidx.constraintlayout.widget.ConstraintLayout;
@@ -28,6 +29,7 @@ public class V2XRoadVideoWindow extends RelativeLayout implements IV2XWindow {
private V2XWindowStatusListener mV2XWindowStatusListener;
private TextureVideoView mVideoView;
private V2XMessageEntity mV2XMessageEntity;
private ImageView closeImage;
public V2XRoadVideoWindow() {
this(V2XServiceManager.getContext(), null);
@@ -49,6 +51,10 @@ public class V2XRoadVideoWindow extends RelativeLayout implements IV2XWindow {
private void initView(Context context) {
LayoutInflater.from(context).inflate(R.layout.window_road_video, this);
mVideoView = findViewById(R.id.roadVideoView);
closeImage = findViewById(R.id.roadVideoClose);
closeImage.setOnClickListener(v -> {
close();
});
}
@Override

View File

@@ -23,7 +23,16 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"></com.mogo.module.v2x.view.TextureVideoView>
<ImageView
android:id="@+id/roadVideoClose"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/roadVideoView"
android:layout_alignRight="@+id/roadVideoView"
android:src="@drawable/v2x_panel_close" />
</com.mogo.module.v2x.view.RoundLayout>