Use inline instead of enum to be in conformity with Android's requirement

This commit is contained in:
Him188 2019-11-25 15:14:38 +08:00
parent 7e55c6f342
commit aeeb3a26e2

View File

@ -44,9 +44,11 @@ data class Profile(
/**
* 性别
*/
enum class Gender {
SECRET,
MALE,
FEMALE;
*/ // 在 Android 中 enum 的使用被严格控制.
inline class Gender(val value: Byte) {
companion object {
val SECRET = Gender(0)
val MALE = Gender(2)
val FEMALE = Gender(1)
}
}