Skip to content
This repository has been archived by the owner on Apr 17, 2021. It is now read-only.

Commit

Permalink
Issue #762 - Prevent menu button from closing overlay on homescreen.
Browse files Browse the repository at this point in the history
  • Loading branch information
liuche committed Apr 20, 2018
1 parent bfd5963 commit 7f2fcd4
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ class BrowserFragment : IWebViewLifecycleFragment() {
var url: String? = null
private set

val isUrlEqualToHomepage: Boolean get() = url == APP_URL_HOME

private val sessionManager = SessionManager.getInstance()

/**
Expand Down Expand Up @@ -223,8 +225,7 @@ class BrowserFragment : IWebViewLifecycleFragment() {
val actionIsDown = event.action == KeyEvent.ACTION_DOWN
val isOverlayToggleKey = (keyCodeIsMenu || (keyCodeIsBack && browserOverlay.isVisible))

if (isOverlayToggleKey) {
// TODO: prevent hiding overlay on Homepage.
if (isOverlayToggleKey && !isUrlEqualToHomepage) {
if (actionIsDown) {
val toShow = !browserOverlay.isVisible
setOverlayVisibleByUser(toShow)
Expand Down

0 comments on commit 7f2fcd4

Please sign in to comment.