Skip to content
Aditya Sharat edited this page Feb 20, 2017 · 3 revisions

ProteusView is the interface each view registered needs to implement. It hosts its ProteusViewManager which hosts numerous utility methods.

  • findViewById

View id (an int) is generated at compile time when you write layouts in XML, and in proteus, View id are String. So proteus simulates the id generation logic at runtime, hence will not be the same as R.id.something. In order to find a view by id please follow this example.

Layout:

{
  "type": "TextView",
  "id": "myId"
}

Java code:

int id = proteusView.getViewManager().getUniqueViewId("myId");
View view = proteusView.findViewById(id); // nullable