{"id":13396272,"url":"https://github.com/MikeOrtiz/TouchImageView","last_synced_at":"2025-03-13T22:31:56.123Z","repository":{"id":1680253,"uuid":"2407497","full_name":"MikeOrtiz/TouchImageView","owner":"MikeOrtiz","description":"Adds touch functionality to Android ImageView.","archived":false,"fork":false,"pushed_at":"2024-09-30T06:44:28.000Z","size":9972,"stargazers_count":2736,"open_issues_count":22,"forks_count":865,"subscribers_count":97,"default_branch":"master","last_synced_at":"2024-10-29T15:34:12.141Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MikeOrtiz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-09-18T00:56:01.000Z","updated_at":"2024-10-27T14:15:20.000Z","dependencies_parsed_at":"2023-01-16T18:30:24.761Z","dependency_job_id":"f257375a-ec03-4e1e-bc23-51bb64959d9a","html_url":"https://github.com/MikeOrtiz/TouchImageView","commit_stats":{"total_commits":527,"total_committers":31,"mean_commits":17.0,"dds":0.5844402277039848,"last_synced_commit":"28964f46695df2128d11a56daded62d4ff8db272"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MikeOrtiz%2FTouchImageView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MikeOrtiz%2FTouchImageView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MikeOrtiz%2FTouchImageView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MikeOrtiz%2FTouchImageView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MikeOrtiz","download_url":"https://codeload.github.com/MikeOrtiz/TouchImageView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243165504,"owners_count":20246722,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T18:00:43.564Z","updated_at":"2025-03-13T22:31:55.516Z","avatar_url":"https://github.com/MikeOrtiz.png","language":"Kotlin","readme":"[![](https://jitpack.io/v/MikeOrtiz/TouchImageView.svg)](https://jitpack.io/#hannesa2/TouchImageView)\n\n# TouchImageView for Android\n\n## Capabilities\n\nTouchImageView extends ImageView and supports all of ImageView’s functionality. In addition, TouchImageView adds pinch zoom, dragging, fling, double tap zoom functionality and other animation polish. The intention is for TouchImageView to  mirror as closely as possible the functionality of zoomable images in Gallery apps.\n\n## Download \nRepository available on https://jitpack.io/#MikeOrtiz/TouchImageView\n\n```Gradle\nallprojects {\n    repositories {\n        ...\n        maven { url 'https://jitpack.io' }\n    }\n}\n```\n```Gradle\ndependencies {\n    implementation 'com.github.MikeOrtiz:TouchImageView:1.4.1' // last SupportLib version\n    // or\n    implementation 'com.github.MikeOrtiz:TouchImageView:$LAST_VERSION' // Android X\n}\n\n```\n\n## Examples\n\nPlease view the sample app which includes examples of the following functionality:\n\n#### Single TouchImageView\n\nBasic use of a single TouchImageView. Includes usage of `OnTouchImageViewListener`, `getScrollPosition()`, `getZoomedRect()`, `isZoomed()`, and `getCurrentZoom()`.\n\n#### ViewPager Example\n\nTouchImageViews placed in a ViewPager like the Gallery app.\n\n#### Mirroring Example\n\nMirror two TouchImageViews using `onTouchImageViewListener` and `setZoom()`.\n\n#### Switch Image Example\n\nClick on TouchImageView to cycle through images. Note that the zoom state is maintained though the images are switched.\n\n#### Switch ScaleType Example\n\nClick on TouchImageView to cycle through supported ScaleTypes.\n\n#### Resize Example\n\nClick on the arrow buttons to change the shape and size of the TouchImageView. See how the view looks when it shrinks with various \"resize\" settings. Read ChangeSizeExampleActivity.java's comment for advice on how to set up a TouchImageView that's going to be resized.\n\n## Limitations\n\nTouchImageView does not yet support pinch image rotation. Also, `FIT_START` and `FIT_END` scaleTypes are not yet supported.\n\t    \n## API\n\nGet the current zoom. This is the zoom relative to the initial scale, not the original resource.\n\n    float getCurrentZoom();\n\nGet the max zoom multiplier.\n\n    float getMaxZoom();\n\nGet the min zoom multiplier.\n\n    float getMinZoom();\n\nReturn the point at the center of the zoomable image. The `PointF` coordinates range in value between 0 and 1 and the focus point is denoted as a fraction from the left and top of the view. For example, the top left corner of the image would be (0, 0). And the bottom right corner would be (1, 1).\n\n    PointF getScrollPosition();\n\nReturn a `RectF` representing the zoomed image.\n\n    RectF getZoomedRect();\n\nReturns `false` if image is in initial, unzoomed state. `True`, otherwise.\n\n    boolean isZoomed();\n\nReset zoom and translation to initial state.\n\n    void resetZoom();\n\nSet the max zoom multiplier. Default value is 3.\n\n    void setMaxZoom(float max);\n\nSet the min zoom multiplier. Default value is 1. Set to `TouchImageView.AUTOMATIC_MIN_ZOOM` to make it possible to see the whole image.\n\n    void setMinZoom(float min);\n    \nSet the max zoom multiplier to stay at a fixed multiple of the min zoom multiplier.\n\n    void setMaxZoomRatio(float max);\n\nSet the focus point of the zoomed image. The focus points are denoted as a fraction from the left and top of the view. The focus points can range in value between 0 and 1.\n\n    void setScrollPosition(float focusX, float focusY);\n\nSet zoom to the specified scale. Image will be centered by default.\n\n    void setZoom(float scale);\n\nSet zoom to the specified scale. Image will be centered around the point (focusX, focusY). These floats range from 0 to 1 and denote the focus point as a fraction from the left and top of the view. For example, the top left corner of the image would be (0, 0). And the bottom right corner would be (1, 1).\n\n    void setZoom(float scale, float focusX, float focusY);\n\nSet zoom to the specified scale. Image will be centered around the point (focusX, focusY). These floats range from 0 to 1 and denote the focus point as a fraction from the left and top of the view. For example, the top left corner of the image would be (0, 0). And the bottom right corner would be (1, 1).\n\n    void setZoom(float scale, float focusX, float focusY, ScaleType scaleType);\n\nSet zoom parameters equal to another `TouchImageView`. Including scale, position, and `ScaleType`.\n\n    void setZoom(TouchImageView img);\n    \nSet which part of the image should remain fixed if the TouchImageView is resized.\n    \n    setViewSizeChangeFixedPixel(FixedPixel fixedPixel)\n    \nSet which part of the image should remain fixed if the screen is rotated.\n\n    setOrientationChangeFixedPixel(FixedPixel fixedPixel)\n\n## License\n\nTouchImageView is available under the MIT license. See the LICENSE file for more info.\n","funding_links":[],"categories":["Index `(light-weight pages)`","Libraries","Kotlin","Index","Libs","etc"],"sub_categories":["\u003cA NAME=\"Widget\"\u003e\u003c/A\u003eWidget"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMikeOrtiz%2FTouchImageView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMikeOrtiz%2FTouchImageView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMikeOrtiz%2FTouchImageView/lists"}