Computer Hippocampus
  • 홈
  • 태그
  • 방명록
  • 메뉴 닫기
  • 글작성
  • 방명록
  • 환경설정
    • 분류 전체보기 (176)
      • Daily Records (0)
      • Coding Test 관련(with Kotlin) (0)
      • Android Dev (87)
        • NowInAndroid (7)
        • NaimanProject (0)
        • Compose (21)
        • Navigation (4)
        • Google Billing API (4)
        • Test Firebase Chatting App (12)
        • Login API 정리 (0)
        • Error logs (0)
      • 코틀린(Kotlin, Java) (14)
      • Swift (12)
        • codingTest (0)
      • Spring Boot (1)
      • Scala (3)
      • Js (0)
      • Programming Theory (13)
        • Functional Programming (2)
        • Design Pattern (0)
        • Generics (3)
        • 비동기 패러다임(Asynchronous Para.. (0)
        • 코루틴(Coruotine) (8)
        • Rxjava (0)
      • 파이어베이스(Firebase) (0)
      • 프로그래밍 팁 (1)
      • SystemVerilog (2)
      • Adobe (4)
        • 포토 일러스트레이터 (4)
        • Premiere pro (0)
      • Github 팁 (3)
      • RiscV (2)
        • Wake (1)
      • Linux (2)
      • CSS (4)
      • 회사 관련 (0)
  • 홈
  • 태그
  • 방명록
Android Dev/NowInAndroid

NowInAndroid(3) - (Hilt) Viewmodel + DI overall flow, 재구성 예제

1. ViewModel with Compose data flow 1> Viewmodel을 hiltViewmodel()을 통해 instance 하면 DI 를 통해 필요한 정보들을 다 끌어다와 필요한 repository와 usecases를 가져다 올 수 있다. 2> ViewModel은 repository에서 stateFlow로 가져온 데이터를 Usecase와 조합하여 ViewModel내의 stateFlow로 조합하고, call back method를 관리하기 위해 메소드를 생성한다. 3> Compose 내에서는 instance된 ViewModel의 stateFlows에 대해 collectAsStateWithLifeCycle로 ViewModelScope내에 데이터를 수집할 수 있으며 수집된 데이터를 기반으로 ..

2022. 11. 1. 17:19
Programming Theory/코루틴(Coruotine)

Coroutines guide - android coroutine API

1. snapshotFlow 1. snapshotFlow fun snapshotFlow(block: () -> T): Flow Create a Flow from observable Snapshot state. (e.g. state holders returned by mutableStateOf.) snapshotFlow creates a Flow that runs block when collected and emits the result, recording any snapshot state that was accessed. While collection continues, if a new Snapshot is applied that changes state accessed by block, the flow..

2022. 10. 30. 15:23
Android Dev/NowInAndroid

NowInAndroid(2) - ForYouViewModel

이전글 : https://witcheryoon.tistory.com/336 ViewModel을 컨트롤하는 Flow method들을 이해하면 만드는데 도움이 될 것이다. 설명페이지1 :Flow-kotlinx-coroutine-core : https://witcheryoon.tistory.com/292: 리스트 : SharedFlow / shareIn / onSubscription / conflate / stateFlow / toStates / scan / reduce / merge 0> Full code : @OptIn(SavedStateHandleSaveableApi::class) @HiltViewModel class ForYouViewModel @Inject constructor( syncStatusM..

2022. 10. 28. 01:10
CSS

고래스킨 소제목 헤더 css

.post-content h1,.post-content h2,.post-content h3,.post-content h4 { margin-bottom: 15px; margin-top: 15px; padding-left: 0.75rem; font-size: 1.25rem; font-weight: 500 !important; line-height: 1.25; word-break: normal; word-wrap: break-word; color:#000; border-left: 0px solid #aeaeae; }

2022. 10. 28. 01:07
Android Dev/NowInAndroid

collectAsStateWithLifecycle 요약

원본 페이지 : https://medium.com/androiddevelopers/consuming-flows-safely-in-jetpack-compose-cde014d0d5a3 Consuming flows safely in Jetpack Compose 1. collectAsStateWithLifecycle API를 사용하면, UI를 컨트롤할때 lifecycle를 aware한채로 flow의 collect를 진행할 수 있다. 2. resource 관리 측면에서 better than not use. 3. collectAsState API와 대응되는 API이다. 4. Compose State 의 object가 update 될때마다 모든 State.value 사용이 recomposition된다. 5. 기본적으..

2022. 10. 28. 00:09
Android Dev/NowInAndroid

SavedStateHandle 사용

먼저, SavedStateHandle.kt 의 첫부분의 설명은 아래와 같다. https://developer.android.com/reference/kotlin/androidx/lifecycle/SavedStateHandle A handle to saved state passed down to androidx.lifecycle.ViewModel. You should use SavedStateViewModelFactory if you want to receive this object in ViewModel's constructor. This is a key-value map that will let you write and retrieve objects to and from the saved state. ..

2022. 10. 25. 14:00
  • «
  • 1
  • 2
  • 3
  • 4
  • 5
  • ···
  • 30
  • »

공지사항

전체 카테고리

  • 분류 전체보기 (176)
    • Daily Records (0)
    • Coding Test 관련(with Kotlin) (0)
    • Android Dev (87)
      • NowInAndroid (7)
      • NaimanProject (0)
      • Compose (21)
      • Navigation (4)
      • Google Billing API (4)
      • Test Firebase Chatting App (12)
      • Login API 정리 (0)
      • Error logs (0)
    • 코틀린(Kotlin, Java) (14)
    • Swift (12)
      • codingTest (0)
    • Spring Boot (1)
    • Scala (3)
    • Js (0)
    • Programming Theory (13)
      • Functional Programming (2)
      • Design Pattern (0)
      • Generics (3)
      • 비동기 패러다임(Asynchronous Para.. (0)
      • 코루틴(Coruotine) (8)
      • Rxjava (0)
    • 파이어베이스(Firebase) (0)
    • 프로그래밍 팁 (1)
    • SystemVerilog (2)
    • Adobe (4)
      • 포토 일러스트레이터 (4)
      • Premiere pro (0)
    • Github 팁 (3)
    • RiscV (2)
      • Wake (1)
    • Linux (2)
    • CSS (4)
    • 회사 관련 (0)
애드센스 광고 영역
  • 최근 글
  • 최근 댓글

최근 글

최근댓글

태그

MORE

전체 방문자

오늘
어제
전체

블로그 인기글

Powered by Privatenote Copyright © Computer Hippocampus All rights reserved. TistoryWhaleSkin3.4

티스토리툴바