car/src/main/java/androidx/car/app/CarListDialog.java
private void initializeTitleElevationListener() {
        if (mTitleView.getVisibility() == View.GONE) {
            return;
        }

        mList.setOnScrollListener(new PagedListView.OnScrollListener() {
            @Override
            public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
                super.onScrolled(recyclerView, dx, dy);

                // The PagedListView is a vertically scrolling list, so it will be using a
                // LinearLayoutManager.
                LinearLayoutManager layoutManager =
                        (LinearLayoutManager) recyclerView.getLayoutManager();

                if (layoutManager.findFirstCompletelyVisibleItemPosition() == 0) {
                    // Need to remove elevation with animation so it is not jarring.
                    removeTitleElevationWithAnimation();
                } else {
                    // Note that elevation can be added without any elevation because the list
                    // scroll will hide the fact that it pops in.
                    mTitleView.setElevation(mTitleElevation);
                }
            }
        });
    }
/**
     * Initializes a listener on the scrolling of the list in this dialog that will update
     * the elevation of the title text.
     *
     * <p>If the list is not at the top position, there will be elevation. Otherwise, the
     * elevation is zero.
     */
Initializes a listener on the scrolling of the list in this dialog that will update
the elevation of the title text.

If the list is not at the top position, there will be elevation. Otherwise, the
elevation is zero.
Initializes a listener on the scrolling of the list in this dialog that will update the elevation of the title text . If the list is not at the top position there will be elevation . Otherwise the elevation is zero .
private void initializeTitleElevationListener() {
        if (mTitleView.getVisibility() == View.GONE) {
            return;
        }
        mList.setOnScrollListener(new PagedListView.OnScrollListener() {
            @Override
            public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
                super.onScrolled(recyclerView, dx, dy);
                LinearLayoutManager layoutManager =
                        (LinearLayoutManager) recyclerView.getLayoutManager();
                if (layoutManager.findFirstCompletelyVisibleItemPosition() == 0) {
                    removeTitleElevationWithAnimation();
                } else {
                    mTitleView.setElevation(mTitleElevation);
                }
            }
        });
    }
private void initializeTitleElevationListener ( ) { if ( mTitleView . getVisibility ( ) == View . GONE ) { return ; } mList . setOnScrollListener ( new PagedListView . OnScrollListener ( ) { @ Override public void onScrolled ( RecyclerView recyclerView , int dx , int dy ) { super . onScrolled ( recyclerView , dx , dy ) ; LinearLayoutManager layoutManager = ( LinearLayoutManager ) recyclerView . getLayoutManager ( ) ; if ( layoutManager . findFirstCompletelyVisibleItemPosition ( ) == 0 ) { removeTitleElevationWithAnimation ( ) ; } else { mTitleView . setElevation ( mTitleElevation ) ; } } } ) ; }
Initializes a listener on the scrolling of the list in this dialog that will update
 the elevation of the title text.
Initializes a listener on the scrolling of the list in this dialog that will update the elevation of the title text .
// The PagedListView is a vertically scrolling list, so it will be using a // LinearLayoutManager. // Need to remove elevation with animation so it is not jarring. // Note that elevation can be added without any elevation because the list // scroll will hide the fact that it pops in.