JakeBullet70 Well-Known Member Licensed User Longtime User Oct 7, 2022 #1 If I want to support both landscape and portrait orientations do I have to release 2 different apps?
P PaulMeuris Well-Known Member Licensed User Oct 8, 2022 #2 No, but you might have to do some extra programming to make the transitions work smoothly. If you rotate an Android device then the activity changes state: Activity life cycle Upvote 0
No, but you might have to do some extra programming to make the transitions work smoothly. If you rotate an Android device then the activity changes state: Activity life cycle
agraham Expert Licensed User Longtime User Oct 8, 2022 #3 Yes if you want to keep things simple, which is the intent of B4XPages which only supports a single device orientation in a single activity with panels as pages. You can hack around with extra Activities but you then lose the simplicity. Upvote 0
Yes if you want to keep things simple, which is the intent of B4XPages which only supports a single device orientation in a single activity with panels as pages. You can hack around with extra Activities but you then lose the simplicity.
JakeBullet70 Well-Known Member Licensed User Longtime User Oct 8, 2022 #4 Here is what I have done. Code: Copy #SupportedOrientations: unspecified Then in the designer, created a new variant for portrait mode (my original is in landscape) This seems to work as whenever the app is started in it selects the correct view (portrait / landscape) I added a global Code: Copy guiHelpers.gIsLandScape = Not (lv.Height > lv.Width) Designer code also supports the 'Portrait' var for IF statements There are some tweaks I need to make here and there but it seems to be OK (See below) So, while you cannot switch when running it seems you can support both portrait and landscape in a single app. If I run into anything else, I will post. Last edited: Oct 14, 2022 Upvote 0
Here is what I have done. Code: Copy #SupportedOrientations: unspecified Then in the designer, created a new variant for portrait mode (my original is in landscape) This seems to work as whenever the app is started in it selects the correct view (portrait / landscape) I added a global Code: Copy guiHelpers.gIsLandScape = Not (lv.Height > lv.Width) Designer code also supports the 'Portrait' var for IF statements There are some tweaks I need to make here and there but it seems to be OK (See below) So, while you cannot switch when running it seems you can support both portrait and landscape in a single app. If I run into anything else, I will post.
JakeBullet70 Well-Known Member Licensed User Longtime User Oct 13, 2022 #5 An update to this: B4XPages is supporting both landscape and portrait without restarting the app. I am looking at it right now. The B4xMainPage does get recreated on rotation. I do have code in the Starter class so wondering if that is having some affect. Upvote 0
An update to this: B4XPages is supporting both landscape and portrait without restarting the app. I am looking at it right now. The B4xMainPage does get recreated on rotation. I do have code in the Starter class so wondering if that is having some affect.
JakeBullet70 Well-Known Member Licensed User Longtime User Oct 13, 2022 #6 Also, I only have the B4XMainPage in my app. No other B4X pages. Upvote 0
I Ivica Golubovic Active Member Licensed User Longtime User Nov 1, 2022 #7 JakeBullet70 said: An update to this: B4XPages is supporting both landscape and portrait without restarting the app. I am looking at it right now. The B4xMainPage does get recreated on rotation. I do have code in the Starter class so wondering if that is having some affect. Click to expand... Try... Thread 'SoftOrientation Library for Activitiy and B4XPages based projects' https://www.b4x.com/android/forum/t...activitiy-and-b4xpages-based-projects.143896/ Upvote 0
JakeBullet70 said: An update to this: B4XPages is supporting both landscape and portrait without restarting the app. I am looking at it right now. The B4xMainPage does get recreated on rotation. I do have code in the Starter class so wondering if that is having some affect. Click to expand... Try... Thread 'SoftOrientation Library for Activitiy and B4XPages based projects' https://www.b4x.com/android/forum/t...activitiy-and-b4xpages-based-projects.143896/