Search code examples
javaandroidandroid-layoutwear-osandroid-wear-2.0

Android Wear: Layout is not displaying properly in Emulator


I'm developing an Android smart watch application. The initial screen appears fine. But, when I go to next screen, the upper part pops up with the name of project something like this. In the below image, Watch is the name of the project.

enter image description here

I want to see the entire screen instead of white space which contains project's name. Does anyone know how to solve it and why is it appearing?

My XML file is

<?xml version="1.0" encoding="utf-8"?>
<android.support.wear.widget.BoxInsetLayout 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"
    android:orientation="vertical"
    tools:deviceIds="wear">

    <LinearLayout
        android:id="@+id/mainContainer"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:background="@color/black"
        android:weightSum="1"
        tools:ignore="UselessParent"
        android:layout_alignParentTop="true"
        android:layout_alignParentStart="true">

        <LinearLayout
            android:id="@+id/sign_up_top_bar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:orientation="horizontal"
            android:layout_marginTop="15dp">

            <TextView
                android:id="@+id/textview"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:padding="5dp"
                android:textAlignment="center"
                android:textSize="18sp"
                android:text="@string/text"
                android:background="@color/black"
                android:textColor="@color/white"
                android:fontFamily="Century-Gothic.ttf" />

            <ImageView
                android:id="@+id/imageView1"
                android:layout_width="18dp"
                android:layout_height="19dp"
                android:layout_toRightOf="@+id/text"
                android:src="@drawable/fingerprint" />

        </LinearLayout>

        <Button
            android:layout_marginTop="10dp"
            android:id="@+id/button"
            android:background ="@drawable/roundedbutton"
            android:text="@string/button_text"
            android:layout_width="108dp"
            android:textAlignment="center"
            android:drawablePadding="20dp"
            android:layout_gravity="center"
            android:textColor="@color/white"
            android:layout_height="75dp"
            android:layout_weight="0.34" />


    </LinearLayout>

    </android.support.wear.widget.BoxInsetLayout>

Solution

  • The answer to the question was simple. I figured out after one day. I changed my theme from Theme.AppCompat.Light to Theme.AppCompat.Light.NoActionBar in Manifest file. The program name bar disappeared.