Android Question CustomView: EditText border color

gdeppi

Member
Licensed User
Longtime User
I have created a CustomView where I placed a control derived from EditText.

On designer, if I use a EditText, the EditText border that have a focus is drawn colored,
if I use the CustomView with custom EditText, the EditText border is drawn with no color (gray).

Any idea about this behavior?

Giuseppe
 
Last edited:

gdeppi

Member
Licensed User
Longtime User
Here the code...

B4X:
#DesignerProperty: Key: NumDec, DisplayName: Decimal Position, FieldType: Int, DefaultValue: 2, Description: Decimal Position.
#DesignerProperty: Key: NumLen, DisplayName: Number Lenght, FieldType: Int, DefaultValue: 10, Description: Number Lenght.
Sub Class_Globals
    Private mTarget As Object
    Private mEventName As String
    Private EventName As String 'ignore
    Private CallBack As Object 'ignore
    Private mBase As Panel
    Private NumberInput As EditText
    Private mBase As Panel
    Private mLeft, mTop, mWidth, mHeight As Int
    Private mValue As String
    Dim FormatInput As Boolean = True
    Dim PosAttNum, PosAttDec, NumDec, NumLen As Int
    Dim CorPosAtt, CorPosDec As Boolean = False
    Dim AHNumeric1 As AHNumeric
    Dim IME As IME
End Sub

Public Sub Initialize (vCallback As Object, vEventName As String)
    EventName = vEventName
    CallBack = vCallback
End Sub

Public Sub DesignerCreateView (Base As Panel, Lbl As Label, Props As Map)
    '
    mLeft   = Base.Left
    mTop    = Base.Top
    mWidth  = Base.Width
    mHeight = Base.Height
  '
    mBase.Initialize("")
    mBase = Base
    NumberInput.Initialize("NumberInput")
    '
    mBase.AddView(NumberInput, mBase.Height, 0, mBase.Width - (2*mBase.Height), mBase.Height)
    '
    Base.Color = Colors.Transparent
    '
    NumberInput.Gravity = Gravity.RIGHT
    '
End Sub

Giuseppe
 
Upvote 0

gdeppi

Member
Licensed User
Longtime User
The border width of the custom view is set to 0 in the designer, see properties, and see also the screenshot of the contol that have focus: non border...
 

Attachments

  • 2017-02-14_165316.png
    2017-02-14_165316.png
    14.6 KB · Views: 457
  • EditText border.png
    EditText border.png
    8.8 KB · Views: 606
Last edited:
Upvote 0
Top