GithubHelp home page GithubHelp logo

Comments (6)

chazhenry avatar chazhenry commented on July 19, 2024

Yes, would love to apply a mask programmatically as well as turn on/off showing the full image behind.

from android_maskable_layout.

christophesmet avatar christophesmet commented on July 19, 2024

You can change the mask with the function setMask();
Does this answer your question ?

from android_maskable_layout.

chazhenry avatar chazhenry commented on July 19, 2024

Partly. If I understand, you could declare a MaskableFrameLayout and then using the overloaded setMask method, give it a drawable to mask. How would you 'unset' it and let the original view show through? I tried setMask(null) and setMask(0). Both seem to just log the exception. Thanks for putting this component out there. Very useful in my app.

from android_maskable_layout.

christophesmet avatar christophesmet commented on July 19, 2024

Ah, yes. That is true.
You can either add an enabled state.
Or make it possible to add the mask as a bitmap.
If the bitmap mask is null. It should just draw it without any masking.
I would suggest keeping a boolean "mEnabled" and toggling it.
In the dispatchDraw then check it.
Feel free to submit a pull request :)
I'm looking forward to it !

from android_maskable_layout.

chazhenry avatar chazhenry commented on July 19, 2024

I did some testing but unfortunately the mask won't work for VideoView. I'm trying to have two masks that create a two video horizontal split-screen effect [ A | B ] and to slide a video behind each mask. I created a simple test case which works for images but it has no masking effect on ViewView. Is that a known limitation?

from android_maskable_layout.

christophesmet avatar christophesmet commented on July 19, 2024

The VideoView is backed by the hardware.
This only works for software layers.
If you want to use hardware layer then use shaders.
This is not a bug, and will never be possible.

from android_maskable_layout.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.