Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

设置缩放级别时,添加参数用来控制是否需要立刻缩放控件 #227

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions library/src/main/java/com/otaliastudios/zoom/ZoomApi.kt
Expand Up @@ -418,7 +418,7 @@ interface ZoomApi {
*
* @param maxZoom the max zoom
*/
fun setMaxZoom(@Zoom maxZoom: Float) {
fun setMaxZoom(@Zoom maxZoom: Float,scaleView:Boolean = true) {
setMaxZoom(maxZoom, TYPE_ZOOM)
}

Expand All @@ -432,7 +432,7 @@ interface ZoomApi {
* @see zoom
* @see realZoom
*/
fun setMaxZoom(maxZoom: Float, @ZoomType type: Int)
fun setMaxZoom(maxZoom: Float, @ZoomType type: Int,scaleView:Boolean = true)

/**
* Get the currently allowed min zoom.
Expand All @@ -459,7 +459,7 @@ interface ZoomApi {
*
* @param minZoom the min zoom
*/
fun setMinZoom(@Zoom minZoom: Float) {
fun setMinZoom(@Zoom minZoom: Float,scaleView:Boolean = true) {
setMinZoom(minZoom, TYPE_ZOOM)
}

Expand All @@ -473,7 +473,7 @@ interface ZoomApi {
* @see zoom
* @see realZoom
*/
fun setMinZoom(minZoom: Float, @ZoomType type: Int)
fun setMinZoom(minZoom: Float, @ZoomType type: Int,scaleView:Boolean = true)

/**
* Sets the duration of animations triggered by zoom and pan APIs.
Expand Down
8 changes: 4 additions & 4 deletions library/src/main/java/com/otaliastudios/zoom/ZoomEngine.kt
Expand Up @@ -854,9 +854,9 @@ constructor(context: Context) : ZoomApi {
*
* @see ZoomApi.TYPE_REAL_ZOOM
*/
override fun setMaxZoom(maxZoom: Float, @ZoomType type: Int) {
override fun setMaxZoom(maxZoom: Float, @ZoomType type: Int,scaleView:Boolean) {
zoomManager.setMaxZoom(maxZoom, type)
if (zoom > zoomManager.getMaxZoom()) {
if (zoom > zoomManager.getMaxZoom() && scaleView) {
realZoomTo(zoomManager.getMaxZoom(), animate = true)
}
}
Expand Down Expand Up @@ -889,9 +889,9 @@ constructor(context: Context) : ZoomApi {
* @see ZoomApi.zoom
* @see ZoomApi.realZoom
*/
override fun setMinZoom(minZoom: Float, @ZoomType type: Int) {
override fun setMinZoom(minZoom: Float, @ZoomType type: Int,scaleView:Boolean = true) {
zoomManager.setMinZoom(minZoom, type)
if (realZoom <= zoomManager.getMinZoom()) {
if (realZoom <= zoomManager.getMinZoom() && scaleView) {
realZoomTo(zoomManager.getMinZoom(), animate = true)
}
}
Expand Down