Search code examples
androidvuforiadrawerlayout

Toolbar disappears when using Vuforia versions below 4.4


I am using the SDK Vuforia and testing on devices with version 4.4 below the toolbar disappears, the menu buttons are there but invisible where would be the correct buttons are visible. The drawerlayout button with recyclerview I use the side menu does not work in version below 4.4, and its icon disappears. With much effort can swipe to activate the side menu. Above this version of the menu functions and buttons are displayed. The following images and correct the problem and xml layouts.

enter image description here

enter image description here

camera_overlay.xml

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="match_parent">

<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:layout_centerInParent="true">

    <ImageView
        android:id="@+id/ivLoading"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@anim/loading"/>

    <TextView
        android:id="@+id/tvLoading"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/loading"
        android:textSize="23sp"
        android:textStyle="bold"
        android:textColor="@color/primary_dark"
        android:gravity="center_horizontal"
        android:layout_marginTop="43dp" />

</LinearLayout>

</RelativeLayout>

toolbar.xml

<?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.Toolbar
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/toolbar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:minHeight="?attr/actionBarSize"
    android:background="?attr/colorPrimary"
    android:fitsSystemWindows="true"
    android:elevation="4dp"
    app:theme="@style/CustomActionBar"/>

main_activity.xml

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/DrawerLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    android:elevation="7dp">

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

        <include
            android:id="@+id/toolbar"
            layout="@layout/toolbar">
        </include>

        <FrameLayout
            android:id="@+id/fragContainer"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:tag="fragContainer" />

    </LinearLayout>

    <RelativeLayout
        android:layout_width="320dp"
        android:layout_height="match_parent"
        android:layout_gravity="start">

        <android.support.v7.widget.RecyclerView
            android:id="@+id/RecyclerView"
            android:layout_width="320dp"
            android:layout_height="fill_parent"
            android:layout_gravity="left"
            android:fitsSystemWindows="true"
            android:background="@color/primary"
            android:scrollbars="vertical">

        </android.support.v7.widget.RecyclerView>

        <LinearLayout
            android:id="@+id/footer_menu"
            android:layout_width="320dp"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:orientation="horizontal" >

            <ImageView
                android:id="@+id/ivFooter"
                android:layout_width="wrap_content"
                android:layout_height="35dp"
                android:layout_gravity="bottom|center"
                android:layout_margin="5dp"/>

        </LinearLayout>

    </RelativeLayout>

</android.support.v4.widget.DrawerLayout>

Edited 10/16/2015

I made a call on Vuforia forum to see if someone there could help me ... Inclusive has a test project to facilitate the location of the problem.


Solution

  • As this link, the solution was found. The problem was organize the objects on the screen. With this following code could play the elements that disappeared in front of the preview camera.