Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import android.content.Intent
import android.content.ServiceConnection
import android.content.res.Configuration
import android.graphics.Color
import android.graphics.Rect
import android.graphics.drawable.GradientDrawable
import android.os.Build
import android.os.Bundle
Expand Down Expand Up @@ -1601,7 +1602,9 @@ abstract class BaseEditorActivity :
}

// Filter out diagonal flings so only an intentional right swipe opens the drawer.
if (isDrawerOpenFling) {
// A horizontal fling that started on the bottom-sheet tab strip is the user
// scrolling tabs, not asking for the drawer.
if (isDrawerOpenFling && !isTouchOnBottomSheetTabs(e1)) {
binding.editorDrawerLayout.openDrawer(GravityCompat.START)
return true
}
Expand All @@ -1621,6 +1624,13 @@ abstract class BaseEditorActivity :
return super.dispatchTouchEvent(ev)
}

private fun isTouchOnBottomSheetTabs(ev: MotionEvent): Boolean {
val tabs = contentOrNull?.bottomSheet?.binding?.tabs ?: return false
val rect = Rect()
if (!tabs.getGlobalVisibleRect(rect)) return false
return rect.contains(ev.rawX.toInt(), ev.rawY.toInt())
}

private fun showTooltip(tag: String) {
TooltipManager.showIdeCategoryTooltip(
context = this,
Expand Down
Loading