[Free] The ExtraComponents Extension (Beta)

Would like to see the whole gray circle

2 Likes

Will fix that. Thanks for reporting!

2 Likes

They are not. You can’t drag them on the designer screen, either put them inside an arrangement. So the only way to position them you have is to “guess” its position relatively to the other components, and pray that it will be in the right place on every screen size.

Seems like you don’t know what an overlay means, but these are totally an overlay. They can be placed even on top of other components, in fact every time I made a change in the companion, another instance of the same switch was created, even though they had the same id #. The three red switches are actually one that doesn’t disappear when the companion refreshes.

I added a slider to dynamically resize the label and the button and your switches stayed fixed in place while the other components moved.

Also, why use hex colors when it’s a standard for all components to use the color blocks? It adds to the confusion.

Colour blocks are not standard. I mean, App Inventor’s weird colour naming system gives me the jeebies. Hex codes are the standard way to go.[quote=“Italo, post:23, topic:4125”]
Seems like you don’t know what an overlay means, but these are totally an overlay. They can be placed even on top of other components, in fact every time I made a change in the companion, another instance of the same switch was created, even though they had the same id #. The three red switches are actually one that doesn’t disappear when the companion refreshes.
[/quote]

These aren’t overlays. I know what my code does. A switch is created and is appended to the root view of the activity. The root view spans the entire screen, which is why it can be placed on other components. Android programming is called layered for a reason.

Helios

1 Like

This is Thunkable, not Java or any other language. Color blocks are the standard for specifying colors in Thunkable/App Inventor.

So, if they are not overlayed, how come they don’t reposition when the other components are dynamically resized?
Why every time the companion refreshes, another instance of the same components appears?

Are you suggesting I use RGB or those hideous number codes?

I’m suggesting you use the same standard all the original components in App Inventor/Thunkable use, so people don’t have to guess what you wanted to do. Since 2011 all the “color” parameter slots accepts color blocks, and everybody is used to that. You can create any color you want, using the make color block. Is actually WAY easier for novice users than using hex colors.

You can use this code to let users use the “make color” or “color” block:

@SimpleFunction()
public int Color(int color) {
int newcolor = Color.rgb(color);
return newcolor ;
}

1 Like

Either way, my point is not about the colors. It is about how useful this can be when all that will create is confusion. If you can’t place the component in an arrangement, to have everything lined up nicely, what’s the use of it?
Do you design responsive layouts by placing components with a coordinates system? I guess if you are adventurous enough It can be done, but you’ll need a bunch of calculations to place not only your new switches, but everything else to make it match the position of your overlayed (sorry, they are not “overlays” but let’s call them “HOVERING”) switches.

Amazing :heart_eyes:

You’ve broken all limits that AppInventor had for visible components :+1:
Now everything seems to be possible :blush:

4 Likes

Another great Extension!

Like FAB on screen overlay

1 Like

@Helios Any suggestions, how did you add this? Did you use a library or just somehow “inflated” view? Also, another great extension.

Great extension. Does that mean we can create component dynamicly ?

1 Like

Android Toggle Button look source code

1 Like

No libraries involved. I will release the source once all the bugs have been sorted out and the methods are made more efficient.

Cheers

Well, if you think of it that way… Yes. It is now possible to dynamically create components. Yay!

Major update coming in a few hours. @Italo’s suggestions have been fulfilled and most bugs fixed. Also, expect a major change in the way the toggle button is created.

Cheers
Helios

3 Likes

Update 1.1

Major patches + New method


Thank you all for providing me with important feedback on how to improve the extension. This update includes changes to the CreateToggle method, along with minor name changes to other methods. Also added is a new CreateIndeterminateProgress method to show a spinning progress on the screen.


:warning: This update may break apps using the older versions. Continue at your own risk and discretion.


Major changes to the CreateToggle include:

Adding a toggle button onto the screen has been greatly changed. Here is the new way to add a button:

  1. Add a Horizontal arrangement to the screen where you want the toggle button to appear.
  2. Define this arrangement in the horizontalArrangement parameter.
  3. Set other parameters like id, thumbColour and trackColour as usual.

(I still haven’t been able to fix the color block, I’ll bring out a solution soon.)
The horizontal arrangement, in effect, is the toggle itself. If the arrangement is not visible, the toggle is hidden too. The toggle button is added to the top-left of the arrangement.
Using this approach eliminates irritating calculations and conversions with px and dp, and also helps the toggle scale uniformly.


New method: CreateIndeterminateProgress

This method has similar parameters to the CreateToggle block. The spinning progress will be shown on the top left of the horizontal arrangement that has been selected.


Note: Never use the same id for two components, even if one is a toggle and the other is a progress. It will overwrite the previous id.

The extension is still in its beta. All features are experimental and are subject to bugs and crashes. Please cooperate and continue to provide your valuable feedback.

Download here: com.vishwas.ExtraComponents.aix (30.8 KB)

Cheers

10 Likes

I hope this is fixed now. Please test and let me know.


They scale well now. Try it.

2 Likes

Great work @Helios ! I like it very much !

Looks like a workaround to create visible components( atleast for a few components ) has been found !! (?)

It is better to a use Horizontal Arrangement than x and y values
The InDeterminateProgress looks good too .

One thing I would like to see is to use the Color blocks instead of Hex values…It is better to stick to the standard that all the components use

1 Like