再繼續談談MVVM之前,我們要來釐清一些事項

View視覺層

txtFood.text = "" //這是一個控制TextView顯示的Code
txtDesert.text = "" //這是一個控制Button text顯示的Code

Model邏輯層

fun makeSteakAPI(): String{...} //這是一個用來製作牛排的API並回傳String的functionfun makeCakeAPI(): String{...} //這是一個用來製作蛋糕的API並回傳String的function

ViewModel資料傳遞層

圖片來源:https://developer.android.com/

Android開發(從入門至放棄)

welsen ho

#noSleepOrOneDream

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store