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(
/** /**
* 性别 * 性别
*/ */ // 在 Android 中 enum 的使用被严格控制.
enum class Gender { inline class Gender(val value: Byte) {
SECRET, companion object {
MALE, val SECRET = Gender(0)
FEMALE; val MALE = Gender(2)
val FEMALE = Gender(1)
}
} }