-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Kotlin version updated
- Loading branch information
Showing
23 changed files
with
1,391 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
library/src/main/java/com/kodmap/app/library/constant/ZoomType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.kodmap.app.library.constant | ||
|
||
object ZoomType { | ||
const val DEFAULT_MAX_SCALE = 3.0f | ||
const val DEFAULT_MID_SCALE = 1.75f | ||
const val DEFAULT_MIN_SCALE = 1.0f | ||
const val DEFAULT_ZOOM_DURATION = 200 | ||
|
||
const val EDGE_NONE = -1 | ||
const val EDGE_LEFT = 0 | ||
const val EDGE_RIGHT = 1 | ||
const val EDGE_BOTH = 2 | ||
const val SINGLE_TOUCH = 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
library/src/main/java/com/kodmap/app/library/ui/zoomableImaveView/Compat.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.kodmap.app.library.ui.zoomableImaveView | ||
|
||
import android.annotation.TargetApi | ||
import android.os.Build.VERSION | ||
import android.os.Build.VERSION_CODES | ||
import android.view.View | ||
|
||
internal object Compat { | ||
|
||
private val SIXTY_FPS_INTERVAL = 1000 / 60 | ||
|
||
fun postOnAnimation(view: View, runnable: Runnable) { | ||
if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN) { | ||
postOnAnimationJellyBean(view, runnable) | ||
} else { | ||
view.postDelayed(runnable, SIXTY_FPS_INTERVAL.toLong()) | ||
} | ||
} | ||
|
||
@TargetApi(16) | ||
private fun postOnAnimationJellyBean(view: View, runnable: Runnable) { | ||
view.postOnAnimation(runnable) | ||
} | ||
} |
Oops, something went wrong.