material-components / material-components/material-components-android

[Navigation Bar] Change Icon Using Selector Drawable

Open
#3,499 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Widget: BottomNavigation
Dominant language
Java
Stars
17.4k
Forks
3.2k
PR merge metrics
No merged PRs in 30d

Description

**Description:** Selector drawable throwing resource not found exception.

**Expected behavior:** Based on selector drawable state menu icon should be change on the navigation bar

**Source code:** The code snippet which is causing this issue

**Minimal sample app repro:**
Selector item:
`


`
Navigation menu:
`


----More menu options-------------
`

in MainActivity XML:
`

`

**Android API version:** 33

**Material Library version:** 1.11.0-alpha01

**Device:** Pixel 4a

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the selector drawable and bottom navigation menu XML shown in the report, then reproduce the resource-not-found exception using BottomNavigationView on Android API 33 with Material 1.11.0-alpha01. Trace how the navigation item icon is loaded and state changes are handled. Done means the selector-based icon loads and changes correctly for checked and unchecked states without an exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
android
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.