Office Hours — Today, October 31

Saturday, October 28

Mark M.
has entered the room
Mark M.
turned on guest access
Oct 31
7:30 PM
Susheel
has entered the room
Susheel
Hi Mark!
Mark M.
hello, Susheel!
Happy Halloween!
Susheel
Thank you, I dressed up as a coder to work!
Mark M.
sounds elaborate -- are you cosplaying as somebody from the show "Silicon Valley"? :-)
Susheel
Haha. No just wearing a t-shirt and jeans. Regular developer clothes. But that would have been dope :)
Mark M.
so, how can I help you today?
Susheel
I have a couple of questions. First one is about the system navigation bar.
for phones that have a soft navigation bar, I want to be able to know if it appears on the left or right of the phone in landscape mode. But I want this info programatically. Is that possible?
I looked at this answer on stackoverflow: https://stackoverflow.com/questions/20264268/ho...
Mark M.
IIRC, there's no supported way to do that
yeah, there are a handful of quasi-workarounds like those in those answers
Susheel
The reply with 65 votes works for me but it doesn't tell me when the bar appears on the left vs right
I see.
Mark M.
IIRC, the code for this is in WindowManager, so you're welcome to poke around in there
I had a similar desire once, and I elected to go another direction... and I don't think things got any easier
7:35 PM
Susheel
Cool.
7:35 PM
Mark M.
also, if your app is for off-the-shelf devices, don't forget multi-window mode, particularly on Chrome OS
Susheel
So are you saying it's possible to find out if I dig in to the source code for WindowManager?
Mark M.
IIRC, the nav bar logic is in there
Susheel
Cool
I have another question.
When you're ready
Mark M.
go right ahead
Susheel
Have you ever come across readable-content-guide on iOS? https://useyourloaf.com/blog/readable-content-g...
Mark M.
I know next to nothing about iOS UIs
Susheel
If you have text that stretches across the width of the device you can get lines that are so long they become hard to read. This is especially true on larger devices like the iPad. The readable content guide creates an area that can be easily read without you losing track of the lines.
I want to implement this in Android.
Mark M.
um, OK
but... that's not a question :-)
7:40 PM
Susheel
Haha. Yes. I was wondering if I can just throw in a textview inside a scrollview with a padding.
What is a good way to do it in your opinion?
Mark M.
IMHO, this isn't something that you would do in isolation
the space that you are not using for the large block of text should be used for something
Susheel
Hmm.
Mark M.
take that very blog post's Web page for example
it uses a center content area for the prose
the left is for nav, the right is for an ad banner-ish thingy
if you're saying that you want shorter lines, and just whitespace on each side... I wouldn't do it
Susheel
I see. Their rationale is that longer lines get harder to read.
Mark M.
and I've heard that argument before
my counter-argument is: if they're using a larger screen, you should use the larger screen for *something*
otherwise, they'd just be using a phone
Susheel
Hmm.
Mark M.
Ars Technica gets on everybody's case for this, where tablet apps are just phone apps that don't do anything useful with the extra space
7:45 PM
Mark M.
and it's something that I agree with them on
Susheel
We have the same UX designer for iOS and Android and she was asking me if there was an Android equivalent for this iOS feature.
Mark M.
there's nothing out of the box for it, though your TextView-padding-ScrollView approach should work
I'm just not a fan of that UI design approach
then again, I'm not a UI design expert
Susheel
Right. I am thinking Autosizing TextViews (from support library) should also work.
I see.
Thank you for your input though.
Mark M.
autosizing the text might help in terms of offering a text zoom option
but that just controls the font size
Susheel
Oh that's right
Mark M.
it won't add gutters on either side of the text
Susheel
True.
I will dig into WIndowManager for my first question.
Thanks for your help
Mark M.
happy to be useful!
Susheel
Hope you have a good day :)
Mark M.
you too!
Susheel
Thank you!
8:10 PM
Susheel
has left the room
8:25 PM
Mark M.
turned off guest access

Saturday, October 28

 

Office Hours

People in this transcript

  • Mark Murphy
  • Susheel