mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-18 03:45:33 -04:00
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:
parent
2a3d479509
commit
952b539fa8
@ -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)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user