Skip to content

Commit

Permalink
✨ add liveData
Browse files Browse the repository at this point in the history
  • Loading branch information
ii2001 authored and ii2001 committed Jul 25, 2024
1 parent 86fc898 commit 251f3ea
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
package net.pengcook.android.presentation.making

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import net.pengcook.android.presentation.making.listener.RecipeMakingEventListener

class RecipeMakingViewModel : ViewModel() {
// TODO: Implement the ViewModel
}
class RecipeMakingViewModel : ViewModel(), RecipeMakingEventListener {
val titleContent = MutableLiveData<String>()

val categorySelectedValue = MutableLiveData<String>()

val ingredientContent = MutableLiveData<String>()

val difficultySelectedValue = MutableLiveData<String>()

val introductionContent = MutableLiveData<String>()

override fun onNavigateToStep() {
// TODO: Implement navigation logic
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
package net.pengcook.android.presentation.making.step

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import net.pengcook.android.presentation.making.step.listener.StepEventListener

class StepMakingViewModel : ViewModel() {
// TODO: Implement the ViewModel
class StepMakingViewModel : ViewModel(), StepEventListener {
private val _stepNumber = MutableLiveData<String>()
val stepNumber: LiveData<String> get() = _stepNumber

val introductionContent = MutableLiveData<String>()

override fun onNavigateToNextStep() {
TODO("Not yet implemented")
}
}

0 comments on commit 251f3ea

Please sign in to comment.