Skip to content
This repository was archived by the owner on Aug 21, 2025. It is now read-only.

Fix issues in the release build related to Navigation Component#107

Merged
AdamGrzybkowski merged 3 commits intotrunkfrom
adam/GRA-709
Aug 13, 2025
Merged

Fix issues in the release build related to Navigation Component#107
AdamGrzybkowski merged 3 commits intotrunkfrom
adam/GRA-709

Conversation

@AdamGrzybkowski
Copy link
Contributor

Description

Two things are broken in the release build:

  1. The back navigation after login/logout is wrong. The app should close rather than go back to the login screen and vice versa.
  2. The selected tab's icon on the bottom nav bar is tinted.

The root cause is the usage of ::class.qualifiedName when comparing the current navigation destination. With r8 in the release build, the code is obfuscated, and the name of the RootDestination or HomeDestination is different.

This PR fixes this issue by using the API function from the Navigation library hasRoute.

Fixed issue number 1:

Screen_recording_20250812_112707.mp4

and the icon tinting:

Screenshot 2025-08-12 at 11 27 45

Testing Steps

  1. Install the release build - you can do it from the Android Studio by changing the buildType to release. (Make sure you have the mobile secrets updated and applied to the project)
Screenshot 2025-08-12 at 11 33 02
  1. Log in
  2. Log out
  3. Use the system back button
  4. Confirm the app is closed
  5. Open the app again
  6. Log in
  7. Confirm the icon of the selected tab in the bottom bar is tinted

@AdamGrzybkowski AdamGrzybkowski added the bug Something isn't working label Aug 12, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes navigation and UI issues in the Android app's release build caused by code obfuscation. The main problem was using ::class.qualifiedName for route comparison, which fails in release builds where class names are obfuscated by R8.

  • Replaces ::class.qualifiedName route comparison with Navigation library's hasRoute API
  • Fixes back navigation behavior after login/logout operations
  • Resolves bottom navigation bar icon tinting issues

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
HomeScreen.kt Updates bottom navigation selection logic to use hasRoute instead of string route comparison
HomeNavigation.kt Removes the obfuscation-prone route property from HomeDestination
RootNavigation.kt Refactors root navigation logic with hasRoute API and adds extension property for destination mapping

@wpmobilebot
Copy link

wpmobilebot commented Aug 13, 2025

📲 You can test the changes from this Pull Request in Gravatar Android by scanning the QR code below to install the corresponding build.
App NameGravatar Android
Build TypeRelease
Commitc8d5697
Direct Downloadgravatar-app-prototype-build-pr107-c8d5697.apk

Copy link
Contributor

@etoledom etoledom left a comment

Choose a reason for hiding this comment

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

Working as expected 🎉
Tested using the Prototype build

@AdamGrzybkowski AdamGrzybkowski merged commit 43b1fad into trunk Aug 13, 2025
10 checks passed
@AdamGrzybkowski AdamGrzybkowski deleted the adam/GRA-709 branch August 13, 2025 06:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants