简体   繁体   English

MotionLayout onSwipe 自动完成速度

[英]MotionLayout onSwipe autocomplete speed

Is there any way I can speed up the animation that plays when I stop mid-swipe in a MotionLayout with an onSwipe transition?当我在带有onSwipe过渡的MotionLayout停止中间滑动时,有什么方法可以加速播放的动画? Currently it transitions very slowly to the start or end position.目前它非常缓慢地过渡到开始或结束位置。

I was wondering if there's such thing as autoComplete duration too.我想知道是否也有 autoComplete 持续时间之类的东西。 After some research I've found out that using app:maxAcceleration parameter on onSwipe helps to gain the control over this duration.经过一番研究,我发现,使用app:maxAcceleration在参数onSwipe有助于获得对这一持续时间的控制。

eg例如

<OnSwipe
        app:maxAcceleration="40"
        app:dragDirection="dragUp"
        app:touchAnchorId="@+id/view_one"
        app:touchAnchorSide="top"
        app:touchRegionId="@id/view_one"/>

Can You explain more detailed what You want to do?你能更详细地解释一下你想做什么吗?

You can set the duration of Your transistion in Your XML File...if that was a part of Your question.您可以在您的 XML 文件中设置您的转换的持续时间...如果这是您问题的一部分。

 <Transition
    app:constraintSetStart="@+id/start"
    app:constraintSetEnd="@+id/end"
    app:duration="340">
</Transition>

GGK GGK

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 MotionLayout - OnSwipe 不适用于可点击的孩子 - MotionLayout - OnSwipe not working on clickable children 在 RecyclerView 的项目上使用 MotionLayout OnSwipe - Using MotionLayout OnSwipe on Item of a RecyclerView MotionLayout - OnSwipe 不适用于 ViewPager2/RecyclerView - MotionLayout - OnSwipe not working with ViewPager2/RecyclerView Android Kotlin onClickListener 似乎隐藏了 MotionLayout 的 OnSwipe - Android Kotlin onClickListener seems to hide OnSwipe of MotionLayout MotionLayout OnSwipe 转换被错误的锚点触发 - MotionLayout OnSwipe transition gets triggered by wrong anchor 我们可以同时使用OnSwipe和OnClick吗 <Transition> 适用于Android MotionLayout? - Can we use OnSwipe and OnClick in the same <Transition> for Android MotionLayout? 当触摸区域包含 RecyclerView 时,Android MotionLayout OnSwipe 不起作用 - Android MotionLayout OnSwipe not working when touch region contains a RecyclerView MotionLayout OnSwipe spring 物理在 transitionToStart/End() 后停止工作 - MotionLayout OnSwipe spring physics stop working after transitionToStart/End() OnSwipe dragUp 不适用于 MotionLayout 中带有孩子的 View - OnSwipe dragUp doesn't work on View with child in MotionLayout 如何设置多个OnSwipe Add Android MotionLayout Single Transition? - How to set multiple OnSwipe Add Android MotionLayout Single Transition?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM