-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow background dimming #3
Comments
This can be achieved on the implementation side by using a "View" and changing alpha from 0F to 1.5F(acc. to the intensity required) but this might not be a good idea but could be a way-around. |
Using a View would require touching the view hierarchy of the background window. It may not be a very bad idea, but I'd like to know if it can avoided by only using |
I'm some what succeeded in setting the background dim but clearing background is not yet done, If you can have a look at it once. |
//function to apply the backgroundDim
fun applyDim(parent: ViewGroup, dimAmount: Int) {
val dim: Drawable = ColorDrawable(BLACK)
dim.setBounds(0, 0, parent.width, parent.height)
dim.alpha = dimAmount
val overlay = parent.overlay
overlay.add(dim)
}
//function to clear the backgroundDim
fun clearDim(parent: ViewGroup) {
val overlay = parent.overlay
overlay.clear()
} Used this |
Yeah sure I wouldn't mind doing that. Wanna take a stab? |
Let's give it a try! |
I was too late to view this thread 🤦. |
could this lib be used to achiev telegram action popup with background dim like video below? or It only can be used on toolbar actionbutton? take.2021-05-09.at.00.01.55.mov |
Yep that should already be possible minus background dimming! |
Screen_recording_20231018_180308.webmAble to do it. |
i cant see the video |
@fukemy I've added support for background dimming. Blur is not yet supported. |
PopupWindow
allows dimming background, but it's a bit difficult do so and doesn't animate in sync with entry/exist transitions. Providing a first-class API for doing it would be sweet.The text was updated successfully, but these errors were encountered: