Android layout MotionLayout作为主播的ViewPager未检测到OnSwipe

Android layout MotionLayout作为主播的ViewPager未检测到OnSwipe,android-layout,android-viewpager,android-animation,android-viewpager2,android-motionlayout,Android Layout,Android Viewpager,Android Animation,Android Viewpager2,Android Motionlayout,我的父视图是一个运动布局。在它里面我有一个有两页的ViewPager。每个页面都有一个垂直回收器视图 我想要的效果是一个textView,它是这个运动布局的子元素,可以在页面滑动时改变它的颜色(并且做得很顺利) 问题:刷卡时不会发生任何情况。只是一次常规的浏览页面滑动 以下是我的过渡: <Transition app:constraintSetEnd="@id/end" app:constraintSetStart="@id/start

我的父视图是一个运动布局。在它里面我有一个有两页的ViewPager。每个页面都有一个垂直回收器视图

我想要的效果是一个textView,它是这个运动布局的子元素,可以在页面滑动时改变它的颜色(并且做得很顺利)

问题:刷卡时不会发生任何情况。只是一次常规的浏览页面滑动

以下是我的过渡:

    <Transition
    app:constraintSetEnd="@id/end"
    app:constraintSetStart="@id/start">
    <OnSwipe
        app:dragDirection="dragLeft"
        app:touchAnchorSide="right"
        app:touchAnchorId="@id/news_viewPager"/>
    </Transition>

请共享布局的xml。另外,尝试添加一个布局,该布局包含作为子级的视图寻呼机和父布局上的touchAnchorId。
<?xml version="1.0" encoding="utf-8"?>
<MotionScene xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">

<ConstraintSet android:id="@+id/start">
    <Constraint android:id="@id/new_videos_title">
        <CustomAttribute
            app:attributeName="textColor"
            app:customColorValue="@color/navBarOn" />
    </Constraint>

    <Constraint android:id="@id/news_viewPager" />

    <Constraint android:id="@id/new_articles_title">
        <CustomAttribute
            app:attributeName="textColor"
            app:customColorValue="@color/navBarOff" />
    </Constraint>
</ConstraintSet>

<ConstraintSet android:id="@+id/end">
    <Constraint android:id="@id/news_viewPager" />

    <Constraint android:id="@id/new_videos_title">
        <CustomAttribute
            app:attributeName="textColor"
            app:customColorValue="@color/navBarOff" />
    </Constraint>

    <Constraint android:id="@id/new_articles_title">
        <CustomAttribute
            app:attributeName="textColor"
            app:customColorValue="@color/navBarOn" />
    </Constraint>
</ConstraintSet>

<Transition
    app:constraintSetEnd="@id/end"
    app:constraintSetStart="@id/start">
    <OnSwipe
        app:dragDirection="dragLeft"
        app:touchAnchorSide="right"
        app:touchAnchorId="@id/news_viewPager"/>
</Transition>