Проблема строки состояния приложения с телефоном Essential PH-1, Android P (9) - PullRequest
0 голосов
/ 19 декабря 2018

Надеюсь, что кто-то еще столкнулся с этим - навигация / строка состояния приложения в нижней части нашего приложения отключается на телефоне Essential PH-1 с Android Pie.Я не думаю, что проблема связана с Android Pie, так как я не мог воспроизвести в эмуляторе для Pixel 2 с Pie, но может быть вариант, если он связан с Notch.

Вот приложение иякобы отсутствует область в кружке:

enter image description here

У меня нет действительного снимка экрана, так что я подозреваю, что при чтении различных блогови такие темы, как этот:

https://forum.xda -developers.com / essential-phone / help / part-cut-off-off-games-apps-t3678775

Это, кажется, довольно распространенная проблема с телефонами Essential.Из этого поста Essential Reddit они, похоже, предполагают, что это приложение связано с тем, как «API был реализован»:

https://www.reddit.com/r/essential/comments/7amvxr/app_compatibility_with_camera_cutout_in_essential/

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

Вот макет приложения в его нынешнем виде.Существует линейная компоновка, которая имеет высоту, но ее следует скрывать большую часть времени, поскольку она предназначена для автономного режима, что может быть проблемой, но не той, которую указал клиент.Таким образом, отсутствующий раздел будет LinearLayout bottomBarLayout:

<RelativeLayout
android:id="@+id/mainLyt"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">

<ScrollView 
    android:id="@+id/formScrollView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_alignParentTop="true"
    android:layout_above="@+id/bottomBarLayout">

    <LinearLayout
        android:id="@+id/formLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingLeft="10dp"
        android:paddingTop="15dp"
        android:paddingRight="10dp"
        android:paddingBottom="15dp"
        android:orientation="vertical" >
    </LinearLayout>

</ScrollView>


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/bottomBarLayout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:orientation="vertical">

    <RelativeLayout
        android:id="@+id/bottomBar"
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:orientation="horizontal"
        android:background="@color/navigation_bar">

        <ImageButton
            android:id="@+id/btnPrev"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:onClick="btnPrevClicked"
            android:layout_alignParentLeft="true"
            android:focusableInTouchMode="false"
            android:background="?android:attr/selectableItemBackground"
            android:src="@drawable/toolbar_prev"
            android:padding ="8dp"
            />

        <ImageButton
            android:id="@+id/btnIndex"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toRightOf="@+id/btnPrev"
            android:onClick="btnIndexClicked"
            android:focusableInTouchMode="false"
            android:background="?android:attr/selectableItemBackground"
            android:src="@drawable/toolbar_index"
            android:padding ="8dp"
            />

        <ImageButton
            android:id="@+id/btnValidation"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toRightOf="@+id/btnIndex"
            android:onClick="btnValidationClicked"
            android:focusableInTouchMode="false"
            android:background="?android:attr/selectableItemBackground"
            android:src="@drawable/toolbar_validate"
            android:padding ="8dp"
            />

        <ImageButton
            android:id="@+id/btnComments"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toRightOf="@+id/btnValidation"
            android:onClick="btnCommentsClicked"
            android:focusableInTouchMode="false"
            android:background="?android:attr/selectableItemBackground"
            android:src="@drawable/toolbar_comments"
            android:padding ="8dp"
            />

        <ImageButton
            android:id="@+id/btnDebug"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toRightOf="@+id/btnComments"
            android:onClick="btnDebugClicked"
            android:focusableInTouchMode="false"
            android:background="?android:attr/selectableItemBackground"
            android:src="@drawable/toolbar_debug"
            android:padding ="8dp"
            />

        <TextView
            android:id="@+id/pagename"
            android:layout_toRightOf="@+id/btnDebug"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:focusableInTouchMode="false"
            android:layout_centerVertical="true"
            android:text="PAGE"
            android:textStyle="bold"
            android:textColor="@android:color/white"
            android:padding ="8dp"
            />

        <ImageButton
            android:id="@+id/btnNext"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:onClick="btnNextClicked"
            android:focusableInTouchMode="false"
            android:background="?android:attr/selectableItemBackground"
            android:src="@drawable/toolbar_next"
            android:padding ="8dp"
            />

    </RelativeLayout>

    <RelativeLayout
        android:id="@+id/bottomOffline"
        android:layout_width="match_parent"
        android:layout_height="34dp"
        android:background="@android:color/holo_orange_light"
        android:gravity="center_horizontal">

        <TextView
            android:id="@+id/offline"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:focusableInTouchMode="false"
            android:text="OFFLINE MODE"
            android:textStyle="bold"
            android:textColor="@android:color/white"
            android:padding ="8dp"
            />
    </RelativeLayout>
