Page 1 of 1

Android App Orientation [fixed]

Posted: Sat Jun 10, 2017 2:05 pm
by IdeasVacuum
The orientation option 'Landscape' in Create App/Android does not work for me - anyone else have this issue?

Code: Select all

EnableExplicit
CloseDebugOutput()
ExamineDesktops()

#Desktop = 0

Enumeration
#Win
#Btn1
#Btn2
#Btn3
#BtnExit
#Scroll
#Msg
#Txt
EndEnumeration

Global igAvailW.i, igAvailH.i, igWinH.i, igWinW.i

;!igAvailW = window.screen.availWidth
;!igAvailH = window.screen.availHeight
;!igWinW = window.screen.width
;!igWinH = window.screen.height

igWinW = DesktopWidth(#Desktop)
igWinH = DesktopHeight(#Desktop)

;Debug igAvailW
;Debug igAvailH
;Debug igWinW
;Debug igWinH

Procedure CloseWindowEvent()
;#---------------------------
  CloseWindow(EventWindow()) ; Close the specific window
EndProcedure

Procedure MyGadgetEvent()
;#------------------------
    SetGadgetText(#Msg, "Button" + Str(EventGadget()) + " pressed!")
EndProcedure
 

  If OpenWindow(#Win, 0, 0, igWinW, igWinH, "", #PB_Window_BorderLess|#PB_Window_SizeGadget|#PB_Window_ScreenCentered)

    ScrollAreaGadget(#Scroll,   0,   0, 300, 250, 500, 300, 40)
        ButtonGadget(#Btn1,    10,  10, 255,  38,"Button 1")
        ButtonGadget(#Btn2,    10,  50, 255,  38,"Button 2")
        ButtonGadget(#Btn3,    10,  90, 255,  38,"Button 3")
        ButtonGadget(#BtnExit, 10, 130, 255,  38,"Exit")
          TextGadget(#Msg,     10, 180, 255,  26, "", #PB_Text_Center | #PB_Text_Border)
          TextGadget(#Txt,    200, 210, 230,  26, "Scroll to see all of the Text Here", #PB_Text_Right | #PB_Text_Border)

           BindEvent(#PB_Event_Gadget, @MyGadgetEvent(), #Win, #Btn1)
           BindEvent(#PB_Event_Gadget, @MyGadgetEvent(), #Win, #Btn2)
           BindEvent(#PB_Event_Gadget, @MyGadgetEvent(), #Win, #Btn3)
           BindEvent(#PB_Event_Gadget, @CloseWindowEvent(), #Win, #BtnExit)

     CloseGadgetList()
  EndIf

Re: Android App Orientation

Posted: Sat Jun 10, 2017 4:34 pm
by falsam
[SB 2.00] No problem for me : Landscape mode is blocked.

Re: Android App Orientation

Posted: Sat Jun 10, 2017 7:07 pm
by IdeasVacuum
Hi Falsam
Landscape mode is blocked
I have no idea what that means :?

Re: Android App Orientation

Posted: Sat Jun 10, 2017 7:54 pm
by falsam
IdeasVacuum wrote:The orientation option 'Landscape' in Create App/Android does not work for me
I did a test. I chose Landscape in Create App / Android and my application is in landscape mode.

Re: Android App Orientation

Posted: Sat Jun 10, 2017 9:50 pm
by IdeasVacuum
Well, really strange. Before, orientation did not work at all. Now, it works every time! :shock:
There must be something alien in the coffee....