Android Question .SetColorAndBorder: why one panel is not visible ?

peacemaker

Expert
Licensed User
Longtime User
HI, All

The test project is here: https://www.b4x.com/android/forum/t...bject-moving-dragging-by-_touch-event.160800/
In B4J - the blue horizontal line is visible, but in B4A - no.

B4X:
    mLine = xui.CreatePanel("")
    mRoot.AddView(mLine, PointSizePx , PointSizePx / 2 - LineThinknessPx, LineLenghtPx, LineThinknessPx)
    mLine.SetColorAndBorder(LineColor, LineThinknessPx, LineColor, 0)    'line as rectangle between Points

Any ideas ?


1714285514381.png
1714285674094.png
 

klaus

Expert
Licensed User
Longtime User
And change these two lines:
B4X:
    mRoot.AddView(mLine, PointSizePx , (PointSizePx  - LineThinknessPx) / 2, LineLenghtPx, LineThinknessPx)
    mLine.SetColorAndBorder(LineColor, 0, LineColor, 0)    'line as rectangle between Points
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
change these two lines

Yes, thanks, Klaus.
But also such changes helps to make the pin of correct size:
B4X:
    Public mLine, mPoint1, mPoint2 As B4XView, mRoot As B4XView
    Public LineThinknessPx As Int = 2dip
    Public LineLenghtPx As Int = 20dip
    Public LineColor As Int = xui.Color_Blue
    Private PointSizePx As Int = LineThinknessPx * 5   'here is important
 
Upvote 0
Top