본문 바로가기

메모 log (간단메모)/mobile12

resource 색상 가져오기 .setColorFilter(ContextCompat.getColor(requireActivity(), R.color.colorPrimaryDark)) 기존 getColor(R.color.PrimaryDark)의 경우 deprecated 2020. 4. 21.
'Event 등록' ACC 1. Event 클래스 등록 import androidx.lifecycle.Observer /** * Used as a wrapper for data that is exposed via a LiveData that represents an event. */ open class Event(private val content: T) { @Suppress("MemberVisibilityCanBePrivate") var hasBeenHandled = false private set // Allow external read but not write /** * Returns the content and prevents its use again. */ fun getContentIfNotHandled(): T? { r.. 2020. 3. 18.
'stetcho' 디버깅 /*gradle 기본추가*/ implementation 'com.facebook.stetho:stetho:1.5.1' /*gradle 네트워크 관련 추가*/ implementation 'com.facebook.stetho:stetho-okhttp3:1.5.1' implementation 'com.facebook.stetho:stetho-urlconnection:1.5.1' /*application 한줄 추가*/ override fun onCreate() { super.onCreate() Stetho.initializeWithDefaults(this) } Stetho by facebook http://facebook.github.io/stetho/ 네트워크 / 로컬 데이터 / 화면 등에 대한 정확성 또는 .. 2020. 3. 1.
'ForeignKey' 참고사항 @Entity(tableName = "tb_picture", indices = arrayOf(Index(value = arrayOf("id"))), foreignKeys = arrayOf(ForeignKey( entity = Task::class, parentColumns = arrayOf("id"), childColumns = arrayOf("id"), onUpdate = ForeignKey.CASCADE, onDelete = ForeignKey.CASCADE )) ) 자식 테이블에 인덱스 작성 부모 테이블이 수정될 경우 전체 테이블 스캔을 피하기 위해서 *인덱스가 없는 경우 RoomWarnings 경고 출력 관련 제약 조건 No Action (value: 1): default, 아무 것도 하지 않음 .. 2020. 2. 22.