Closed BrandonTsai closed 2 years ago
Hi @BrandonTsai ,
Thanks for your suggestions. I think we need a better approach to return the map of <String,Int> because as the createView is a static it is not good to keep the ids in a variable in the class. We need to return in similar way we return the view. What do you think about that ?
Nikos
Hi @tsiougkosn ,
How about return a DynamicView object which contain the view and the ids when user call DynamicView.createView()?
For example:
DynamicView dynamicView = DynamicView.createView(this, jsonObject, SampleViewHolder.class);
View sampleView = dynamicView.getView();
HashMap<String, Integer> idMap = dynamicView.getIds();
By calling DynamicView.getIdMap(), user can get child view via findViewById(idMap.get("id_name").intValue());