forked from inorichi/subsampling-scale-image-view
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add rotation support back in from the parent repo (#5)
- SSIV has an imageRotation field that can be changed, no EXIF parsing is done
- Loading branch information
1 parent
b8e1b0e
commit faa0a72
Showing
4 changed files
with
115 additions
and
17 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
library/src/main/java/com/davemorrissey/labs/subscaleview/ImageRotation.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,12 @@ | ||
package com.davemorrissey.labs.subscaleview | ||
|
||
enum class ImageRotation(val rotation: Int) { | ||
ROTATION_0(0), ROTATION_90(90), ROTATION_180(180), ROTATION_270(270); | ||
|
||
fun rotateBy90Degrees(): ImageRotation = when (this) { | ||
ROTATION_0 -> ROTATION_90 | ||
ROTATION_90 -> ROTATION_180 | ||
ROTATION_180 -> ROTATION_270 | ||
ROTATION_270 -> ROTATION_0 | ||
} | ||
} |
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