Skip to content

Conversation

@sande11
Copy link

@sande11 sande11 commented Aug 27, 2025

Pull Request: Enhanced Custom Action Bar with Integrated Search and Redesigned Bookmark Dialog

Overview

This PR implements a comprehensive UI overhaul that matches Figma specifications. Link to design: https://www.figma.com/design/ZYZkodGKNJ3VOJMVlqdCMo/GA-TB-GUIDE-REDESIGN?node-id=2660-5103&m=dev

Before:
before

After:
Screenshot_20250827_090157

Key Features

1. Custom Action Bar System

  • Dynamic Title Management: Action bar titles dynamically update based on the current navigation destination
  • Smart Back Button: Custom back arrow icon that appears/disappears contextually
  • Centered Title Layout: All titles are properly centered with balanced spacing
  • Context-Aware Display: Shows appropriate titles for chapters, sub-chapters, charts, and content pages

2. Integrated Search Functionality

  • Unified Search Design: Search bar appears as part of the action bar for seamless integration
  • Fragment-Specific Search: Search functionality only appears in content viewing screens (BodyFragment)

3. Redesigned Bookmark Dialog

  • Enhanced UX: Improved button layouts, proper spacing, and intuitive clear functionality
  • Material Design Compliance: Proper touch targets and accessibility features

Files Modified

Core Architecture

  • app/src/main/java/org/apphatchery/gatbreferenceguide/ui/ActionBarController.kt - New interface for action bar control
  • app/src/main/java/org/apphatchery/gatbreferenceguide/ui/BaseFragment.kt - Enhanced with action bar helper methods
  • app/src/main/java/org/apphatchery/gatbreferenceguide/ui/MainActivity.kt - Complete action bar management system

Layout Files

  • app/src/main/res/layout/custom_action_bar_title.xml - Redesigned custom action bar layout
  • app/src/main/res/layout/search_view.xml - New integrated search view component
  • app/src/main/res/layout/fragment_body.xml - Updated to include search integration
  • app/src/main/res/layout/dialog_bookmark.xml - Complete Figma-based redesign

Drawable Resources

  • app/src/main/res/drawable/search_view_background.xml - Blue rectangular background for search container
  • app/src/main/res/drawable/frame_16.xml - Gray background for search input field
  • app/src/main/res/drawable/rectangle_2.xml - White dialog background with rounded corners
  • app/src/main/res/drawable/cancel_button_bg.xml - Gray cancel button background
  • app/src/main/res/drawable/save_button_bg.xml - Blue save button background
  • app/src/main/res/drawable/frame_46.xml - Gray text field background for bookmark dialog

Fragment Updates

  • app/src/main/java/org/apphatchery/gatbreferenceguide/ui/fragments/BodyFragment.kt - Search integration and title management
  • app/src/main/java/org/apphatchery/gatbreferenceguide/ui/fragments/ChapterFragment.kt - Removed search icon
  • app/src/main/java/org/apphatchery/gatbreferenceguide/ui/fragments/SubChapterFragment.kt - Updated title handling and removed search icon

Technical Improvements

Action Bar Management

interface ActionBarController {
    fun setActionBarTitle(title: String)
    fun setActionBarConfig(title: String, showBackButton: Boolean)
    fun setActionBarSearchVisible(visible: Boolean)
    fun setupActionBarSearch(onSearchAction: (String) -> Unit, onSearchIconClick: (String) -> Unit)
}

Dynamic Title System

  • Chapter Navigation: Shows full chapter names (e.g., "I. Epidemiology")
  • Content Pages: Displays chart/table titles
  • Bookmark Pages: Shows "My Bookmarks" with custom back arrow
  • Navigation Context: Proper title context for all navigation destinations

Search Integration

  • Contextual Visibility: Search only appears in content viewing screens
  • Performance Optimized: Dynamic view finding prevents memory leaks

Design Specifications Met

