Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kotlin 빌드 가능하게 추가, data package kotlin 으로 치환 #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tonyjs
Copy link

@tonyjs tonyjs commented Jul 21, 2017

kotlin 빌드와 관련된 gradle 파일 수정
data package 수정

kotlin 빌드와 관련된 gradle 파일 수정
data package 수정
@chonamdoo
Copy link

오 고수님 코드 잘봤습니다

@tonyjs
Copy link
Author

tonyjs commented Jul 21, 2017

@chonamdoo 에이 고수라뇨 ㅋㅋㅋ 거의 변환 수준인데요 뭐 ㅜㅜ

@Insert(onConflict = OnConflictStrategy.REPLACE)
abstract fun saveMovies(movieEntities: Array<MovieEntity>)
// fun saveMovies(vararg movieEntities: MovieEntity)
// abstract fun saveMovies(movieEntities: Lit<MovieEntity>) // can not compile
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저도 동일하게 에러가나서 찾아보고있는 중인데,
앱 클리어하고 나서 될떄가 있고, 안될때가 있고... 왔다갔다 하네요

 - fix aac version 1.0.0-alpha1 to 1.0.0-alpha5
 - fix MovieDao.saveMovies parameter array to list
   (https://issuetracker.google.com/issues/62259820)
@tonyjs
Copy link
Author

tonyjs commented Jul 22, 2017

@Pluu aac version alpha3 에서 해결된 이슈였네요. iteraable parameter 가 지원이 안됐었나봐요. https://developer.android.com/topic/libraries/architecture/release-notes.html#100_alpha_3_-_june_15_2017
이슈 : https://issuetracker.google.com/issues/62259820

 - avoid access abstract method on init.
}

@get:Synchronized
val asLiveData: LiveData<Resource<ResultType>> by lazy {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

init 구문에서 abstract 메소드에 접근하면 안되서 회피로직을 적용해봤어요.

관련 워닝

abstract class Base {
    val code = calculate()
    abstract fun calculate(): Int
}

class Derived(private val x: Int) : Base() {
    override fun calculate() = x
}

@Test
fun testIt() {
    println(Derived(42).code) // Expected: 42, actual: 0
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이렇게 되버리면 처음 호출될때의 값으로 정해져서 원하던 결과가 안나오지 않을까요??

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@get:Synchronized 라는건 처음봤네요 +ㅁ+

@@ -46,19 +52,25 @@ dependencies {

compile rootProject.ext.roomRuntime
annotationProcessor rootProject.ext.roomCompiler
kapt rootProject.ext.roomCompiler
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

memo: 같이 적어주지 않으면 room 사용 시 오류나므로 추가

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants