Start another Screen with Start Value Thunkable Makeroid AppInventor

Let's know another important Thing in Thunkable and other platforms that actually reduces blocks and Creating extra screens to run you app smoothly.

A start value block a more important block that every thunker or app designer must need to know.
For Example If you are making a Gaming app or so.
This Block helps you to create multiple sub-screens in one main screen using Vertical Arrangement Layout.
As we know that creating more screen means increasing the chances of App crashing in drag and drop platforms.
Now Let's Know what a screen starter does.
A screen starter is a block that starts another screen with creating a value and with this value we can give suitable command in another screen.
For Example in screen2 we created a two sub-screens using vertical arrangement, so when button1 clicked in screen1 then screen2 or 3 will open with start value and will be visible Vertical arrangement Layout1 or 2 only in Screen2 or 3 as we command. Remaining sub-screen ( Vertical Arrangement Layout2) will be hidden when layout1 is visible and son inverse as we command the blocks.
This is how the starter block looks Like

So now let's start the tutorial in step by step
To use this blocks we must need another screen like screen2 or 3 as well.So use screen1 or screen2 as a key screen to other screens.

Create a Key Component in key screen means Main Screen.
As here we used two buttons 1 & 2 as a key components to open another screen with Start Value and use that values to set a particular Components visible in another ( here we are using Screen2).

Now Design another screen using the suitable components you want.
Here we are creating sub-screens in one screen, so we are creating Sub-screens with using Vertical Arrangement components in screen2 as shown below.

we are setting their Height and width to Fill parent as because we want them to be sub-screens and Set the Vertical Arrangement Visibility to False in properties.

Now come to Screen1 and as we used two buttons as key components to start another screen with value, so Let's Command that Button1 is for Layout1 in screen2 and Button2 is for Layout2 in screen respectively.
Drag the when Button.1 click to blocks page and attach Screen Starter to it as shown below. Starter block will be in Control blocks.

Now attach two Empty Text strings to both Blocks and give screen name to screen block as shown below.
Now at StartValue give a name to it as your wish, here we are going to give it Layout1 as we wanted to set the layout1 to be visible in screen2 by opening the screen as shown below.
Now copy whole button block and rename the StartValue to Layout2 so that layout2 in screen will be visible when button2 clicked and set When Button1.Click to When Button2.Click as shown below.
Now go to Screen2 to give commands there and don't forget to remember to the Start Values ( Layout1 & Layout2)
 Now Drag and Drop the When Screen2 .Initialize. and attach If then Block to it and Equal block to If block as shown below.

Now Attach Get Start Value block from Control blocks to Left side of the Equal block and Empty Text string to right of the Equal block as shown below.

Now name the Empty Text string with start value as we given in previous screen
Here we given Layout1.
Now we can give commands below as our wish.
Here we are commanding that Vertical Arrangement Layout set to Visible so that all components in Layout will be visible as shown below is the command or blocks arrangement.

Now copy the whole If Then Block only but not screen block and attach it below the If then block and rename Start Value and give the different blocks command to then block as we now given Vertical Arrangement Layout2 set to visible as shown below.

That's It particular Arrangement only will be visible with start value so that you can create a multiple Sub-screens in one screen only.

Aia File:- πŸ‘‰Click HereπŸ‘ˆ

Happy tHunking😎😎

Post a comment