Android Question Designer Problems

aklisiewicz

Active Member
Licensed User
Longtime User
I think there is definitely something wrong with the Designer and Panels.
I placed a Panel on the screen. No Scripts in Designer at all. The screen dimensions: 320 x 480 (default)
While in designer the Panel looks OK, but when running App it gets enlarged and shifted to the left.
See images (1st in Designer 2nd in App).

any clue ?
Arthur
 

Attachments

  • des7.png
    des7.png
    28.4 KB · Views: 327
  • des8.png
    des8.png
    28.9 KB · Views: 326

devlei

Active Member
Licensed User
Longtime User
Check carefully in both Portrait & Landscape mode scripts, and in the module as well - somewhere the layout is being changed.

If you can't find the problem, post the zipped project - someone should be able to put their finger on your problem!!
 
Upvote 0

aklisiewicz

Active Member
Licensed User
Longtime User
Here is the Main module code

B4X:
#Region Module Attributes
    #FullScreen: False
    #IncludeTitle: True
    #ApplicationLabel: Essential Database
    #VersionCode: 1
    #VersionName:
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

'Activity module
Sub Process_Globals
    Dim MediaPlayer1 As MediaPlayer
    '----------------------------Start SQLite--------------------------------------------------------------------------------------------------
    Dim dbFileDir As String                        :dbFileDir = File.DirInternal
    Dim dbFileDirEx As String                  :dbFileDirEx = File.DirDefaultExternal
    Dim dbFileName As String                :dbFileName = "xyz.db"

   
End Sub
Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Dim SQL1 As SQL
    Dim btnIntro As Button
    Dim btnAudio As Button
    Dim btnIssues As Button
    Dim btnProducts As Button
    Dim btnDocuments    As Button

    Dim Panel1 As Panel
    Dim Timer1 As Timer

    Dim btnCS As Button
    End Sub
Sub Activity_Create(FirstTime As Boolean)

    If FirstTime Then
        File.Delete(File.DirInternal, dbFileName) ' only for testing, removes the database
        'Check if the database already exists
        If File.Exists(File.DirInternal, dbFileName) = False Then
            'copy the default DB
            File.Copy(File.DirAssets, dbFileName, File.DirInternal, dbFileName)
            'if not, initialize it
            SQL1.Initialize(File.DirInternal, dbFileName, True)
            'and create it
            'CreateDataBase
            'copy the default DB
            File.Copy(File.DirAssets, "edbq_lite_LOC.db", File.DirInternal, "edbq_lite_LOC.db")
        Else
            'if yes, initialize it
            SQL1.Initialize(File.DirInternal, "edbq_lite_LOC.db", True)
        End If
    End If
'    ---------------------------
'    File.Delete(File.DirDefaultExternal, dbFileName)    ' for testing
'    'Copy and Initialize database
'    If File.Exists(File.DirDefaultExternal, dbFileName) = False Then
'        dbFileDir = DBUtils.CopyDBFromAssets(dbFileName)
'    End If
'    SQL1.Initialize(dbFileDir, dbFileName, True)
'    ------------------------
    Activity.LoadLayout("Main")                                        ' Loads "Main" layout file
    'Msgbox(dbFileDir,"Database Path: ")
   
    'splash screen - title screen - 3 secs___________________________________
'    Panel1.Visible=True ' put panel1 visible
'    Panel1.BringToFront ' if some control is visible over, forces panel1 to be in front
'    Panel1.SetLayout((Activity.Width - Panel1.Width) / 2, (Activity.Height - Panel1.Height) / 2, 256dip, 256dip) ' center panel1 on the screen
'        Timer1.Initialize("Timer1", 3000) ' start timer1 for 3 secs
'    Timer1.Enabled=True
    'end of splash screen _____________________________________________
   
   
End Sub
 

Attachments

  • main.bal
    4.9 KB · Views: 271
Upvote 0

Theera

Expert
Licensed User
Longtime User
Hi there,
You should send the zip file. The problem is designed the layout,not coding. If you use version 3.20,you can use the anchored feature.
 
Upvote 0

aklisiewicz

Active Member
Licensed User
Longtime User
unfortunately I cannot share the database file.
I will see perhaps I can drop the tables and the post the Zip.

what could be possibly found in a Ziped project if there is no referrence to the Layout in the Main module and no Scripting code in Designer Leyout ?

where can I download version 3.20 ?

Arthur
 
Upvote 0

aklisiewicz

Active Member
Licensed User
Longtime User
Never mind I got it fixed. Thank you all for your time.
I run B4A Project Cleanup and now it is all working. there is probably some cache or somethling of this sort holding some old information.
I also have problems with minor things i.e like buttons not changing text colors etc.
but not now I'm fine
 
Upvote 0
Top