Android: TabLayout UI Мерцание / мигание - PullRequest
0 голосов
/ 25 апреля 2019

У меня есть TabLayout с меню и экраном чата. Ранее TabLayout был выровнен по верху экрана.Я просто изменяю макет вкладки на нижний,

После того, как TabLayout меняется на нижний, когда появляется экран чата (экран редактирования редактирует текст в нижнем положении) Интерфейс пользователя мигает

Теперь в текстовом редакторе чата отображается чуть выше TabLayout , я не знаю, связано ли это с проблемой фокуса

есть ли какая-то причина мерцания пользовательского интерфейса?

Макет

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
tools:ignore="MissingPrefix">

<android.support.design.widget.AppBarLayout
    android:id="@+id/app_bar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:background="@color/white"
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
    app:elevation="0dp">

    <android.support.v7.widget.Toolbar
        android:id="@+id/tb_toolbar_main_activity"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="@android:color/transparent"
        app:layout_scrollFlags="enterAlways"
        app:popupTheme="@style/ThemeOverlay.AppCompat.Light">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center_vertical"
            android:orientation="horizontal">

            <TextView
                android:id="@+id/tb_heading"
                fontPath="@string/font_bebas_neue_bold"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginEnd="15dp"
                android:layout_marginRight="15dp"
                android:text="@string/app_name_caps"
                android:textAlignment="center"
                android:textColor="@color/heading_color"
                android:textSize="@dimen/toolbar_title_text" />

        </LinearLayout>
    </android.support.v7.widget.Toolbar>


</android.support.design.widget.AppBarLayout>


<android.support.design.widget.TabLayout
    android:id="@+id/tabs"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    app:tabBackground="@drawable/tab_back_selected"
    app:tabIndicatorHeight="0dp"
    app:tabMode="fixed"
    app:tabGravity="fill"
    app:tabSelectedTextColor="@android:color/white"
    app:tabTextAppearance="@style/MyTabLayoutTextAppearance"
    app:tabTextColor="@color/home_sub_text" />

<android.support.v4.view.ViewPager
    android:id="@+id/vp_activity_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    android:layout_below="@id/app_bar"
    android:layout_above="@id/tabs"/>

</RelativeLayout>
...