[Code health] Handle visibility of custom views from within VM
Visibility of FeatureRepositionView and PolygonDrawingView could be handled in a better manner.
Current:
User action --> Set state to "completed" (CustomViewModel) --> Subscribe to state change in "MapContainerFragment" --> Set mode to DEFAULT, MOVE_POINT, DRAW_POLYGON (in MapContainerViewModel) --> Subscribe to mode in "HomeFragment" and update visibility of custom view.
Proposed:
User action --> Add LiveData for visibility (in CustomViewModel) --> Update visibility of custom view either using data binding or in CustomView.
Pros:
- Removes extra enum class "Mode"
- Prevents storing internal state of views in external classes
@hemanp tried view bindings here, as did I, and for some reason couldn't get them to work. More work is needed here.
@shobhitagarwal1612 Could you PTAL? Please assign back if you won't have cycles for this in Mar/Apr.
This is irrelevant as all tasks are moved to a separate fragment.