Giter VIP home page Giter VIP logo

scale-imageview-android's People

Contributors

matabii avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scale-imageview-android's Issues

Image don't fit screen

Hello! I have been testing your code and I'm not able to found why my image don't fit all the screen.

On both orientations i have on sides i.e: horizontal, i have white space west and east sides.. i want the images takes all the available spaces.
Hope you can help me! Great work!

Compatibility with a ViewPager

First of all, thanks for the nice widget! There is a problem though when using the ScaleImageView with a ViewPager, weird things happen because the pager feeds unexpected values to the setFrame method. The problems is fixed in the code below.

protected boolean setFrame(int l, int t, int r, int b) {
    mWidth = r - l;
    mHeight = b - t;

    mMatrix.reset();

    /* When using this with a ViewPager, r can be for example -960 while l is -1440.
     * This is totally uncool, so we should make sure that the values are within
     * the screen size limits when used for other calculations. 
     */
    int r_norm = r - l;
    mScale = (float) r_norm / (float) mIntrinsicWidth;
    int paddingHeight = 0;
    int paddingWidth = 0;
    // scaling vertical
    if (mScale * mIntrinsicHeight > mHeight) {
        mScale = (float) mHeight / (float) mIntrinsicHeight;
        mMatrix.postScale(mScale, mScale);
        paddingWidth = (r_norm - mWidth) / 2;
        paddingHeight = 0;
        // scaling horizontal
    } else {
        mMatrix.postScale(mScale, mScale);
        paddingHeight = (b - mHeight) / 2;
        paddingWidth = 0;
    }
    mMatrix.postTranslate(paddingWidth, paddingHeight);

    setImageMatrix(mMatrix);
    mMinScale = mScale;
    zoomTo(mScale, mWidth / 2, mHeight / 2);
    cutting();
    return super.setFrame(l, t, r, b);
}

Some images were slightly zoomed in (scale of 1.2) on load

I wanted it to be of zoom scale 1 on load (so it looks exactly like ImageView) but on some images (depending on width to height ratio) it is zoomed slightly so can't see the whole image until manually zoom out by pinching the image.

I'm still debugging on where the calculation went wrong but haven't got an answer yet. If someone have please let me know thanks!

No license specified

Without a license, your project risks not being usable by others. Please help out those of us who don't want to give lawyers more business than they need by selecting an appropriate license. The MIT license, the Apache License, the BSD License, the Microsoft Public License -- they all seem like good candidates.

How to enable and disable zoom functionality?

Hi, I am glad to have found out this project here. This is not an issue, it's more like I want to know the way to enable or disable ScaleImageview programmatically. Is it possible?

Image is not loaded with Picasso.

Hi,
I have checked your app it's working properly when image load from drawable or assign directly, but it's not working when I have used Picasso for a loading image.

ScaleImageView imgPhotoView = (ScaleImageView) findViewById(R.id.activity_photo_view_img);
Picasso.with(this).load(photoURL).fit().centerInside().into(imgPhotoView);

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.