Office Hours — Today, September 14

Tuesday, September 12

Sep 14
7:25 PM
Mark M.
has entered the room
Mark M.
turned on guest access
7:35 PM
Susheel
has entered the room
Susheel
Hi Mark
How are you doing?
Mark M.
hello, Susheel!
things are OK
how about you?
Susheel
Good thank you.
I have a quick question. I am trying to implement an overlay kind of a layout over an activity. This layout will have a transparent circle in the center.
Mark M.
transparent, meaning that you want to show the underlying activity through the circle?
7:40 PM
Susheel
Yes. The desired effect will look like the 2nd answer in the link. https://stackoverflow.com/questions/19947835/an... It's the one with the lighthouse.
Mark M.
OK
Susheel
I know the question has already been answered. I wanted your opinion on how the implementation.
was done.
Mark M.
well, I've never done anything quite like that
Susheel
Do we need to extend LinearLayout like the person did?
Mark M.
I wouldn't think so
FrameLayout, or perhaps even View or ViewGroup, might work
I do not see anywhere in there where the intrinsic "LinearLayout-ness" is used
or even anything from ViewGroup
presumably, you could just extend View
Susheel
Okay. I want to know if this is an optimal way of doing it. I know you already said you haven't done something like this before.
Mark M.
I'd settle first for something that works
7:45 PM
Susheel
Real-life problems!
7:45 PM
Mark M.
right
worry about "optimal" if/when you see something amiss
I forget how much this sort of thing impacts performance, and how much the GPU can still handle it directly
Susheel
Sounds good. Just don't want to be doing something in a 'bad' way. I face this paranoia every now and then when I am not certain about the implementation.
Mark M.
understood
Susheel
That's exactly what I'm talking about. Perf matters!
Mark M.
it's already caching the Bitmap
Susheel
No obvious issues, then?
Mark M.
and I am assuming that there will be little interactivity until the overlay is gone, since the overlay will consume all touch input
Susheel
Yes. Like a dismiss button.
Mark M.
I'm not 100% convinced that the Bitmap is the best-performing way to go about it, though that's more of a heap space concern
it'll be a fairly big Bitmap for high-resolution screens
and that could get you in trouble, if you cannot allocate the Bitmap, because there's no block of free memory big enough when you display the overlay
it would be nice to just do it with some Paint operations
7:50 PM
Susheel
Okay. I will first see if this works like you said and then try to find a better solution. Thanks for your input Mark!
Mark M.
you might putter around the Android Arsenal to see if there's a library that offers similar features
even if you can't use it directly, it might give you idea
er, ideas
Susheel
True! Android Arsenal is a gold mine!
Mark M.
there may be others in the Showcase Views category: https://android-arsenal.com/tag/198?sort=created
but that's the sort of thing that I think of when I see the overlay that you're trying to set up
Susheel
Thank you. I will give them a look.
Mark M.
a library implementation is likely to be more feature-rich than that Stack Overflow answer, which is a double-edged sword
it'
it'll be more tested, but it'll also be more complex
Susheel
words of wisdom
Thank you for all your help Mark. Hope you have a good day.
Susheel
has left the room
8:30 PM
Mark M.
turned off guest access

Tuesday, September 12

 

Office Hours

People in this transcript

  • Mark Murphy
  • Susheel