Comments (5)
Hi. I made the calculation in onLayout()
method that's why. I did the necessary improvements. New usage is like this:
imageView.setPosition(DiagonalImageView.BOTTOM)
.setDirection(DiagonalImageView.RIGHT)
.setOverlap(300)
.invalidate();
invalidate()
method immediately generates clipPath with provided parameters.
I'll create a pre release asap. Please give me feedback after trying this. Thanks in advance.
from diagonal-imageview.
Also, setPosition and setDirection like they are now, are not working because the Path is not updated.
It should look like this:
public void setOverlap(int overlap) {
if (this.overlap != overlap) {
this.overlap = overlap;
setClipPath(getWidth(), getHeight());
this.postInvalidate();
}
}
from diagonal-imageview.
Thanks for the update. But what about the issue that all set Methods are not working, because the Path is not updated.
Am i missing something?
from diagonal-imageview.
Hi, thanks for the feedback. I see all set methods working from examples.
Can you please give me some more details about what exactly are you trying?
from diagonal-imageview.
Well, your example is working because you are not really using the set methods.
For example...
In the RecyclerViewSampleActivity in the bind method of the ViewHolder you are setting the position. And it works, but only because the ClipPath is generated afterwards.
If you add image.setOverlap(35);
after line 80 in the RecyclerViewSampleActivity and click on any image... you will realize that the ClipPath is only reseted, but not updated.
That's why i proposed the code above.
Btw, getOverlap method is missing.
from diagonal-imageview.
Related Issues (6)
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 diagonal-imageview.