-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from fornewid/issues/#30_light_source
Library: Supports LightSource (#30)
- Loading branch information
Showing
15 changed files
with
175 additions
and
14 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,39 @@ | ||
package soup.neumorphism | ||
|
||
import androidx.annotation.IntDef | ||
import androidx.annotation.RestrictTo | ||
|
||
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) | ||
@IntDef( | ||
LightSource.LEFT_TOP, | ||
LightSource.LEFT_BOTTOM, | ||
LightSource.RIGHT_TOP, | ||
LightSource.RIGHT_BOTTOM | ||
) | ||
@Retention(AnnotationRetention.SOURCE) | ||
annotation class LightSource { | ||
companion object { | ||
const val LEFT_TOP = 0 | ||
const val LEFT_BOTTOM = 1 | ||
const val RIGHT_TOP = 2 | ||
const val RIGHT_BOTTOM = 3 | ||
|
||
const val DEFAULT = LEFT_TOP | ||
|
||
fun isLeft(@LightSource lightSource: Int): Boolean { | ||
return lightSource == LEFT_TOP || lightSource == LEFT_BOTTOM | ||
} | ||
|
||
fun isTop(@LightSource lightSource: Int): Boolean { | ||
return lightSource == LEFT_TOP || lightSource == RIGHT_TOP | ||
} | ||
|
||
fun isRight(@LightSource lightSource: Int): Boolean { | ||
return lightSource == RIGHT_TOP || lightSource == RIGHT_BOTTOM | ||
} | ||
|
||
fun isBottom(@LightSource lightSource: Int): Boolean { | ||
return lightSource == LEFT_BOTTOM || lightSource == RIGHT_BOTTOM | ||
} | ||
} | ||
} |
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
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
Oops, something went wrong.