Adjusted the zone for triggering search suggestions.

* We had restricted the toolbar click to the toolbar title. So, if the user clicked on the title, it would initiate the search. Now, we have removed the restriction of clicking only on the title. If the user taps anywhere on the toolbar except the menu items and hamburger, it will initiate the search.
This commit is contained in:
MohitMaliFtechiz 2023-12-01 14:34:24 +05:30
parent 2a3d479509
commit 952b539fa8

View File

@ -29,7 +29,6 @@ import android.content.pm.PackageManager
import android.content.res.AssetFileDescriptor
import android.content.res.Configuration
import android.graphics.Canvas
import android.graphics.Rect
import android.media.AudioManager
import android.media.AudioManager.OnAudioFocusChangeListener
import android.net.Uri
@ -460,9 +459,8 @@ abstract class CoreReaderFragment :
override fun onTap(e: MotionEvent?) {
e?.let {
val titleTextView = toolbar?.findFirstTextView() ?: return@onTap
val hitRect = Rect()
titleTextView.getHitRect(hitRect)
if (hitRect.contains(it.x.toInt(), it.y.toInt())) {
titleTextView.let {
// only initiate search if it is on the reader screen
mainMenu?.tryExpandSearch(zimReaderContainer?.zimFileReader)
}
}