Daniel Okanin
10/08/2024, 5:34 PMModel
data from the server and use a transformer in the ViewModel
to create a UiModel
specific to the view.
I’m wondering: when I need to display an icon based on the UiModel
, should I include the drawable resource (@DrawableRes
) directly in the UiModel
class? Or, should I include a type field and map the drawable resource in the view layer itself?
Which approach is considered best practice? If I go with the first approach, the view stays very simple since it only needs to display the data. However, I’m unsure if this is the best solution for maintainability or flexibilityAlexandru Caraus
10/08/2024, 7:04 PMAlexandru Caraus
10/08/2024, 7:06 PMDaniel Okanin
10/08/2024, 7:15 PMMaarten de Goede
10/09/2024, 9:08 AM@DrawableRes
on our `UiModel`s because we use Kotlin Multiplatform.
In my opinion it just depends on your use case tbh.dewildte
02/15/2025, 8:15 PMAlexandru Caraus
02/16/2025, 7:42 AMAlexandru Caraus
02/16/2025, 7:43 AM