Sep 14 | 7:25 PM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Sep 14 | 7:35 PM |
Susheel | has entered the room |
Susheel |
Hi Mark
|
Susheel |
How are you doing?
|
Mark M. |
hello, Susheel!
|
Mark M. |
things are OK
|
Mark M. |
how about you?
|
Susheel |
Good thank you.
|
Susheel |
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?
|
Sep 14 | 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.
|
Susheel |
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
|
Mark M. |
FrameLayout, or perhaps even View or ViewGroup, might work
|
Mark M. |
I do not see anywhere in there where the intrinsic "LinearLayout-ness" is used
|
Mark M. |
or even anything from ViewGroup
|
Mark M. |
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
|
Sep 14 | 7:45 PM |
Susheel |
Real-life problems!
|
Sep 14 | 7:45 PM |
Mark M. |
right
|
Mark M. |
worry about "optimal" if/when you see something amiss
|
Mark M. |
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
|
Mark M. |
it'll be a fairly big Bitmap for high-resolution screens
|
Mark M. |
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
|
Mark M. |
it would be nice to just do it with some Paint operations
|
Sep 14 | 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
|
Mark M. |
even if you can't use it directly, it might give you idea
|
Mark M. |
er, ideas
|
Susheel |
True! Android Arsenal is a gold mine!
|
Mark M. | |
Mark M. |
there may be others in the Showcase Views category: https://android-arsenal.com/tag/198?sort=created
|
Mark M. |
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
|
Mark M. |
it'
|
Mark M. |
it'll be more tested, but it'll also be more complex
|
Susheel |
words of wisdom
|
Susheel |
Thank you for all your help Mark. Hope you have a good day.
|
Susheel | has left the room |
Sep 14 | 8:30 PM |
Mark M. | turned off guest access |