Skip to content

Conversation

@puksh
Copy link

@puksh puksh commented Jan 5, 2026

Summary

Added a quick gesture for keyboard pull up - double tap on the Search button. It is commonly found in nearly every other app. Also fixed a small bug with the button highlight when gesturing Back. Fixes #1250

Changes

  • Double tap on Search brings up the keyboard
    Previously: Double tapping on the Search button on Navbar didn't do anything
    After: Double tap brings up the keyboard

  • Fixed Navbar icon highlight not correcting itself when triggering a Back gesture/button tap
    Previously: Going back from Library/Search still ahs Library/Search highlighted
    After: Going back from Library/Search highlights the Home button

Testing

  • Verified both non-liquid and liquid glass navbar styles
  • Gesture Back tested in both going back from Search and Library panels
  • Tested inside the Android Studio Emulator and on my Xperia 5 - J9210

Copilot AI review requested due to automatic review settings January 5, 2026 21:45
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 adds a double-tap gesture on the Search button to bring up the keyboard and fixes an issue where the navbar highlight didn't update correctly when navigating back from Library/Search screens.

Key Changes:

  • Implemented double-tap detection on Search navigation items to trigger keyboard focus
  • Added LaunchedEffect to update navbar highlight based on current destination
  • Introduced a search focus trigger mechanism via SharedViewModel state flow

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
SharedViewModel.kt Added searchFocusTrigger state flow and triggerSearchFocus() function to coordinate keyboard focus requests
SearchScreen.kt Added LaunchedEffect to observe searchFocusTrigger and request focus when triggered
AppBottomNavigationBar.kt Implemented double-tap detection, added LaunchedEffect to sync selectedIndex with navigation state, and added viewModel parameter
App.kt Passed viewModel to navigation components to enable search focus triggering
LiquidGlassAppBottomNavigationBar.android.kt Replaced FloatingActionButton with Box using combinedClickable for double-tap support and added LaunchedEffect for highlight sync

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

selected = selectedIndex == screen.ordinal,
onClick = {
if (selectedIndex == screen.ordinal) {
val currentTime = System.currentTimeMillis()
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

Using System.currentTimeMillis() for double-click detection can be unreliable if the system clock changes. Consider using a monotonic time source that is guaranteed to always move forward, such as a platform-specific monotonic clock or Compose's withFrameNanos if available in common code.

Copilot uses AI. Check for mistakes.
selected = selectedIndex == index,
onClick = {
if (selectedIndex == screen.ordinal) {
val currentTime = System.currentTimeMillis()
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

Using System.currentTimeMillis() for double-click detection can be unreliable if the system clock changes. Consider using a monotonic time source that is guaranteed to always move forward, such as a platform-specific monotonic clock or Compose's withFrameNanos if available in common code.

Copilot uses AI. Check for mistakes.
Comment on lines +3 to +6
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.combinedClickable
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

The ExperimentalFoundationApi annotation and combinedClickable import are added but never used in this file. The double-click detection is implemented manually instead. Either remove these unused imports or consider using combinedClickable for more reliable double-click handling.

Copilot uses AI. Check for mistakes.
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.

Double tap on search navigation icon to focus search box

1 participant