在动画期间显示键盘时,使Android动画更流畅

Geo*_*org 5 performance animation android android-animation android-linearlayout

我有如下的LinearLayout:

<LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:animateLayoutChanges="true"
        android:animationCache="true"
        android:orientation="vertical">

    <LinearLayout
            android:id="@+id/view_one"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">
     ...
    </LinearLayout>

    <LinearLayout
            android:id="@+id/view_two"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">
     ...
    </LinearLayout>
     ...
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

在view_one和view_two中都是一个EditTexts,只要其中一个变为活动状态,我想隐藏其他view_xxx.我通过将VISIBILITY标志设置为GONE或VISIBLE来实现.

由于LinearLayoutandroid:animateLayoutChanges设置为true,整个事情是动画.如果我触发整个事情不是激活键盘而是另一个没有调出键盘的按钮它运行得相当顺畅.

但是一旦键盘也被显示(不幸的是同时),整个动画变得迟到......

有没有人知道如何使动画仍然流畅?我已经尝试了animationCache周围的LinearLayout,但它没有改变一件事......

很感谢任何形式的帮助!