</LinearLayout>

Спасибо!

ОБНОВЛЕНИЕ

ТакЯ наконец получил несколько снимков экрана от клиента и немного больше информации.Так что это определенно строка состояния в нижней части экрана, которая все еще не отображается (даже если она отображается в автономном режиме):

enter image description here

Даже странно, что это работает/ показывает, когда они перемещаются в альбомную ориентацию:

enter image description here

Не уверен, что это соотношение сторон или что-то еще.Я удалил все жестко закодированные значения, но это все еще сохраняется.Кто-нибудь знает способ эмуляции этого с помощью эмулятора Android Studio?

Вот последний XML, который, по словам клиента, все еще не работает:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/mainLyt"
android:layout_width="match_parent"
android:layout_height="match_parent">

<ScrollView
    android:id="@+id/formScrollView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_above="@+id/bottomBarLayout"
    android:layout_alignParentTop="true">

    <LinearLayout
        android:id="@+id/formLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:paddingLeft="10dp"
        android:paddingTop="15dp"
        android:paddingRight="10dp"
        android:paddingBottom="15dp"></LinearLayout>

</ScrollView>


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/bottomBarLayout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:orientation="vertical">

    <RelativeLayout
        android:id="@+id/bottomBar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/navigation_bar"
        android:orientation="horizontal">

        <ImageButton
            android:id="@+id/btnPrev"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:background="?android:attr/selectableItemBackground"
            android:focusableInTouchMode="false"
            android:onClick="btnPrevClicked"
            android:padding="8dp"
            android:src="@drawable/toolbar_prev" />

        <ImageButton
            android:id="@+id/btnIndex"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toRightOf="@+id/btnPrev"
            android:background="?android:attr/selectableItemBackground"
            android:focusableInTouchMode="false"
            android:onClick="btnIndexClicked"
            android:padding="8dp"
            android:src="@drawable/toolbar_index" />

        <ImageButton
            android:id="@+id/btnValidation"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toRightOf="@+id/btnIndex"
            android:background="?android:attr/selectableItemBackground"
            android:focusableInTouchMode="false"
            android:onClick="btnValidationClicked"
            android:padding="8dp"
            android:src="@drawable/toolbar_validate" />

        <ImageButton
            android:id="@+id/btnComments"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toRightOf="@+id/btnValidation"
            android:background="?android:attr/selectableItemBackground"
            android:focusableInTouchMode="false"
            android:onClick="btnCommentsClicked"
            android:padding="8dp"
            android:src="@drawable/toolbar_comments" />

        <ImageButton
            android:id="@+id/btnDebug"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toRightOf="@+id/btnComments"
            android:background="?android:attr/selectableItemBackground"
            android:focusableInTouchMode="false"
            android:onClick="btnDebugClicked"
            android:padding="8dp"
            android:src="@drawable/toolbar_debug" />

        <TextView
            android:id="@+id/pagename"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:layout_toRightOf="@+id/btnDebug"
            android:focusableInTouchMode="false"
            android:padding="8dp"
            android:text="PAGE"
            android:textColor="@android:color/white"
            android:textStyle="bold" />

        <ImageButton
            android:id="@+id/btnNext"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:background="?android:attr/selectableItemBackground"
            android:focusableInTouchMode="false"
            android:onClick="btnNextClicked"
            android:padding="8dp"
            android:src="@drawable/toolbar_next" />

    </RelativeLayout>

    <RelativeLayout
        android:id="@+id/bottomOffline"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/bottomBarLayout"
        android:background="@android:color/holo_orange_light"
        android:gravity="center_horizontal">

        <TextView
            android:id="@+id/offline"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:focusableInTouchMode="false"
            android:padding="8dp"
            android:text="OFFLINE MODE"
            android:textColor="@android:color/white"
            android:textStyle="bold" />
    </RelativeLayout>
</LinearLayout>

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