From d9d58d9200ab1e13526af6d0d2788f785d04bcb5 Mon Sep 17 00:00:00 2001 From: Yusuf Cihan <54748183+ysfchn@users.noreply.github.com> Date: Thu, 12 Mar 2020 21:04:29 +0300 Subject: [PATCH] Update DynamicComponents.java --- .../DynamicComponents/DynamicComponents.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/com/yusufcihan/DynamicComponents/DynamicComponents.java b/src/com/yusufcihan/DynamicComponents/DynamicComponents.java index fafdb53..0a648a3 100644 --- a/src/com/yusufcihan/DynamicComponents/DynamicComponents.java +++ b/src/com/yusufcihan/DynamicComponents/DynamicComponents.java @@ -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) { } @@ -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 keys = COMPONENTS.keySet(); + return keys; + } + @SimpleFunction(description = "Returns the component type name.") public String GetName(Object component) { return component.getClass().getName();