Android Question Screen "Ghosts"

rfhall50

Member
Licensed User
Longtime User
Embrarassed to show this code, however I am stumped. The following reads a delimited text file (name, status) and loads it into a ScrollView. This is working OK. The problem is that when I scroll the screen, the text moves but also stays on the screen. The ghost part that does not scroll is not dimmed. The identical part that is scrolling is not dimmed either. I am hoping it is just a setting (???). BTW, there are times when it does NOT ghost; everything looks good. I have tried cleaning the project, stopping and restarting the Android Bridge, all to no avail.

B4X:
Sub Splash_Complete   
    SequencedFileToUse = "Shooters.txt"
    TextReader1.Initialize(File.OpenInput(File.DirRootExternal, SequencedFileToUse))
    SV1.Initialize(0)
    Dim pnl As Panel
    pnl = SV1.Panel
    Activity.AddView(SV1,50dip,50dip,100%x,100%y)
    lstChecks.Initialize
    RHeight = 50dip
    Infinite = 0
    Cntr = 0
    Do While Infinite = 0
        Line1 = TextReader1.ReadLine
        If Line1 = "END,END" Then
            Exit
            End If
        RecSplit = Regex.Split("," , Line1)
        Dim chk As CheckBox
        chk.Initialize("")
        chk.text=RecSplit(0)
        lstChecks.Add(chk)
        Dim lbll As Label
        lbll.Initialize("")
        lbll.Text=RecSplit(1)
        lbll.Gravity= Gravity.CENTER_VERTICAL
        pnl.AddView(chk,0,RHeight*(Cntr-1), 120dip, RHeight)
        pnl.AddView(lbll,100,RHeight*(Cntr-1), 120dip, RHeight)       
        Cntr = Cntr + 1
    Loop
   
      TextReader1.Close
    pnl.Height = lstChecks.Size*RHeight
End Sub

Again, sorry for the code.

Bob Hall
 
Last edited:

klaus

Expert
Licensed User
Longtime User
For me this line is wrong:
Activity.AddView(SV1,50dip,50dip,100%x,100%y)
it shoud be
Activity.AddView(SV1,50dip,50dip,100%x,100%y - 50dip)
in your code a part of the ScrollView is out of the screen.

These two lines look strange to me:
pnl.AddView(chk,0,RHeight*(Cntr-1), 120dip, RHeight)
pnl.AddView(lbll,100,RHeight*(Cntr-1), 120dip, RHeight)

You set a Width of 120dip then you set the Left property of lbl1 to 100 !?
First why 120 and 100? There will be an overlapping.
And then why 100 and not 100dip ?
 
Upvote 0

rfhall50

Member
Licensed User
Longtime User
For me this line is wrong:
Activity.AddView(SV1,50dip,50dip,100%x,100%y)
it shoud be
Activity.AddView(SV1,50dip,50dip,100%x,100%y - 50dip)
in your code a part of the ScrollView is out of the screen.

These two lines look strange to me:
pnl.AddView(chk,0,RHeight*(Cntr-1), 120dip, RHeight)
pnl.AddView(lbll,100,RHeight*(Cntr-1), 120dip, RHeight)

You set a Width of 120dip then you set the Left property of lbl1 to 100 !?
First why 120 and 100? There will be an overlapping.
And then why 100 and not 100dip ?


Thank you. Very Much for the reply. Will make changes and re-test in the morning.
 
Last edited:
Upvote 0

rfhall50

Member
Licensed User
Longtime User
For me this line is wrong:
Activity.AddView(SV1,50dip,50dip,100%x,100%y)
it shoud be
Activity.AddView(SV1,50dip,50dip,100%x,100%y - 50dip)
in your code a part of the ScrollView is out of the screen.

These two lines look strange to me:
pnl.AddView(chk,0,RHeight*(Cntr-1), 120dip, RHeight)
pnl.AddView(lbll,100,RHeight*(Cntr-1), 120dip, RHeight)

You set a Width of 120dip then you set the Left property of lbl1 to 100 !?
First why 120 and 100? There will be an overlapping.
And then why 100 and not 100dip ?

Klaus ...
Sorry to be so long getting back to this (family issues!).
Your addition of the "- 50dip" fixed the problem. Need to study up on
what the parameters actually do. I can put it in, fix the problem, take it out,
and reproduce the problem. Love it when that happens.
Again, THANK YOU!.
Bob Hall
 
Upvote 0
Top