some area of drawerlayer is invisible but clickable after pause VideoView at android tv

I am developing an Android app that can play videos. While using VideoView to play videos, I encountered a bug where part of the navigation using DrawerLayout is not visible but clickable after the video is paused. The navigation works fine until the video is paused. Is there a solution?

Below is the code snippet I’m currently working on.

Activity part


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_play_list);

        navWrap = findViewById(R.id.nav_wrap);

        initNavigation();
        initVideoView();
        initEvent();

        playButton = findViewById(R.id.play_btn);
    }

    public void initNavigation(){
        drawerLayout = findViewById(R.id.drawer_layout);
        navigationView = findViewById(R.id.nav_view);

        if (!drawerLayout.isDrawerOpen(Gravity.LEFT)) {
            drawerLayout.openDrawer(Gravity.LEFT) ;
        }
    }

    public void initVideoView(){
        videoView = findViewById(R.id.video_view);
        videoView.setVideoPath("url");

        videoView.setOnPreparedListener(mp -> {
            mp.setLooping(true);
            mp.setVolume(0, 0);
            mp.start();
        });
    }

    public void initEvent(){
        playButtonWrap = findViewById(R.id.play_btn_layout);
        playButtonWrap.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (videoView.isPlaying()) {
                    stopVideo();
                } else {
                    startVideo();
                }
            }
        });
    }

    public void startVideo(){
        //video start
        videoView.start();
        //btn image change
        changeBtn(true);
    }
    public void stopVideo(){
        //video stop
        videoView.pause();
        //btn image change
        changeBtn(false);
    }

    private void changeBtn(boolean isPlaying){
        playButton.setVisibility(View.VISIBLE);
        navWrap.setVisibility(View.VISIBLE);
        playButton.setImageDrawable(isPlaying ? getResources().getDrawable(R.drawable.start) : getResources().getDrawable(R.drawable.pause));
        fadeOutAndHideImage(playButton);
    }

layout part

<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout 
    android:layout_height="match_parent"
    android:layout_width="match_parent">
    <androidx.constraintlayout.widget.ConstraintLayout 
        android:id="@+id/main"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".UI.PlayListActivity"
        android:background="@color/background_grey"
        >
        <VideoView
            android:id="@+id/video_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            />
        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/play_btn_layout"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            android:clickable="true"
            >
            <ImageView
                android:id="@+id/play_btn"
                android:layout_width="250px"
                android:layout_height="250px"
                android:background="@drawable/play_btn_background"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintBottom_toBottomOf="parent"
                android:src="@drawable/start"
                android:scaleType="center"
                android:scaleY=".8"
                android:scaleX=".8"
                android:visibility="invisible"
                android:clickable="true"
                />
        </androidx.constraintlayout.widget.ConstraintLayout>
        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_constraintBottom_toBottomOf="parent"
            android:background="@color/thumb_background_black"
            android:paddingTop="@dimen/thumbnail_wrap_padding"
            android:paddingBottom="@dimen/thumbnail_wrap_padding"
            >
            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/thumbnail_recycler_view"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                android:layout_marginStart="120px"
                android:layout_marginEnd="120px"
                />

            <ImageButton
                android:id="@+id/playlist_prev_btn"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="@color/zxing_transparent"
                android:src="@drawable/prev"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toStartOf="@+id/thumbnail_recycler_view"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />
            <ImageButton
                android:id="@+id/playlist_next_btn"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                app:layout_constraintTop_toTopOf="parent"
                app:layout_constraintStart_toEndOf="@+id/thumbnail_recycler_view"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintBottom_toBottomOf="parent"
                android:src="@drawable/next"
                android:background="@color/zxing_transparent"
                />
        </androidx.constraintlayout.widget.ConstraintLayout>
    </androidx.constraintlayout.widget.ConstraintLayout>
    <include layout="@layout/nav_view"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"/>
</androidx.drawerlayout.widget.DrawerLayout>

picture when normal
enter image description here

picture when bug
enter image description here

tv uses android api 25

how can i fix it? do you have any idea?

New contributor

김종혁 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật