These fragments are both subclasses of EditKeyboardFragment, and have very similar functionality. EditPhrasesKeyboardFragment should be able to handle both jobs, with the following changes:
- Add a boolean nav arg that identifies whether a phrase is being added (a var already exists in the fragment for this, but its value is always
false)
- Pass the appropriate value for said nav arg when editing vs. adding a new phrase (tapping existing phrase or using
+ button)
- Alter nav graph so that the
+ button on EditCategoryPhrasesFragment opens an Edit fragment instead of an Add fragment
- Add the function
addPhrase to EditPhrasesViewModel: see AddPhraseViewModel
- Probably replace use of deprecated ILegacyCategoriesAndPhrasesRepository in PhrasesUseCase (may be best broken out into future work)
These fragments are both subclasses of EditKeyboardFragment, and have very similar functionality. EditPhrasesKeyboardFragment should be able to handle both jobs, with the following changes:
false)+button)+button on EditCategoryPhrasesFragment opens an Edit fragment instead of an Add fragmentaddPhraseto EditPhrasesViewModel: see AddPhraseViewModel