mit-cml / appinventor-sources

MIT App Inventor Public Open Source
http://appinventor.mit.edu/appinventor-sources/
Apache License 2.0
1.47k stars 2.05k forks source link

Add getView() method to Form. #2889

Open patryk84a opened 1 year ago

patryk84a commented 1 year ago

Describe the desired feature

Adding the ability to download a view in which the background is set and to which all components are added.

Give an example of how this feature would be used

Possibility to set the background of the screen from the extension, e.g. from the base64 string.

Why doesn't the current App Inventor system address this use case?

Why is this feature beneficial to App Inventor's educational mission?

abhinavs1920 commented 9 months ago

Can you please explain me what do you mean by Form here exactly.

patryk84a commented 9 months ago

Form extends Activity, it is not View. I would like to have the main Linearlayout view that represents Screen in the extension. We can then use an extension, for example, to set a base64 background image.

abhinavs1920 commented 9 months ago

In Simple Terms

It's like having a tool for the app that lets you choose a picture to be the background of your entire screen. You tell the tool what picture you want by using a base64 string, and then, when you open your app, the background changes to that picture.

patryk84a commented 9 months ago

Yes, I can store the image in the textbox in blocks instead of resources. This can be easily bypassed by setting the arrangement to full screen and adding a background to that arrangement, so this fix is ​​badly needed. But maybe someone will add a few lines that I don't think will be disturbing at all.

patryk84a commented 9 months ago

Another probably better solution is to add a block to each component that has an image property that allows you to add an image from a base64 string, just like Image does. Then base64 extensions would no longer be needed. The image and canvas components could have a block that returns base64 from the loaded image. Base64 is often used with databases, users save images in this way, e.g. in Google Sheets.