Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Applications
fenix
Commits
9adc6177
Commit
9adc6177
authored
Feb 12, 2020
by
Emily Kager
Committed by
Emily Kager
Feb 13, 2020
Browse files
For #8358 - Make sure we don't cancel toolbar editing more than once
parent
9eb5fb5a
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/org/mozilla/fenix/search/toolbar/ToolbarView.kt
View file @
9adc6177
...
@@ -80,6 +80,7 @@ class ToolbarView(
...
@@ -80,6 +80,7 @@ class ToolbarView(
.
findViewById
(
R
.
id
.
toolbar
)
.
findViewById
(
R
.
id
.
toolbar
)
private
var
isInitialized
=
false
private
var
isInitialized
=
false
private
var
hasBeenCanceled
=
false
init
{
init
{
view
.
apply
{
view
.
apply
{
...
@@ -120,7 +121,10 @@ class ToolbarView(
...
@@ -120,7 +121,10 @@ class ToolbarView(
setOnEditListener
(
object
: mozilla.components.concept.toolbar.
Toolbar
.
OnEditListener
{
setOnEditListener
(
object
: mozilla.components.concept.toolbar.
Toolbar
.
OnEditListener
{
override
fun
onCancelEditing
():
Boolean
{
override
fun
onCancelEditing
():
Boolean
{
interactor
.
onEditingCanceled
()
// For some reason, this can be triggered twice on one back press. This only leads to
// navigateUp, so let's make sure we only call it once
if
(!
hasBeenCanceled
)
interactor
.
onEditingCanceled
()
hasBeenCanceled
=
true
// We need to return false to not show display mode
// We need to return false to not show display mode
return
false
return
false
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment