recyclerview 上的滚动条边距(不是 recyclerview)

Margin to the scrollbar only (not to recyclerview) on recyclerview

我的回收站视图位于工具栏下方,如第一张图片所示。但是,我在它的右侧有一个滚动条。我必须给这个滚动条一个 margin-top。我尝试过赋予风格。而且我知道带有 padding-top 和 padding-bottom 的 clip padding,但是,我确实需要这个。有什么办法让它成为现实吗?

This is my problem

The result that I want

P.S。我知道这不是最佳做法。我将不胜感激任何帮助。这是我的第一个问题之一,不要判断我这么强。 :)

我的主要 XML 文件

<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:background="?attr/background1"
android:keepScreenOn="true"
tools:context=".ui.main.HomeActivity">

<androidx.viewpager.widget.ViewPager
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/pager" />

<include layout="@layout/toolbar_sura_detail" />

<include layout="@layout/player" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

我的片段 XML 在 ViewPager

<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="?attr/background1">

<androidx.recyclerview.widget.RecyclerView
    android:id="@+id/kuranDetailList"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:isScrollContainer="false"
    android:fitsSystemWindows="true"
    android:scrollbarSize="2dp"
    android:scrollbarThumbVertical="@drawable/thumbforrecycle"
    android:scrollbars="vertical"
    android:orientation="vertical" />

</androidx.coordinatorlayout.widget.CoordinatorLayout>

尝试在您的主要 XML 中使用此结构并为 ViewPager 添加滚动布局行为

<androidx.coordinatorlayout.widget.CoordinatorLayout...
<com.google.android.material.appbar.AppBarLayout...
   <androidx.appcompat.widget.Toolbar...

</com.google.android.material.appbar.AppBarLayout>
<androidx.viewpager.widget.ViewPager
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:id="@+id/pager"
  app:layout_behavior = "com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"/>