Skip to content

Commit d3f09bf

Browse files
ysfchnXomaDevhammerhai
committed
Version - v2.3.0 (#67)
Co-authored-by: Kumaraswamy B G <71964026+XomaDev@users.noreply.github.com> Co-authored-by: Nathan <43486313+hammerhai@users.noreply.github.com>
1 parent 676f519 commit d3f09bf

File tree

10 files changed

+660
-450
lines changed

10 files changed

+660
-450
lines changed

.vscode/settings.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"git.detectSubmodules": true,
3+
"java.project.referencedLibraries": [
4+
"lib/**/*.jar"
5+
],
6+
"java.compile.nullAnalysis.mode": "automatic",
7+
"[java]": {
8+
"editor.tabSize": 2,
9+
"files.trimTrailingWhitespace": true,
10+
"editor.trimAutoWhitespace": true
11+
},
12+
"[xml]": {
13+
"editor.tabSize": 2
14+
},
15+
"indentRainbow.excludedLanguages": [
16+
"java"
17+
]
18+
}

README.md

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,10 @@
1-
![Icon](assets/icon.png)
1+
# <img src="src/com/yusufcihan/DynamicComponents/aiwebres/icon.png" height="28"> &nbsp;Dynamic Components for AI2
22

3-
# DynamicComponents-AI2 `Extension`
3+
An extension for [MIT App Inventor 2](https://appinventor.mit.edu/) applications that allows to create components dynamically by its name at runtime with blocks.
44

5-
[![forthebadge](https://forthebadge.com/images/badges/its-not-a-lie-if-you-believe-it.svg)](https://forthebadge.com)
5+
It is based on Java's reflection feature, so this allows us to create instances of classes (components) by its name. Also, unlike other extensions that create components in runtime, this extension doesn't keep a list of all component names because it supports every component which is ever added to your App Inventor distribution by nature. So, not only can you dynamically create common components like `Button`, but you can also create `DatePicker` components.
66

7-
[![Maintainability](https://api.codeclimate.com/v1/badges/31e4cd31de1bd0e186c8/maintainability)](https://codeclimate.com/github/ysfchn/DynamicComponents-AI2/maintainability)
8-
9-
Fully supported Dynamic Components extension for MIT App Inventor 2. It is based on Java's reflection feature, so it creates the components by searching for a class by just typing its name. So it doesn't have a limited support for specific components, because it supports every component which is ever added to your App Inventor distribution!
10-
11-
So if you use Kodular, you will able to create all Kodular components, if you use App Inventor, you will able to create all App Inventor components and so on. Extension components are supported too!
12-
13-
> ⚠ The `beta` branch will be reset after every release. So stay on the `main` branch if you don't know what you do.
14-
15-
---
16-
17-
### Asynchronous support
18-
19-
This extension can create components asynchronously or synchronously based on your choice. If you don't want to block the main app during creating a bunch of components, go to the Designer (after importing the extension) and select between "UI" (asynchronous) and "Main" (synchronous).
20-
21-
<img src="assets/other/thread_choice.png" height="150">
7+
So if you use Kodular, you will able to create all Kodular components, if you use App Inventor, you will able to create all App Inventor components and so on. Creating instances of other extensions are also supported.
228

239
## 🧩 Blocks
2410

@@ -49,7 +35,7 @@ This extension can create components asynchronously or synchronously based on yo
4935
</table>
5036
</td>-->
5137
<td>
52-
Creates a new dynamic component. It supports all component that added to your current AI2 distribution.
38+
Creates a new dynamic component. It supports all component that added to your current AI2 distribution. Note that you can't create components in Screen directly, you will need to have an arrangement beforehand inside a Screen to do that.
5339
<code>componentName</code> parameter can have these values:
5440
<br><br>
5541
<table>
@@ -68,6 +54,15 @@ This extension can create components asynchronously or synchronously based on yo
6854
</table>
6955
</td>
7056
</tr>
57+
<!-- CREATE EPHEMERAL -->
58+
<tr>
59+
<td align="right">
60+
<img src="assets/blocks/method_createephemeral.png">
61+
</td>
62+
<td>
63+
Creates a new dynamic component in given container (arrangement/canvas) and return it without saving it to the created components list, so it won't be attached to an ID. Note that you can't create components in Screen directly, you will need to have an arrangement beforehand inside a Screen to do that.
64+
</td>
65+
</tr>
7166
<!-- CHANGE ID -->
7267
<tr>
7368
<td align="right">
@@ -131,7 +126,16 @@ This extension can create components asynchronously or synchronously based on yo
131126
</table>
132127
</td>-->
133128
<td>
134-
Removes the component with specified ID from screen/layout and the component list. So you will able to use its ID again as it will be deleted.
129+
Removes the component with specified ID from screen and the component list. So you will able to use its ID again as it will be deleted.
130+
</td>
131+
</tr>
132+
<!-- REMOVE COMPONENT -->
133+
<tr>
134+
<td align="right">
135+
<img src="assets/blocks/method_removecomponent.png">
136+
</td>
137+
<td>
138+
Removes a component from the screen. It doesn't need to be created by this extension. But if the given component is dynamically created by this extension, this block will also de-register its ID so its ID can be reused for other components that are going to be created later.
135139
</td>
136140
</tr>
137141
<!-- SET PROPERTY -->
@@ -431,14 +435,28 @@ This extension can create components asynchronously or synchronously based on yo
431435
</tr>
432436
</table>
433437

438+
### Asynchronous support
439+
440+
This extension can create components asynchronously or synchronously based on your choice. If you don't want to block the main app during creating a bunch of components, go to the Designer (after importing the extension) and select between "UI" (asynchronous) and "Main" (synchronous).
441+
442+
<img src="assets/other/thread_choice.png" height="150">
443+
434444
## 🔨 Building
435445

436446
You will need:
437447

438448
- Java 1.8 (either OpenJDK or Oracle)
439449
- Ant 1.10 or higher
440450

441-
Then execute `ant extensions` in the root of the repository.
451+
After cloning the repository, make sure to fetch submodules first:
452+
453+
```
454+
git submodule update --init --recursive
455+
```
456+
457+
Then execute `ant extensions` in the root of the repository to build the extension.
458+
459+
> ⚠ The `beta` branch will be reset after every release. So stay on the `main` branch if you don't know what you do.
442460
443461
## 🏅 License
444462

9.2 KB
Loading
8.52 KB
Loading

assets/icon.png

-2.38 KB
Binary file not shown.

0 commit comments

Comments
 (0)