단순하게 생성자쪽 인자에 넣으면 될줄 알았는데 아니네? 빌드 오류나서 찾아보니
https://github.com/googlesamples/android-architecture-components/issues/421
생성자 밖에 넣으라고 함 +_+)b
@Entity(tableName = "myFavorite")
data class MyFavorite (
val name: String,
val url: String = "",
val folder: String = "",
val favType: Int = T_DEFAULT,
val date: Long = System.currentTimeMillis(),
@PrimaryKey(autoGenerate = true)
val _id: Int = 0
) : IRecyclerDiff, IRecyclerItem {
@Ignore
var pos: Int = 0
companion object {
const val T_DEFAULT = 0
const val T_FOLDER = 1
}
override fun compare(item: IRecyclerDiff) = this._id == (item as MyFavorite)._id
override fun type() = favType
}
https://github.com/googlesamples/android-architecture-components/issues/421
생성자 밖에 넣으라고 함 +_+)b
@Entity(tableName = "myFavorite")
data class MyFavorite (
val name: String,
val url: String = "",
val folder: String = "",
val favType: Int = T_DEFAULT,
val date: Long = System.currentTimeMillis(),
@PrimaryKey(autoGenerate = true)
val _id: Int = 0
) : IRecyclerDiff, IRecyclerItem {
@Ignore
var pos: Int = 0
companion object {
const val T_DEFAULT = 0
const val T_FOLDER = 1
}
override fun compare(item: IRecyclerDiff) = this._id == (item as MyFavorite)._id
override fun type() = favType
}
'Android' 카테고리의 다른 글
android q (0) | 2019.04.08 |
---|---|
Android + Jenkins + macOs (0) | 2019.04.03 |
kotlin xml (mvvm) 내에 string 이용 방법 (0) | 2019.01.15 |
kotlin mvvm 그리고 Any? (0) | 2019.01.15 |
어찌 하다보니 usb cam 앱을 수정하는 일을 접했는데 (0) | 2019.01.08 |