Skip to content

fix(BreadActivity): remove dead bottom-nav/toolbar cruft causing startup NPE - #248

Merged
kcw-grunt merged 1 commit into
developfrom
fix/claude-4cfae51423cb132922df8441d8ae8a43
Jul 22, 2026
Merged

fix(BreadActivity): remove dead bottom-nav/toolbar cruft causing startup NPE#248
kcw-grunt merged 1 commit into
developfrom
fix/claude-4cfae51423cb132922df8441d8ae8a43

Conversation

@grunt-claude-bot

@grunt-claude-bot grunt-claude-bot commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

📱 Description

This PR removes dead code from BreadActivity that was causing startup NPE issues. The bottom navigation bar, toolbar price buttons, and associated menu drawer logic have been removed as they are no longer used in the production Compose-based Send workflow. This cleanup eliminates unused UI components and their event listeners that were creating initialization problems.

Summary

  • BreadActivity crashed with a guaranteed NullPointerException on BottomNavigationView.setOnNavigationItemSelectedListener during onCreate. The initializeViews() method that bound bottomNav, menuBut, drawerLayout, primaryPrice, and secondaryPrice via findViewById was deleted in the "Techdebt/improve shop" refactor, but the code still dereferenced those fields.
  • These views were already non-functional before the crash (the bottom nav menu was only ever wired via a design-time-only tools:menu attribute, never inflated at runtime; nothing populated primaryPrice/secondaryPrice text). Rather than resurrect dead legacy UI, this removes it outright.
  • Deletes the associated fields/listeners in BreadActivity.java, the R.id.bottomNav / menuBut / drawerLayout / primary_price / secondary_price views in activity_bread.xml, the now-unreferenced R.menu.bottom_nav_menu resource, and fixes the layout refs that pointed at the removed views.

Supersedes #247 (closed — that PR was opened under kcw-grunt, which GitHub disallows requesting as a reviewer on its own PR).

Test plan

  • ./gradlew :app:compileBrainwalletDebugJavaWithJavac passes
  • ./gradlew :app:processBrainwalletDebugResources passes (no dangling resource refs)
  • Manual smoke test: launch app, confirm BreadActivity no longer crashes on open

Platform

  • Android

🎯 Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 🔧 Refactoring (code change that neither fixes a bug nor adds a feature)
  • 📚 Documentation update
  • 🎨 UI/UX improvement
  • ⚡ Performance improvement
  • 🧪 Test addition or improvement

📋 Changes

New Components Added

None

Modifications

  • BreadActivity.java – Removed unused imports (Button, ImageButton, DrawerLayout, BRAnimator, BottomNavigationView), removed dead member variables (primaryPrice, secondaryPrice, menuBut, bottomNav, drawerLayout, mSelectedBottomNavItem, PRIMARY_TEXT_SIZE, SECONDARY_TEXT_SIZE), removed setListeners() method and handleNavigationItemSelected() method, simplified onCreate() by removing bottom nav initialization and price button text sizing logic.
  • activity_bread.xml – Removed android:id="@+id/drawerLayout" attribute, removed primary_price and secondary_price Button views from the toolbar, removed menuBut ImageButton, removed BottomNavigationView component and its layout constraints, updated balanceTxtV constraints to remove references to deleted views.

Removals

  • bottom_nav_menu.xml – Deleted entire menu resource file that defined navigation items (nav_send, nav_history, nav_receive) which are no longer referenced or used.

📊 Statistics

  • Additions: 2 lines
  • Deletions: 111 lines
  • Files Changed: 3
  • Commits: 1

🔗 Related Issues

  • Fixes startup NPE caused by dead UI component initialization
  • Related to Compose Send workflow migration to production
  • From Crashlytics Issue ID: 4cfae51423cb132922df8441d8ae8a43

🧪 Tests Status

  • Tests ran successfully locally?
  • Added more tests? How many?
  • Code coverage percentage of the codebase: __%

📸 Screenshots/Videos

Before After
Add screenshot Add screenshot

🎯 Reviewers

@kcw-grunt, @josikie


Draft Status: This PR is currently in draft mode and ready for review feedback.

…tup NPE

The "Techdebt/improve shop" refactor (d0886db) deleted initializeViews(),
which was the only place binding bottomNav, menuBut, drawerLayout,
primaryPrice, and secondaryPrice via findViewById. The refactor left
onCreate/setListeners still dereferencing those never-assigned fields,
so BreadActivity crashed with a guaranteed NullPointerException on
BottomNavigationView.setOnNavigationItemSelectedListener on every launch.

These views were already non-functional before the crash: the bottom
nav's menu was only ever wired up via a design-time-only tools:menu
attribute (never inflated at runtime), and primaryPrice/secondaryPrice
had no code left to populate their text. Rather than resurrect dead
legacy UI, remove it outright: drop the associated fields, listeners,
and R.id.bottomNav/menuBut/drawerLayout/primary_price/secondary_price
views plus the now-unreferenced R.menu.bottom_nav_menu resource, and
fix the layout refs that pointed at the removed views.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@gruntsoftware gruntsoftware deleted a comment from github-actions Bot Jul 22, 2026

@kcw-grunt kcw-grunt left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removes the ancient XML Android tab bar which was causing crashes

@kcw-grunt kcw-grunt added bug Something isn't working android labels Jul 22, 2026
@kcw-grunt
kcw-grunt merged commit 3bf7a25 into develop Jul 22, 2026
1 of 4 checks passed
@grunt-claude-bot grunt-claude-bot mentioned this pull request Jul 27, 2026
3 tasks
kcw-grunt pushed a commit that referenced this pull request Jul 27, 2026
Resolves conflicts to unblock PR #253:
- app/build.gradle.kts: kept v4.10.6 (202506345) over main's older v4.10.4
- gradle/libs.versions.toml: kept the ReLinker dependency addition
- app/src/main/res/layout/activity_bread.xml: kept this branch's removal of
  dead primary_price/secondary_price/menuBut views (fix(BreadActivity) #248
  NPE fix) over main's pre-fix version of the layout
- bw-gdlib submodule: kept 5c2faab0 (this branch), which is a direct
  descendant of main's c8ca278 pin (fast-forward, not a real divergence)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@kcw-grunt
kcw-grunt deleted the fix/claude-4cfae51423cb132922df8441d8ae8a43 branch July 29, 2026 09:12
@grunt-claude-bot grunt-claude-bot mentioned this pull request Jul 30, 2026
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

android bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants