From 215c5236988fae2652b28abb96d3782f6c3f79f8 Mon Sep 17 00:00:00 2001 From: JVillella Date: Thu, 26 Mar 2015 14:04:22 -0400 Subject: [PATCH] Updates README --- LICENSE | 2 +- README | 117 -------------------------------------------------- README.md | 125 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 126 insertions(+), 118 deletions(-) delete mode 100644 README create mode 100644 README.md diff --git a/LICENSE b/LICENSE index f60f2124..1bb62289 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -opyright (c) 2012 Michael Ortiz +Copyright (c) 2012-2015 Michael Ortiz Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/README b/README deleted file mode 100644 index b43a8314..00000000 --- a/README +++ /dev/null @@ -1,117 +0,0 @@ -Android: TouchImageView -Created by: Mike Ortiz -Contributions by: - * Patrick Lackemacher - * Babay88 - * @ipsilondev - * hank-cp - * singpolyma - -Capabilities: ----------------------- -TouchImageView 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. - -Examples: ----------------------- -Please view the sample app which includes examples of the following functionality: --Single TouchImageview: basic use of a single TouchImageView. Includes usage - of OnTouchImageViewListener, getScrollPosition(), getZoomedRect(), isZoomed(), - and getCurrentZoom(). --ViewPager Example: TouchImageViews placed in a ViewPager like the Gallery app. --Mirroring Example: mirror two TouchImageViews using - onTouchImageViewListener and setZoom(). --Switch Image Example: Click on TouchImageView to cycle through images. Note that the - zoom state is maintained though the images are switched. --Switch ScaleType Example: Click on TouchImageView to cycle through supported ScaleTypes. - -Limitations: ----------------------- -TouchImageView does not yet support pinch image rotation. Also, FIT_START and FIT_END -scaleTypes are not yet supported. - -Support: ----------------------- -Minimum API: 8 - -Contributing: ----------------------- -Before creating an issue, please make sure that a ticket is not already open. Also, -please check that your issue has not already been fixed in the dev branch. If the -issue is reproducible on the dev branch, please provide clear repro instructions -in the issue. Last, if you’d like to contribute code, please open all pull requests -against the dev branch. - -Usage: ----------------------- -Place TouchImageView.java in your project. It can then be used the same as -ImageView. Example: - -TouchImageView img = (TouchImageView) findViewById(R.id.img); - -If you are using TouchImageView in xml, then you must provide the full package -name, because it is a custom view. Example: - - - -API: ----------------------- -// Get the current zoom. This is the zoom relative to the initial -// scale, not the original resource. -float getCurrentZoom(); - -// Get the max zoom multiplier. -float getMaxZoom(); - -// Get the min zoom multiplier. -float getMinZoom(); - -// Return 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). -PointF getScrollPosition(); - -// Return a Rect representing the zoomed image. -RectF getZoomedRect(); - -// Returns false if image is in initial, unzoomed state. False, otherwise. -boolean isZoomed(); - -// Reset zoom and translation to initial state. -void resetZoom(); - -// Set the max zoom multiplier. Default value: 3. -void setMaxZoom(float max); - -// Set the min zoom multiplier. Default value: 1. -void setMinZoom(float min); - -// Set 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. -void setScrollPosition(float focusX, float focusY); - -// Set zoom to the specified scale. Image will be centered by default. -void setZoom(float scale); - -// Set 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). -void setZoom(float scale, float focusX, float focusY); - -// Set 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). -void setZoom(float scale, float focusX, float focusY, ScaleType scaleType); - -// Set zoom parameters equal to another TouchImageView. Including scale, position, -// and ScaleType. -void setZoom(TouchImageView img); \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 00000000..61658029 --- /dev/null +++ b/README.md @@ -0,0 +1,125 @@ +#Android: TouchImageView + +Created by: Mike Ortiz +Contributions by: + * Patrick Lackemacher + * Babay88 + * @ipsilondev + * hank-cp + * singpolyma + * JVillella + +##Capabilities + +TouchImageView 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. + +##Examples + +Please view the sample app which includes examples of the following functionality: + +####Single TouchImageView + +Basic use of a single TouchImageView. Includes usage of `OnTouchImageViewListener`, `getScrollPosition()`, `getZoomedRect()`, `isZoomed()`, and `getCurrentZoom()`. + +####ViewPager Example + +TouchImageViews placed in a ViewPager like the Gallery app. + +####Mirroring Example + +Mirror two TouchImageViews using `onTouchImageViewListener` and `setZoom()`. + +####Switch Image Example + +Click on TouchImageView to cycle through images. Note that the zoom state is maintained though the images are switched. + +####Switch ScaleType Example + +Click on TouchImageView to cycle through supported ScaleTypes. + +##Limitations + +TouchImageView does not yet support pinch image rotation. Also, `FIT_START` and `FIT_END scaleTypes are not yet supported. + +##Support + +Minimum API: 8 + +##Contributing + +Before creating an issue, please make sure that a ticket is not already open. Also, please check that your issue has not already been fixed in the dev branch. If the issue is reproducible on the dev branch, please provide clear repro instructions in the issue. Last, if you’d like to contribute code, please open all pull requests against the dev branch. + +##Usage + +Place TouchImageView.java in your project. It can then be used the same as ImageView. + + TouchImageView img = (TouchImageView) findViewById(R.id.img); + +If you are using TouchImageView in XML, then you must provide the full package name, because it is a custom view. + + + +##API + +Get the current zoom. This is the zoom relative to the initial scale, not the original resource. + + float getCurrentZoom(); + +Get the max zoom multiplier. + + float getMaxZoom(); + +Get the min zoom multiplier. + + float getMinZoom(); + +Return 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). + + PointF getScrollPosition(); + +Return a `RectF` representing the zoomed image. + + RectF getZoomedRect(); + +Returns `false` if image is in initial, unzoomed state. `True`, otherwise. + + boolean isZoomed(); + +Reset zoom and translation to initial state. + + void resetZoom(); + +Set the max zoom multiplier. Default value is 3. + + void setMaxZoom(float max); + +Set the min zoom multiplier. Default value is 1. + + void setMinZoom(float min); + +Set 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. + + void setScrollPosition(float focusX, float focusY); + +Set zoom to the specified scale. Image will be centered by default. + + void setZoom(float scale); + +Set 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). + + void setZoom(float scale, float focusX, float focusY); + +Set 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). + + void setZoom(float scale, float focusX, float focusY, ScaleType scaleType); + +Set zoom parameters equal to another `TouchImageView`. Including scale, position, and `ScaleType`. + + void setZoom(TouchImageView img); + +## License + +TouchImageView is available under the MIT license. See the LICENSE file for more info. \ No newline at end of file