-
-
Notifications
You must be signed in to change notification settings - Fork 585
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 #2245 from marunjar/shape_enum
Shape enum
- Loading branch information
Showing
4 changed files
with
106 additions
and
72 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package fr.neamar.kiss.utils; | ||
|
||
import androidx.annotation.NonNull; | ||
|
||
public enum IconShape { | ||
|
||
SHAPE_SYSTEM(0), | ||
SHAPE_CIRCLE(1), | ||
SHAPE_SQUARE(2), | ||
SHAPE_SQUIRCLE(3), | ||
SHAPE_ROUND_RECT(4), | ||
SHAPE_TEARDROP_BR(5), | ||
SHAPE_TEARDROP_BL(6), | ||
SHAPE_TEARDROP_TL(7), | ||
SHAPE_TEARDROP_TR(8), | ||
SHAPE_TEARDROP_RND(9), | ||
SHAPE_HEXAGON(10), | ||
SHAPE_OCTAGON(11); | ||
|
||
private final int id; | ||
|
||
IconShape(int id) { | ||
this.id = id; | ||
} | ||
|
||
@NonNull | ||
public static IconShape valueById(int shapeId) { | ||
for (IconShape shape : values()) { | ||
if (shape.getId() == shapeId) { | ||
return shape; | ||
} | ||
} | ||
return SHAPE_SYSTEM; | ||
} | ||
|
||
public int getId() { | ||
return id; | ||
} | ||
|
||
} |