1

On github there is a library for tab menu, which I tried to add to my project (https://github.com/michaldrabik/TapBarMenu). The library is used by including in xml file new object:

            <com.michaldrabik.tapbarmenulib.TapBarMenu
            android:id="@+id/tapBarMenu"
            android:layout_width="match_parent"
            android:layout_height="56dp"
            android:layout_gravity="center_horizontal|bottom"
            app:tbm_backgroundColor = "@color/colorPrimaryDark"
            app:tbm_menuAnchor = "top"
            app:tbm_buttonPosition = "left"
            android:layout_margin="10dp">

It worked. Later I tried to add more flexibility and also added class TapBarMenu from library and added:

            <TapBarMenu
            android:id="@+id/tapBarMenu02"
            android:layout_width="match_parent"
            android:layout_height="56dp"
            android:layout_gravity="center_horizontal|bottom"
            android:tbm_backgroundColor = "@color/colorPrimaryDark"
            app:tbm_menuAnchor = "top"
            app:tbm_buttonPosition = "left"
            android:layout_margin="10dp">

However for second inclusion Android Studio says: "unexpected namespace prefix" for app, whereas in the beginning of xml

xmlns:app="http://schemas.android.com/apk/res-auto"

I've read Android doc NamespaceContext, but it's rather short. Please tell how to use local class in xml and point to good place to read about namespaces for Android.

Alexei Martianov
  • 2,291
  • 3
  • 23
  • 50

1 Answers1

1

if you put it in a package with the name com.example.myapp then you need to reference it with <com.example.myapp.TapBarMenu

Mohammad Salem
  • 953
  • 7
  • 15