Skip to main content
  • About me
  • Some Thing
  • 首頁

kotlin

  • Jetpack Compose: 何時該用 derivedStateOf?

    2025-07-17

    官方導讀 核心摘要 (一句話總結) derivedStateOf 是一個效能優化工具,它像一個智慧守門員,專門用來防止因「來源狀態」變化過於頻繁而導致的**「不必要的 UI 重組 (Recomposi…

    read more
  • kotlin init 前初始化屬性會發生啥事

    Kotlin 的 class 內部,在初始化階段,是無情地由上到下執行的。 Kotlin // 下面這樣寫會發生啥事,不會發生啥事,因為編譯不過,所以不能跑 class ItemEditViewMod…

    read more
  • viewModelScope vs rememberCoroutineScope 其實沒啥好 versus ,就是 SOC 職責分離

    2025-07-15

    簡單來說,它們的主要差異在於生命週期綁定的對象和使用的層級不同。 viewModelScope:與 ViewModel 的生命週期綁定,只能用在資料/邏輯層。 rememberCoroutineSco…

    read more
  • Compose 三階段渲染管線

    2025-07-14

    核心三階段 (The Three Phases) Compose 將 UI 的生成與更新拆解為三個依序執行的獨立階段,以實現最大化的工作重用與性能優化。 組合 (Composition): 此階段的核…

    read more
  • Job 大大大不同 ,SupervisorJob 不就是 viewModelScope嗎?

    Job 不僅僅是 launch 的回傳值,它是我們管理 Coroutine 生命週期和失敗策略的「遙控器」。 Job : Job 是最基本的協定,它遵循嚴格的「結構化併發」原則。你可以把它想像成一個緊…

    read more
  • Kotlin 如何預防 Launch 連發,搜尋任務

    不管處理何種問題,我們都必須考慮是出於何種場景,就像是 使用者在 1 秒內點了 10 次。由於 launch 的天性是「射後不理 (fire-and-forget)」,你的 App 也會忠實地啟動 1…

    read more
  • CreationExtras.inventoryApplication() 這有點跳

    CreationExtras 到底是什麼? CreationExtras 是一個在 ViewModel 創建時自動附帶的「額外資訊包裹」。 以前,想給 ViewModel 傳參數(如 SavedSta…

    read more
  • fun GameScreen(gameViewModel: GameViewModel = GameViewModel()) 這樣寫有啥問題?

    直接 new GameViewModel() Kotlin class GameViewModel : ViewModel() { var score by mutableStateOf(0) ini…

    read more
  • inline, noinline, crossinline:存在即合理

    老樣子,存在必合理,有這樣的 Keyword ,那肯定是前人有過不去的坎,所以才設計出這個要想一想的概念 問題:優雅的 Lambda,不堪重負的 GC Kotlin 的高階函數與 Lambda 是偉大…

    read more
  • 麻煩 ViewModelProvider.Factory 你了,因為系統不讓我直接 new 一個 ViewModel

    這個規範是為了解決 Android 元件生命週期不一致所帶來的大問題。 ## 生活比喻:政府管理的保管箱 開發者 Activity/Fragment (UI 控制器):是您的「錢包」。您隨身帶著它,但…

    read more
1 2
Next »
  • analyze
  • android
  • Camera
  • dagger
  • debug
  • Facebook
  • FMRadio
  • Funny Vote
  • greendao
  • ios
  • java
  • kotlin
  • lib
  • MVP
  • overlay
  • plug
  • react native
  • retrofit2
  • SLAM
  • software
  • 整理
  • 書本
  • 未分類
  • 爛裝置也想跑AI
  • 老文
  • 2025 年 7 月
  • 2025 年 6 月
  • 2025 年 5 月
  • 2025 年 4 月
  • 2025 年 3 月
  • 2025 年 2 月
  • 2025 年 1 月
  • 2024 年 4 月
  • 2022 年 3 月
  • 2021 年 9 月
  • 2021 年 5 月
  • 2017 年 4 月
  • 2017 年 2 月
  • 2016 年 12 月
  • 2016 年 11 月
  • 2016 年 10 月
  • 2016 年 9 月
  • 2016 年 8 月
  • 2016 年 7 月
  • 2016 年 6 月
  • 2016 年 4 月
  • 2016 年 3 月
  • 2016 年 2 月
  • 2016 年 1 月
  • 2015 年 11 月
  • 2015 年 10 月
  • 2015 年 9 月
  • 2015 年 8 月
  • 2015 年 7 月
  • 2015 年 6 月
  • 2015 年 5 月
  • 2015 年 3 月
  • 2015 年 2 月
  • Jetpack Compose: 何時該用 derivedStateOf?
  • Modifier 效能 Draw 啥比較好:drawBehind , drawWithContent
  • kotlin init 前初始化屬性會發生啥事
  • viewModelScope vs rememberCoroutineScope 其實沒啥好 versus ,就是 SOC 職責分離
  • Compose 三階段渲染管線
Select a menu in the customizer
Blog Layouts WordPress Theme created by Rico