Coder Social home page Coder Social logo

Comments (5)

santalu avatar santalu commented on May 23, 2024 1

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.

MeinLieberScholli avatar MeinLieberScholli commented on May 23, 2024

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.

MeinLieberScholli avatar MeinLieberScholli commented on May 23, 2024

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.

santalu avatar santalu commented on May 23, 2024

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.

MeinLieberScholli avatar MeinLieberScholli commented on May 23, 2024

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 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.