Bookmark Dialog Design

  • White background with 4dp rounded corners
  • "Bookmark name" label positioned at 30dp from left and top
  • Gray text field
  • Blue clear icon inside text field with proper tinting
  • Full-width touching buttons
  • Cancel button: Gray background (#ECECEC)
  • Save button: Blue background (#5182FF)

User Experience Improvements

Navigation Flow

  1. Consistent Title Display: All screens show contextually appropriate titles
  2. Intuitive Back Navigation: Smart back button appears only when needed
  3. Search Context: Search functionality appears only in relevant content screens
  4. Visual Cohesion: Action bar and search appear as unified design element

Bookmark Management

  1. Improved Dialog UX: Better visual hierarchy with proper spacing and colors
  2. Professional Appearance: Matches design with exact Figma specifications

Testing Considerations

  • Navigation Testing: Verify titles appear correctly on all navigation destinations
  • Bookmark Operations: Ensure create, update, and delete operations work without crashes
  • Layout Testing: Verify proper appearance across different screen sizes and orientations

Breaking Changes

  • Custom Action Bar: Replaces default Android action bar with custom implementation
  • Search Interface: New search UI replaces previous implementation
  • Bookmark Dialog: Complete redesign may affect existing bookmark workflows

@sande11 sande11 requested a review from MaxwellKJr August 27, 2025 07:12
@sande11 sande11 linked an issue Aug 27, 2025 that may be closed by this pull request
6 tasks
@sande11 sande11 self-assigned this Aug 27, 2025
Copy link
Contributor

@MaxwellKJr MaxwellKJr left a comment

Choose a reason for hiding this comment

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

@sande11 great work! This looks solid. Just a few things that you need to look into:

Align Chapter Cards text to the left

Screenshot 2025-09-19 at 09 12 15

Web View Search Options Not Fitting On Small Devices

  • Try reducing the horizontal padding of the parent layout and also the individual elements
Screenshot 2025-09-19 at 09 16 09

Clear Search Field When Last letter has been cleared with the keyboard delete button

Screenshot 2025-09-19 at 09 27 05 Screenshot 2025-09-19 at 09 39 31

Dismiss the Keyboard when popping out of the WebView page

Screenshot 2025-09-19 at 09 38 48

Dark Mode Not Working

screen-20250919-090219.webm

@sande11
Copy link
Author

sande11 commented Oct 9, 2025

@Wiza-Munthali

sande11 added 10 commits October 9, 2025 20:05
private const val BUILD_VERSION = 12
private const val PENDO_RELEASE_VERSION = "Oct-25-"
…n' into 133-update-android-app-to-target-latest-api-level-and-google-sdks
…rget-latest-api-level-and-google-sdks

updated from API 34 to 35 (#133) in TB Guide android and then merged that branch into #131 that way we have both UI updates and API level updates in one branch
…d-app-to-target-latest-api-level-and-google-sdks

Revert "updated from API 34 to 35 in TB Guide android UI Updates"
…app-ui-with-new-figma-design

Merging #131 update-tb-guide-android-app-UI-with-new-figma-design into #133-update-android-app-to-target-latest-api-level-and-google-sdks
- Bump compileSdk and targetSdk to 36
- Update dependencies to latest versions
- Implement edge-to-edge layout in MainActivity
- Add status bar background view in activity_main.xml
- Add support for 16KB page size in gradle.properties
Updated tab container structure to improve appearance when font size is increased
Added logic to automatically expand collapsed dropdowns, tabs, and details elements that contain search results before performing in-page search. Also added a method to collapse expanded sections when clearing the search. Updated custom_action_bar_title.xml to use wrap_content for height with a minimum height of 56dp for better layout flexibility.
Changed the floating notes button margins and constraint to improve positioning. MarginEnd increased to 25dp, marginBottom added, and constraint now aligns to bottom_toolbar instead of search_view_include.
…app-ui-with-new-figma-design

Merge the latest UI updates to API level update branch
Replaces removeLast() with removeAt(recentSearches.lastIndex) to remove the last item from the recent searches list, ensuring compatibility
Replaces removeLast() with removeAt(recentSearches.lastIndex) to remove the last item from the recent searches list, ensuring compatibility
…rget-latest-api-level-and-google-sdks

133 update android app to target latest api level and google sdks
Replaced launcher icons and round icons for all densities, updated ic_launcher_background.xml with a new vector design, and added ic_launcher_foreground assets to mipmap folders. Updated adaptive icon XMLs to reference foreground images from mipmap instead of drawable for proper icon rendering.
Corrected URLs for CDC TB case definitions and QuantiFERON-TB Gold Plus package insert. Updated chapter references in HIV therapy tables to point to the correct section. These changes improve accuracy and navigation for users.
Corrected the 'View in chapter' links in three HTML table pages to point to the appropriate chapter without fragment identifiers, ensuring consistency and proper navigation for users.
144 Fix Broken internal and External Links
Added custom selection and reselection handlers for bottom navigation to ensure consistent navigation to root fragments. Updated fragment_saved.xml to include bottom padding for navigation bar, and defined bottom_nav_height in dimens.xml.
Corrected image paths, improved table formatting, fixed HTML entities, and updated external links in multiple TB-related asset pages. These changes enhance clarity, consistency, and ensure accurate representation of diagnostic and treatment criteria.
…mark-screen-doesnt-work

 Fix bottom-nav interaction on Bookmarks screen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update TB Guide Android App UI with New Figma Design

3 participants