Comments (4)
I did some tinkering with the code, and instead of the Xtransfermode in the PromptText, I just clip the text in MaterialTapTargetPrompt class with a new property of PromptBackground that supplies the background's path. Now hardware layer works as well, and no weird effects. I would say that is a better approach.
//Draw the text
Path backgroundPath = mPromptOptions.getPromptBackground().getPath();
if (backgroundPath != null) {
canvas.save();
canvas.clipPath(backgroundPath, Region.Op.INTERSECT );
}
mPromptOptions.getPromptText().draw(canvas);
if (backgroundPath != null) {
canvas.restore();
}
I can make a more official PR for it, and testing with the other backgrounds as well and implementing the path for them.
from materialtaptargetprompt.
I created a PR, it fixes the issue. Let me know if it is acceptable or needs changing.
from materialtaptargetprompt.
Damn, seems like I only thought of my use case with that xfermode change. Sorry about that.
To fix this, keeping PorterDuff, would definitely add a lot of complexity (if fixable at all)
I looked at your PR and I do agree that this is a better approach and more bullet proof for other use cases.
from materialtaptargetprompt.
No problem, it was nice seeing someone having the same intent to fix the issue! You can't account for all cases, and I assume it worked for your case.
from materialtaptargetprompt.
Related Issues (20)
- Change opacity of background HOT 1
- NullPointerException at onAnimationEnd(MaterialTapTargetPrompt.java:529) on some devices running Android 6.0 HOT 1
- Bintray is closing any plans to publish somewher else? HOT 1
- java.lang.NullPointerException: at android.graphics.Typeface.create (Typeface.java:849) HOT 6
- JCenter shuts down in May HOT 4
- Crash on OnePlus IN2021: java.lang.NullPointerException: Attempt to read from field 'boolean android.graphics.Path.isSimplePath' on a null object reference HOT 1
- How to set target for Toolbar overflow menu HOT 1
- Jetpack Compose HOT 5
- How to adjust the spacing of secondary text lines? HOT 1
- Please how I can use it for multiple buttons HOT 1
- Show on an android.app.Dialog HOT 8
- java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.View.findViewById(int)'
- Localisation is not working in these promts.
- Sequence keep repeating in viewpager2
- The text is incorrectly positioned.
- Prompt not showing on dynamically created view
- How we can add multiple target on it. HOT 1
- Fatal Exception: java.lang.NullPointerException
- Made a space in a fullscreen.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from materialtaptargetprompt.