일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
- View
- activity
- onLayout
- 안드로이드
- hilt
- lifecycle
- LiveData
- room
- HTTP
- Behavior
- kotlin
- BOJ
- CoordinatorLayout
- Algorithm
- DataBinding
- 알고리즘
- 코틀린
- AppBarLayout
- notification
- onMeasure
- 백준
- CollapsingToolbarLayout
- Coroutine
- Android
- recyclerview
- ViewModel
- Navigation
- 알림
- CustomView
- sqlite
- Today
- Total
목록전체 글 (212)
개발일지

Android Google Map을 활용하여 간단하게 즐겨찾기 기능을 구현했습니다. 1. Application 등록 아래 사이트에 들어가서 Application을 등록한다. https://console.cloud.google.com/?hl=ko Google Cloud Platform 하나의 계정으로 모든 Google 서비스를 Google Cloud Platform을 사용하려면 로그인하세요. accounts.google.com 2. Google Map API 등록 API 서비스 -> API 라이브러리로 가서 Maps SDK for Android를 등록한다. => API Key가 발급된다. 3. API KEY 등록 AndroidMenifest.xml에 application사이에 를 통해서 KEY를 등록한다...

Bridge Android에서 WebView를 통해 Android와 Web간의 통신을 도와주는 기능이다. WebView에 addJavascriptInterface 기능을 통해 JavaScript 구문을 넣을 수 있으며, loadUrl 기능을 통해 JavaScript 구문을 실행할 수 있다. WebView 주의 사항 : 같은 이름으로 Bridge를 추가한 경우 기존의 Bridge가 제거된다. @SuppressLint("SetJavaScriptEnabled") class JavaScriptWebView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0, defStyleRes: Int = 0..

Flow Flow는 Coroutine에서 여러 값을 순차적으로 보내는 유형입니다. Jetpack에서도 많이 쓰이는 유형이고, Iterator와 비슷하며 map, filter등 람다 함수를 지원하면서 suspend 함수에서 쓰이기 때문에 비동기 처리에 효율적입니다. Flow 구성 Producer : Flow Builder에서 비동기적으로 데이터를 생산한다. Intermediary : Stream에서 보내는 데이터를 소비하지 않고 수정한다. Consumer : 값을 사용한다. Producer Flow Builder를 통해 만든다. flow, channelFlow등 다양한 함수가 존재한다. Builder를 통해 Data를 만들고 emit을 통해 Data를 전달한다. Consume하는 함수가 수행될 때마다 Fl..

Context (맥락) Android Developer Interface to global information about an application environment. This is an abstract class whose implementation is provided by the Android system. It allows access to application-specific resources and classes, as well as up-calls for application-level operations such as launching activities, broadcasting and receiving intents, etc. 번역 응용 프로그램 환경에 대한 글로벌 정보에 대한 인터..

Constraint Layout RelativeLayout를 상속받은 Layout으로 Constraint를 통해 RelativeLayout의 기능을 모두 사용할 수 있고, Chain 기능을 사용하여 LinearLayout의 기능, Radio, Percent 기능을 사용하여 PercentLayout의 기능을 사용할 수 있습니다. ConstraintLayout이 다양한 기능을 제공하기 때문에 중첩 Layout을 사용해야 구현할 수 있던 상황에도 ConstraintLayout을 통해 Layout의 수와 Depth를 줄일 수 있기 때문에 성능면에서도 우수합니다. dependencies implementation 'androidx.constraintlayout:constraintlayout:2.0.4' Const..
ItemTouchHelper는 RecyclerView의 제스쳐를 쉽게 도와준다. (좌우 스와이프, 위아래 이동 등) 하지만 특정 Holder에 대해서 제스쳐를 허용하고 싶지 않을 때가 있다. getSwipeDirs를 override하여 허용하지 않을 Holder에 대해 ACTION_STATE_IDLE(0)를 반환한다. override fun getSwipeDirs(recyclerView: RecyclerView, viewHolder: ViewHolder): Int { return if (condition) { ItemTouchHelper.ACTION_STATE_IDLE } else { super.getSwipeDirs(recyclerView, viewHolder) } }

OnTouchListener OnTouchListener는 터치가 발생했을 때 이벤트를 수신한다. 터치가 발생했을 때 MotionEvent가 발생하고 MotionEvent를 통해 터치한 손가락의 수, 각 터치별 위치, 손가락이 터치할 때, 손가락을 뗐을 때 등의 이벤트를 수신할 수 있다. 이러한 이벤트를 바탕으로 View를 드래그, 축소/확대, 회전등을 할 수 있다. Action MotionEvent의 action에는 비트 마스크 형식으로 Action, Touch Index 등 여러 정보를 저장하고 있다. action과 MotionEvent.ACTION_MASK를 통해 터치의 ACTION을 구할 수 있고, actionMasked를 통해 바로 ACTION을 구할 수 있다. ACTION_DOWN : 처음으로..

Notification Custom 사용자가 직접 Layout을 구성하여 RemoteView를 통해 Nofitication 템플릿을 만들 수 있습니다. * 보통 축소된 Notification은 64dp, 확장된 Notification은 256dp로 제한됩니다. RemoteViews를 만들고setCustomContentView를 통해 적용할 수 있다. * 확장된 CustomContentView는 setCustomBigContentView를 통해 적용할 수 있다. private fun createCustomContentView(): RemoteViews { return RemoteViews(context.packageName, R.layout.notification_content_view).apply { s..