Skip to content

Commit

Permalink
Update DynamicComponents.java
Browse files Browse the repository at this point in the history
  • Loading branch information
ysfchn authored Mar 12, 2020
1 parent 0982c27 commit d9d58d9
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/com/yusufcihan/DynamicComponents/DynamicComponents.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,14 @@ public void Remove(String id) {
if (COMPONENTS.containsKey(id) == false)
return;

// Get the component.
cmp = COMPONENTS.get(id);
// Remove its id from components list.
COMPONENTS.remove(id);

try
{
// Get the component.
cmp = COMPONENTS.get(id);
// Remove its id from components list.
COMPONENTS.remove(id);
// Hide the component.
// Hide the component if possible.
((AndroidViewComponent)cmp).Visible(false);
}
catch (Exception eh) { }
Expand All @@ -113,6 +114,12 @@ public Object GetComponent(String id) {
return COMPONENTS.get(id);
}

@SimpleFunction(description = "Returns created components' IDs as a list.")
public Object GetCreatedComponents() {
Set<String> keys = COMPONENTS.keySet();
return keys;
}

@SimpleFunction(description = "Returns the component type name.")
public String GetName(Object component) {
return component.getClass().getName();
Expand Down

0 comments on commit d9d58d9

Please sign in to comment.