728x90 Android22 [Android] menu 를 가진 layout 의 item 색상 변경 BottomNavigationView 혹은 NavigationView 등 menu 의 아이템을 가진 Layout 들의 아이템 색상을 변경할 수 있다. app:itemIconTint - 아이템의 아이콘 색상 지정 - xml 을 통해 check/uncheck 상태에 따라 색상을 나눌 수 있다. app:itemTextColor - 아이템의 글자 색상 지정 - xml 을 통해 check/uncheck 상태에 따라 색상을 나눌 수 있다. Exam 아래의 xml 을 지정해주면 check/uncheck 상태에 따라 색상을 나눌 수 있다. @color/colorCheck 2020. 12. 10. [Context] Fragment 에서 context 와 requireContext context /** * Return the {@link Context} this fragment is currently associated with. * * @see #requireContext() */ @Nullable public Context getContext() { return mHost == null ? null : mHost.getContext(); } requireContext /** * Return the {@link Context} this fragment is currently associated with. * * @throws IllegalStateException if not currently associated with a context. * @see #getContext() .. 2020. 12. 10. [Android] Room Database 튜토리얼 + MVVM + Repository(with kotlin) 지난번 Realm Database 에 대해서 알아보았고, 이번에는 Room Database 에 대해서 알아보겠습니다. 아래 예제는 구글 코드랩을 따라하며 만들어보았습니다. 아래는 Room Database 흐름의 구조입니다. Gradle 설정 build.gradle(Module) 파일에 아래 종속성 추가 plugins { id 'com.android.application' id 'kotlin-android' id 'kotlin-kapt' } android { compileSdkVersion 30 buildToolsVersion "30.0.2" defaultConfig { applicationId "com.thkim.roomdbtest" minSdkVersion 21 targetSdkVersion 30 ve.. 2020. 12. 8. RecyclerView - item 위치 찾기 lastVisibleItemPosition = (recyclerView.layoutManager as LinearLayoutManager) .findFirstVisibleItemPosition() lastVisibleItemPosition = (recyclerView.layoutManager as LinearLayoutManager) .findLastVisibleItemPosition() lastVisibleItemPosition = (recyclerView.layoutManager as LinearLayoutManager) .findFirstCompletelyVisibleItemPosition() lastVisibleItemPosition = (recyclerView.layoutManager as Li.. 2020. 12. 8. 이전 1 2 3 4 5 6 다음 728x90