How to manipulate properties of Livedata list

Viewed 228

Say like LiveData<List<Item> is received from remote and few of the Item's properties are calculated in the device based on some conditions. What would be the best practices to do so. Please suggest.

Say e.g., Item class as below:

class Item{
   int id
   String name
   float location
   float distance 
}

in which the id, name and location of each Item are received from remote but the distance to be calculated from location locally. How to calculate the distance and return a LiveData which can be supplied back to the View?

Appreciate your time and input.

1 Answers
Related