Видимая и невидимая анимация не плавная - PullRequest
0 голосов
/ 27 августа 2018

Под панелью действий есть текст для редактирования. Я хочу сделать его видимым и невидимым на свитке переработчика. Проблема в том, что когда он становится видимым и невидимым, требуется некоторое время, чтобы настроить макет под ним, и на данный момент он показывает цвет фона. Так как же переместить вид снизу в нужное место вместе с анимацией?

Ниже мой код

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/root_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:focusable="true"
android:animateLayoutChanges="true"

    android:focusableInTouchMode="true"
    android:background="@color/app_background_color"
    android:fitsSystemWindows="true">

    <RelativeLayout
        android:id="@+id/ll_toolbar"
android:clipChildren="true"
        android:clipToPadding="true"
        android:layout_width="match_parent"
        android:layout_height="@dimen/toolbar_height"
        android:layout_alignParentTop="true"
        android:background="@color/toolbar_color">

        <ImageView
            android:id="@+id/iv_logo"
            android:layout_width="100dp"
            android:layout_height="30dp"
            android:layout_centerInParent="true"
            android:layout_gravity="center_horizontal"
            android:contentDescription="@string/app_name"
            app:srcCompat="@drawable/my_l" />

        <LinearLayout
            android:layout_width="@dimen/date_time_view_width"
            android:layout_height="match_parent"
            android:layout_alignParentEnd="true"
            android:background="@color/toolbar_color"
            android:gravity="center_horizontal"
            android:orientation="vertical">

            <TextView
                android:id="@+id/tv_date"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textColor="@color/white_color"
                android:textSize="@dimen/date_text_size" />

            <TextView
                android:id="@+id/tv_time"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textColor="@color/white_color"
                android:textSize="@dimen/time_text_size" />
        </LinearLayout>
    </RelativeLayout>

    <LinearLayout
        android:id="@+id/ll_search_bar"
        android:layout_width="match_parent"
        android:layout_height="@dimen/toolbar_height"
        android:layout_below="@id/ll_toolbar"
        android:layout_gravity="center"
        android:background="@color/toolbar_color"
        android:gravity="center"
        android:orientation="horizontal"
        android:visibility="gone">

        <EditText
            android:id="@+id/"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="@dimen/drawable_text_padding"
            android:background="@drawable/search_bar_background"
            android:drawablePadding="@dimen/drawable_text_padding"
            android:drawableStart="@drawable/search"
            android:ellipsize="end"
            android:gravity="start|center"
            android:hint="@string/search_hint"
            android:imeOptions="actionDone"
            android:inputType="text"
            android:lines="1"
            android:padding="@dimen/drawable_text_padding"
            android:textColor="@color/white_color"
            android:textColorHint="@color/search_text_color"
            android:textSize="@dimen/toolbar_text_size" />

    </LinearLayout>

    <TextView
        android:id="@+id/tv_header"
        android:layout_width="match_parent"
        android:layout_height="@dimen/toolbar_height"
        android:layout_below="@id/ll_search_bar"
        android:background="@color/header_background_color"
        android:gravity="center"
        android:textColor="@color/white_color"
        android:textSize="@dimen/toolbar_text_size"
        android:textStyle="bold" />

    <!-- As the main content view, the view below consumes the entire
         space available using match_parent in both dimensions. -->
    <FrameLayout
        android:id="@+id/container"
        android:layout_width="match_parent"

        android:layout_height="match_parent"
        android:layout_above="@+id/bottom_navigation"
        android:layout_below="@id/tv_header" />

    <android.support.design.widget.BottomNavigationView
        android:id="@+id/bottom_navigation"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        app:itemBackground="@color/secondary_color"
        app:itemIconTint="@drawable/bottom_bar_color_selector"
        app:itemTextColor="@drawable/bottom_bar_color_selector"
        app:menu="@menu/bottom_navigation_main" />

</RelativeLayout>

Я использовал это свойство

андроида: animateLayoutChanges = "истинный"

Я пробовал пару масштабных анимаций, но они не дают желаемого результата. Я хочу спрятаться

@ + идентификатор / ll_toolbar

Поэтому, когда он пытается сделать view.hide, он на мгновение отображает цвет фона родителя ll_toolbar, а затем под ним настраивается раскладка под ним. Как сделать это целиком за один раз? Спасибо

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...