小编P1N*_*WIN的帖子

接口中不允许使用属性初始值设定项

我的 Java 项目有一个带有给定值的 ItemType 接口,该接口由某些类实现。如何在 Kotlin 上实现这个接口?

public interface ItemType {

int TYPE_OPTION = 2;
int TYPE_GRID = 3;
int TYPE_CAROUSEL = 4;
int TYPE_MUSIC = 5;
int TYPE_GUESS = 6;

int getItemType();

}
Run Code Online (Sandbox Code Playgroud)

interface kotlin

8
推荐指数
1
解决办法
2327
查看次数

FFmpeg为请求添加代理

FFmpeg 是否支持向请求添加代理的功能?在网上,我发现有 -http_proxy 选项,但是当我尝试通过ffmpeg -http_proxy=http://ip:port/在终端中输入来使用它时,收到了 Option not find 错误

ffmpeg

5
推荐指数
1
解决办法
1万
查看次数

MotionLayout没有动画

我正在尝试通过 MotionLayout 创建折叠视图动画。我想让视图在向下滚动时折叠,直到完全向上滚动时才会出现。我的动画现在不起作用(视频)。另外,我的回收站视图在第一次单击之前才可见。我究竟做错了什么?感谢

主要活动布局:

<androidx.constraintlayout.motion.widget.MotionLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_more_white"

app:layoutDescription="@xml/collapsing_toolbar"
tools:showPaths="true">

<include
    android:id="@+id/include"
    layout="@layout/toolbar"
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent" />

<com.github.florent37.shapeofview.shapes.ArcView
    android:id="@+id/header_view"
    android:layout_width="0dp"
    android:layout_height="100dp"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toBottomOf="@id/include"
    app:shape_arc_cropDirection="outside"
    app:shape_arc_height="20dp"
    app:shape_arc_position="bottom">

    <View
        android:id="@+id/header"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/colorPrimaryDark" />

</com.github.florent37.shapeofview.shapes.ArcView>

<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
    android:id="@+id/swipe_view"
    android:layout_width="0dp"
    android:layout_height="0dp"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toBottomOf="@id/include">

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/recyclerView"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

</androidx.constraintlayout.motion.widget.MotionLayout>
Run Code Online (Sandbox Code Playgroud)

运动场景:

<MotionScene
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:motion="http://schemas.android.com/apk/res-auto">

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

    <OnSwipe
        app:touchAnchorId="@id/swipe_view"
        app:dragDirection="dragDown"
        app:touchAnchorSide="top"
        app:moveWhenScrollAtTop="true"/>
</Transition>

<ConstraintSet android:id="@+id/start">
    <Constraint
        android:id="@id/header_view"
        android:layout_width="0dp"
        android:layout_height="100dp"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent" …
Run Code Online (Sandbox Code Playgroud)

android android-animation android-motionlayout

2
推荐指数
1
解决办法
4046
查看次数

AndroidX中的MotionLayout不存在

Android Studio无法在xml中找到MotionLayout。我使用androidx.constraintlayout.motion.widget.MotionLayout标签,并显示灰屏。我也在实现'com.android.support.constraint:constraint-layout:2.0.0-alpha4',更改为alpha02不会改变任何内容。我已经找到了一个有同样问题的问题,但是它也没有解决方案。

sdk android android-motionlayout

1
推荐指数
1
解决办法
740
查看次数