본문 바로가기

Project40

Android Studio, Kotlin] 6. (Open Source) Holo Color Picker 기존에 이 앱은 미리 만들어진 컬러를 추출하고, 이 컬러를 바탕으로 유사색, 보색 등에서 다양한 배리에이션을 찾아내기 위해 (+ 제가 UI 작업할 때 쓰려고) 만든 앱입니다. 그러니, 유사색과 보색을 찾기 위해서는 색을 뽑는데서 그치지 않고, 색의 배리에이션을 찾아내기 위해, HSV를 조절할 수 있어야 합니다. 그래서 찾아낸 오픈소스가 Holo Color Picker 입니다. github.com/LarsWerkman/HoloColorPicker LarsWerkman/HoloColorPicker An Android Holo themed colorpicker designed by Marie Schweiz - LarsWerkman/HoloColorPicker github.com 먼저 완성된 내용부터 보면.. .. 2021. 2. 17.
Android Studio, Kotlin] 5. 내비게이션을 ViewHolder로 만들어 여러 액티비티에서 공유하기 (특히나 대단위 프로젝트에서 필수적이고) 앱은 한 프래그먼트에서 동작하지 않는 이상, 여러 액티비티를 이용하여 동작한다. 이 액티비티에 일일히 내비게이션을 만들수도 없는 일이니, ui를 하나만 만들고, 이를 뷰홀더로 addView 시켜 동작을 하도록 한다. 먼저 layout을 xml로 만든다. - view_holder_navigation.xml 다음, 내비게이션을 붙일 액티비티에, 먼저 상단에 내비게이션을 부착할 frameLayout을 생성한다. ... frameLayout의 id를 지정해줘야, 나중에 코틀린 파일에서 이를 찾아 뷰를 attach 시킨다. 필자는 레이아웃 성격과 id를 붙이는 타입이라, frameLayoutNavigation로 설정했다. 이 때, 뷰홀더에서 만든 레이아웃 height와 액.. 2021. 2. 17.
Android Studio, Kotlin] 4. SwipeRefreshLayout, 스와이프 할 때마다 새로 갱신하는 레이아웃 SwipeRefreshLayout은 안드로이드 JetPack 내부의 라이브러리 중 하나이다. 그러나 이것은 기본적으로 의존되어있지 않기 때문에, 미리 의존성을 걸어둬야 사용할 수 있다. 앱 수준의 gradle에 먼저 implement 한다. //SwipeRefreshLayout dependencies { implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0" } developer.android.com/jetpack/androidx/releases/swiperefreshlayout?hl=ko Swiperefreshlayout | Android 개발자 | Android Developers Swiperefreshlayout 스와이프하여 새로.. 2021. 2. 8.
Android Studio, Kotlin] 3. EditText의 정수값의 범위를 제한하는 방법 RGB코드는 2진수로 이루어진 값이기 때문에 최종적으로 0~255까지의 값만 넣을 수 있다. - android.graphic.Color.rgb Return a color-int from red, green, blue components. The alpha component is implicitly 255 (fully opaque). These component values should be \([0..255]\), but there is no range check performed, so if they are out of range, the returned color is undefined. rgb 함수에서도 0-255까지로 값을 제한하고 있다. 그래서, if문으로 값을 제어한다. 제어법은 간단하다. 앞.. 2021. 1. 8.
반응형