Reorient
The Reorient
app demonstrates the delay between changing the Screen1
orientation and the Screen1
dimensions actually changing.
The Reorient
app reorients arrangements of multiple buttons to be on top of one another in portrait orientation and side by side in landscape orientation.
MIT App Inventor requires a 250ms delay before reading Screen1.Width
and Screen1.Height
— hence the ClockDelay
component.
Incidentally, The Reorient
app has two buttons that play a cat sound and a dog sound with a single Player
.
Button
, Screen1.Initialize
, and Screen1.ScreenOrientationChanged
invoke the reset
procedure, which simply enables ClockDelay
for 250ms.ClockDelay.Timer
event invokes the reorient
procedure, which depends on Screen1.Width
and Screen1.Height
being correct — which only occurs after 250ms.The cat and dog sounds were downloaded from Orange Free Sounds (https://orangefreesounds.com/).
All components retain their default properties, — except Width
and Height
set to Fill parent...
where necessary to center UX components and Button
text(s) changed from their defaults(s).
🔗 permalink, 🔩 repository, and .AIA
for this page.