ismaeldivita / chip-navigation-bar

An android navigation bar widget
MIT License
890 stars 136 forks source link

Active menu #59

Closed robertnicjoo closed 3 years ago

robertnicjoo commented 3 years ago

I have following menu file but android:enabled="true" is not working (I mean by default when I open my app it is not active)

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
    <item
        android:id="@+id/home"
        android:icon="@drawable/abc_vector_test"
        android:title="Home"
        android:enabled="true"
        app:cnb_iconColor="@color/home" />
    <item
        android:id="@+id/activity"
        android:icon="@drawable/ic_launcher_foreground"
        android:title="@string/services"
        app:cnb_iconColor="@color/services" />
    <item
        android:id="@+id/favorites"
        android:icon="@android:drawable/arrow_down_float"
        android:title="@string/orders"
        app:cnb_iconColor="@color/orders" />
    <item
        android:id="@+id/settings"
        android:icon="@android:drawable/arrow_up_float"
        android:title="@string/settings"
        app:cnb_iconColor="@color/settings" />
</menu>
ismaeldivita commented 3 years ago

👋

selected != enabled

Just call the setItemSelected(R.id.home) on your onCreate

robertnicjoo commented 3 years ago

HI, Appreciate your fast response ❤️ , may I ask then what does android:enabled="true" do?

ismaeldivita commented 3 years ago

You can enable/disable a menu using this property, they will still be visible to the users, but they can't interact with.

Closing the issue