Android Question ACEditText Not supporting SingleLine

Anser

Well-Known Member
Licensed User
Longtime User
Hi,

I am using AcEditText in my Activity. The following code is used to switch OFF the Multiline

Code:
Sub Globals
   'These global variables will be redeclared each time the activity is created.
   'These variables can only be accessed from this module.
   Private EdtFreightMode As ACEditText
End Sub

Sub Activity_Create(FirstTime As Boolean)
   'Do not forget to load the layout file created with the visual designer. For example:
   'Activity.LoadLayout("Layout1")
   'Do not forget to load the layout file created with the visual designer. For example:
   Activity.LoadLayout("MyLayoutFile")

   EdtFreightMode.Initialize("")
   EdtFreightMode.InputType = EdtFreightMode.INPUT_TYPE_TEXT
   EdtFreightMode.SingleLine = True
   EdtFreightMode.Wrap = True
   EdtFreightMode.ForceDoneButton = True

End Sub

If I use the normal EditText then it is working as expected.

Is there anything that I am missing in my code that is causing this behavior ?

My intention is to use ForceDone so that the Keyboard will be hidden after pressing the "Done". After searching the forum, I understood that, for this to work, SingleLine should be set to True. Unfortunately SingleLine mode is not working, hence ForceDone too.

Any sample that has multiple EditText/AcEditText on a single layout, which shows jumping from one edit text box to the next EditText box and some validations too, like we do in Windows Application ?

Regards
Anser
 
Erel,

Unfortunately, there is no difference even after removing the said lines from the code.

Regards
Anser
 
Upvote 0
There is no done button and I cannot set AcEditText to Single line.

Everything is working as expected when EditText view is used instead of AcEditText
 
Upvote 0
I am using Samsung Galaxy Note 4 (SM-N910G). Android Version 5.0.1

I am not using any Custom Rom
 
Upvote 0
Here is the sample code to reproduce the above said behaviour.
Code:
#Region  Project Attributes
    #ApplicationLabel: AcEditBoxTest
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: portrait
    #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

#AdditionalRes: D:\B4A-Additional-Libraries\CustomLibsRes\b4a_appcompat, de.amberhome.objects.appcompat
#AdditionalRes: C:\Android\extras\android\support\v7\appcompat\res, android.support.v7.appcompat
#Extends: android.support.v7.app.AppCompatActivity
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.

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.


    Private AcEditText1 As ACEditText
    Private AcEditText2 As ACEditText
    Private AcEditText3 As ACEditText
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("Main")
   
  AcEditText1.Initialize("")
  AcEditText1.InputType = AcEditText1.INPUT_TYPE_TEXT
  AcEditText1.SingleLine = True
  AcEditText1.Wrap = True

End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
 
Upvote 0
Can you run the attached project and post a screenshot of the keyboard?

Screen Snapshot from my Device
Keyboard2.jpg

Its working as Single Line

Regards

Anser
 
Last edited:
Upvote 0
Erel,

The sample that you gave uses AutoCompleteEditText, what I am talking here is about the AppCompat AcEditText (CustomView)

Regards
Anser
 
Upvote 0
Back
Top