Last modified: 2014-08-06 11:37:44 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T70682, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 68682 - Android app: Navigation bar doesn't always collapse when searching
Android app: Navigation bar doesn't always collapse when searching
Status: RESOLVED FIXED
Product: Wikipedia App
Classification: Unclassified
Android App (Other open bugs)
Stable
All All
: Unprioritized normal
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-07-27 16:37 UTC by Dan Garry
Modified: 2014-08-06 11:37 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Dan Garry 2014-07-27 16:37:02 UTC
Steps to reproduce:

1) Cold boot the app.
2) Tap W to open the navigation bar.
3) Tap search.
4) Type a query that doesn't generate many results, e.g. "uuu i".
5) The search results show on top of the navigation menu on top of the page.

Note that cold booting the app is one way to cause this, but it's not the only way; cold booting was just the most reliable way I found of causing this.
Comment 1 Dan Garry 2014-07-27 18:51:07 UTC
*takes off his product hat and puts on his junior engineer hat*

I took a look at this. There is code in the onClickListener that collapses the navigation bar, but the onClickListener method isn't called the first time you tap on the search bar because the onFocusChangeListener method has precedence; any subsequent taps call onClick, but no the first.

So you'd think you could just add the navigation collapse code to the onFocusChangeListener method and that'd do it. It does, the bar collapses when you tap the search bar! However, the addition of that code for some reason also means the keyboard doesn't appear when a focus change to the search bar occurs. Don't ask me why.
Comment 2 Yuvi Panda 2014-07-27 18:53:52 UTC
:D

Soft Keyboard and Focus are kindof weird in Android - we explicitly hide the keyboard after activity closes, even though there should be no reason why we have to do this. I suspect we're perhaps hitting a similar bug with similar shitty workaround (force show the keyboard in onFocus *and* onClick, maybe)
Comment 3 Dan Garry 2014-07-27 19:02:58 UTC
(In reply to Yuvi Panda from comment #2)
> :D
> 
> Soft Keyboard and Focus are kindof weird in Android - we explicitly hide the
> keyboard after activity closes, even though there should be no reason why we
> have to do this. I suspect we're perhaps hitting a similar bug with similar
> shitty workaround (force show the keyboard in onFocus *and* onClick, maybe)

*still has junior engineer hat on*

Yeah, it probably makes sense to add a generic show soft keyboard method (with appropriate parameters) to Utils that could be used for this purpose. I did look up some code snippets online for showing the keyboard but it wasn't particularly obvious to me how they worked and I wasn't sure what parameters the snippets required to work.
Comment 4 Dan Garry 2014-07-28 14:48:35 UTC
(In reply to Dan Garry from comment #3)
> *still has junior engineer hat on*
> 
> Yeah, it probably makes sense to add a generic show soft keyboard method
> (with appropriate parameters) to Utils that could be used for this purpose.
> I did look up some code snippets online for showing the keyboard but it
> wasn't particularly obvious to me how they worked and I wasn't sure what
> parameters the snippets required to work.

I did this, but it just doesn't work in the onFocusChange method if you try to close the drawer. It works anywhere else. I don't know why.
Comment 5 Dan Garry 2014-08-06 11:37:44 UTC
This is now fixed by Dmitry's addition of a showSoftKeyboardAsync method which works!

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links