전체 글

    Android Kotlin Coroutine을 통한 비동기 처리의 개념과 사용 예시

    Coroutine Android Developer에선 Android의 Kotlin Coroutine을 다음과 같이 설명하고 있습니다. 비동기적으로 실행되는 코드를 간소화하기 위해 Android에서 사용할 수 있는 동시 실행 설계 패턴 Coroutine은 Android의 비동기 프로그래밍에 권장되는 Solution입니다. 주목할 만한 4가지 기능 경량 - Coroutine을 실행 중인 스레드를 차단하지 않는 정지를 지원해 단일 스레드에서 많은 Coroutine 실행이 가능(성능적으로 매우 우수!) 메모리 누수 감소 - 구조화된 동시 실행을 사용해 범위 내 작업 실행 (AsyncTask가 deprecated된 이유 중 하나…) 기본으로 제공되는 취소 지원 - 실행 중인 Coroutine 계층 구조를 통해 자..

    커스텀다이얼로그 + RadioButton with Kotlin

    우선 CustomDialog를 디자인 할 XML을 만들어줍니다. 저는 Dialog에 RadioButton이 있고, 이 RadioButton으로 선택한 다음 확인을 누르면 그 값을 전달하게끔 설계했습니다. android:orientation="vertical" android:maxLines="1" android:paddingStart="15dp" android:paddingEnd="15dp" android:text="커스텀 다이얼로그" android:textColor="@color/black" android:textSize="17dp" android:textStyle="bold" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_to..

    웹뷰 PIP 자체 구현해보기 [ AOS 기능구현 ]

    앱 내부에서 동작하는 PIP를 구현해보았습니다. 제가 설계한 구성은 다음과 같습니다. MainActivity - ImageView(말티즈 이미지) - FragmentContainerView(웹뷰 표시할 FragmentContainer) WebviewLiveFragment - WebView(영상 스트리밍 웹뷰) *그냥 일반 웹뷰를 사용하셔도 무방합니다. - LinearLayout(PIP 제어 버튼) -- Button(Full) - 풀모드로 전환 -- Button(PIP) - PIP모드로 전환 -- Button(X) - (웹뷰 reload 기능으로 설정) 우선 저는 PIP모드를 ViewModel로 관리하기로 했습니다. class WvpipViewModel: ViewModel() { val pip: Mutab..