Example :
It can be used to set the property or invoke the component function of the components we have made using Dynamic component.
Example :
It can be used to set the property or invoke the component function of the components we have made using Dynamic component.
Lol you made before me but still example is example lol.
It can do both jobs of GetProperty and SetProperty blocks. Even this block can call all the method and events blocks of the component that you can not do with only SetProperty blocks.
Same here
Well in most cases when I donāt use schema, I use set properties and dictionary blocks so Iām not familiar with that block. I will try to use it in order to understand better
Iāve only worked with DC a few times before (something simple with labels or buttons). So Iām not very familiar with it. Since I couldnāt find anything about this block either in the AI2 forum or here, there seems to be hardly anyone who has used this block before.
Thanks to all for the helpful hints on how this block works and for unveiling the secret (at least for me) surrounding this block.
And many thanks to @dora_paz, who is tirelessly busy on both forums (AI2 and here) and giving me some deeper insights into the DC extension (via PM).
Thanks for explanation!
Looks like it is already explained, but I will explain it anyway In simple terms, it is used to call a componentās function by using its name. It may be sometimes useful because in AI2, you define which method to call or which property to set/get before building the application. You canāt call a method dynamically in runtime.
Another example:
However, I donāt always recommend using āInvokeā instead of componentās own methods because Invoke block only supports basic types (int, string, boolean etc.) of parameters.
Youāre right, even including the above example, there is no actually perfect scenario that this block would be useful, I actually added this block for my own use, but is not needed for me either anymore.
I merged the PR, here is the new build that includes your minor fixes if someone is interested. However, I donāt currently plan to announce as a separate version right now (the version name is 2.2.3 anyway), as it just contains few minor additions/fixes.
com.yusufcihan.DynamicComponents.aix (30.1 KB)
Thank you for the explanation!
Also In Thread Property, why there is UI and Main ? Arenāt main thread and UI thread are same? I guess one of the value name should be Async, or am i missing something?
Iām sure you got this question from @Xoma, so hereās your answerā¦
The property chooser has UI and Main as options because their references in Android documentation are alike. Theyāre also shown in the code itself (ex: runOnUiThread).
TL;DR: Theyāre self-explanatory.
runOnUiThread refers to the main app thread. They are basically the same.
This is from Android blog:
Iād always a doubt whenever i have used DynamicComponents
extension. I have known that Xoma has presented same question in his PR but I didnāt know it has been answered by you already.
Btw, I donāt get it. Why there is UI
and Main
thread in property chooser if they are same?
As far as I know, Activitiyās runOnUiThread
execute the Runnable code in the Main/UI thread.
Edit : Thankyou for explaining hammerhai at #1937 ā¦
The problem is @oseamiya and @Xoma, that they might both be the same threads in the way they work, but they arenāt the same.
Turns out, UI and Main threads are not necessarily the same.
Dynamic Components isnāt misleading developers by having ātwo of the same thing, but differently named,ā theyāre just different. Developers at Google wouldnāt include a useless runOnUiThread
for no reason, as from your standpoint, everything should already be running thereā¦ right?
F.Y.I @Xoma, in response to your pull request āThey are basically the same, instead, it should be āMainā and āAsync.āā They arenāt and wonāt ever beā¦ not that Iām stopping you from submitting that change to your heartās desire. Thereās no such thing as āAsync Threadā in Android.
The thing is UI and Main may not be the same (by exact meanings).
Generally speaking, āa new threadā.
Thankyou for the explanation !
Good day. Iām trying to create dynamically LineString inside Map.
But, it shows this error:
Is it possible to create components dynamically in Map?