aurelhubert / aurelhubert/ahbottomnavigation

AHBottomNavigation#createItems() function called too many times

Open
#27 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
3.8k
Forks
672
PR merge metrics
No merged PRs in 30d

Description

The [AhBottomNavigation#createItems](https://github.com/aurelhubert/ahbottomnavigation/blob/master/ahbottomnavigation/src/main/java/com/aurelhubert/ahbottomnavigation/AHBottomNavigation.java#L148) is called each time we add a single item or when we change a view parameter.

Wouldn't it be possible to call it in a more adapted way for optimizing the view ?

Potential solutions:
- Concerning the colors and other parameters, one could use use [http://developer.android.com/training/custom-views/create-view.html#customattr](custom attributes) in order to set the params directly in the xml.
- Having an update function for changing just what is needed when we change a parameter.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in ahbottomnavigation/src/main/java/com/aurelhubert/ahbottomnavigation/AHBottomNavigation.java at createItems() and inspect each caller that adds an item or changes a view parameter. Reproduce the repeated calls, then determine and verify a narrower update path that preserves item and parameter behavior without rebuilding the view unnecessarily.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile, performance
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.