1

There is text in navigation view. The text in bottom navifation view is the value of textview with id="audioUtils". The textview is required to represent value in detailed_information.xml file in layout folder. What could be wrong wih code?

Code in detailed_information.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <TextView
        android:id="@+id/audioUtils"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/audiotechnicaltext"
        android:textSize="18sp"
        android:textColor="@android:color/black" />

</LinearLayout>

Code in navigation_toggle.xml

<?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:context=".MainActivity">
    <com.google.android.material.bottomnavigation.BottomNavigationView
        android:id="@+id/bottom_navigation"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        app:menu="@menu/menu" />
</RelativeLayout>

Code in menu.xml file

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:id="@+id/navigation_detailed"
        android:icon="@drawable/developer_mode_24px"
        android:actionLayout="@layout/detailed_information"
        android:title="@string/nerd_mode" />
    <item
        android:id="@+id/navigation_default"
        android:icon="@drawable/mode_standby_24px"
        android:actionLayout="@layout/watch_status"
        android:title="@string/watch_status" />
    <item
        android:id="@+id/navigation_graphical"
        android:icon="@drawable/for_you_24px"
        android:actionLayout="@layout/graphical_information"
        android:title="@string/graphical_mode" />
</menu>

Code in nav_graph.xml

<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/nav_graph"
    app:startDestination="@id/navigation_default"
    app:route="root">
    <fragment
        android:id="@+id/navigation_detailed"
        android:name="com.project.wasp.fragment.DetailedInfoFragment"
        android:label="DetailedInformation"
        android:layout="@layout/detailed_information"/>

    <fragment
        android:id="@+id/navigation_default"
        android:name="com.project.wasp.fragment.WatchStatusFragment"
        android:label="WatchStatusFragment"
        android:layout="@layout/watch_status"/>

    <fragment
        android:id="@+id/navigation_graphical"
        android:name="com.project.wasp.fragment.GraphicalInfoFragment"
        android:label="GraphicalInformation"
        android:layout="@layout/graphical_information"/>
</navigation>

The textview value in bottom toggle of the application is not expected. The Github repository is Shekhar0050M/WASP.
The screenshot of the app with extra text at lower left side.

0

Browse other questions tagged or ask your own question.