B4A Library Dialogs library

Status
Not open for further replies.

MaxApps

Active Member
Licensed User
Longtime User
How to use this to load a file?

normally I would load the text file with:
tmptxt=File.ReadString (File.DirRootExternal & "/CrN", Filename)

but this locks my to sdcard/CrN. Can I use Dialogs to load from anywhere?

tmptxt=File.ReadString (????????)


Kind regards
Jakob
 

thedesolatesoul

Expert
Licensed User
Longtime User
Andrew,
Is it possible for you to add a workaround for the TimePicker/DatePicker value sticking problem. When you enter a value using the keyboard it does not stick until focus is cleared from it. If you use a timepicker.clearfocus maybe that will do the trick and bypass this annoying feature.
Thanks.
 

thedesolatesoul

Expert
Licensed User
Longtime User
Andrew,
I have already tested this. Even after the user closes the dialog, if you do TimePicker.ClearFocus() it sets off some onChanged events, and returns the changed value.
After all, even though the dialog is not visible any more the reference to the views has not been destroyed yet.
Ofcourse, this is just a suggestion.
 

AscySoft

Active Member
Licensed User
Longtime User
Is it possible to show keyboard and dialog altogether?
I want to display a logon feature on my app, (an InputDialog with password mode set to true) like this
B4X:
Dim inputText As InputDialog
inputText.PasswordMode=True
inputText.Show("Enter password please","Log on","OK","","Exit",Null)


The only "problem" is that user must manually press into dialog field for the keyboard to be display.
Is there any chance to automate this process a little, please?
 
Last edited:

specci48

Well-Known Member
Licensed User
Longtime User
Hello agraham,

I don't know if its possible but it would be nice if the dialog titles would support RichStrings instead of Strings.
I use custom dialogs to display the results of previous searches. Using own views it is easy to highlight the results with the search expressions, but if the title is part of the result the highlighting won't work at the moment.


specci48
 

alan1968

Active Member
Licensed User
Longtime User
ColorPickerDialog via CustomDialog

hello your library is formidable !

but, in my program I want to launch a ColorPickerDialog via a button in a panel of CustomDialog , but I click the button ColorDialog does not open, if I set the panel to activity, the ColorDialog opening it's ok

it's normal ?
 

boza

New Member
Licensed User
Longtime User
Is there a way to close Custom dialog?

Hi Andrew,
Is there a way to close the Custom dialog from external event?
I mean the following: I created a custom dialog with a List View embedded:

Dim bmp As Bitmap
Dim cd As CustomDialog2
Dim C1 As fgContact
Dim j As Int
ItemSelected = -1

If ( ContactsList.IsInitialized = False) Then

ProgressDialogShow("Please, wait while reading contacts")
For j = 1 To 5
DoEvents
Next
Try
ContactsList = Contacts.GetAllContacts( False, False )
ProgressDialogHide
Catch
ProgressDialogHide
End Try
End If



Dim lv As ListView
lv.Initialize("lv_Acc")
Dim i As Int

For i = 0 To ContactsList.Size - 1
C1 = ContactsList.Get( i )

lv.AddSingleLine2 ( C1.DisplayName, C1 )

Next



cd.AddView(lv, 77%x, 60%y)

bmp.Initialize(File.DirAssets, "android48.png")
ret = cd.Show("Contacts list", "OK", "Cancel", "", bmp)
If ( ret <> DialogResponse.CANCEL ) AND ( ItemSelected <> -1) Then
C1 = lv.GetItem( ItemSelected )
edtAccName.Text = C1.DisplayName
ContactID = C1.Id
End If



I add an event procedure:

Sub lv_acc_ItemLongClick (Position As Int, Value As Object)
ItemSelected = Position
ToastMessageShow("Click OK to select item", False )
End Sub


Is there a way in this procedure to close the dialog with a "OK" modal result?

As you see, I display a toast message to the user to Click OK to confirm the selection, but will be better to automate this process and click OK in the event.
 

sioconcept

Active Member
Licensed User
Longtime User
Crash on Android 4.0 ?

Hello

I work on Android 4.0 and when i push the button "ok", My activity crash

B4X:
   Dim Dd As DateDialog
   Dim ret As Int
   Dd.Year = DateTime.GetYear(DateTime.Now)
   Dd.Month = DateTime.GetMonth(DateTime.Now)   
   Dd.DayOfMonth = DateTime.GetDayOfMonth(DateTime.Now)
   ret = Dd.Show("A quelle date ?", "Choisissez une date", "ok", Null, Null, Null)

Maybe you can help me to resolve this problem ?

B4X:
** Activity (document) Create, isFirst = true **
** Activity (document) Resume **
java.lang.RuntimeException: MotionEvent { action=ACTION_UP, id[0]=0, x[0]=775.6156, y[0]=322.39532, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=235780619, downTime=235780518, deviceId=2, source=0x1002 } recycled twice!
   at android.view.MotionEvent.recycle(MotionEvent.java:1660)
   at android.view.ViewRootImpl.finishMotionEvent(ViewRootImpl.java:2921)
   at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:2912)
   at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2471)
   at android.view.ViewRootImpl.processInputEvents(ViewRootImpl.java:849)
   at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2480)
   at android.os.Handler.dispatchMessage(Handler.java:99)
   at android.os.Looper.loop(Looper.java:137)
   at android.app.ActivityThread.main(ActivityThread.java:4424)
   at java.lang.reflect.Method.invokeNative(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:511)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
   at dalvik.system.NativeStart.main(Native Method)
 

Inman

Well-Known Member
Licensed User
Longtime User
Not sure if this will work, but I suggest 2 changes

First, you don't need to pass Null for all the arguments. Only the last one (bitmap) needs Null. For others use "" (empty double quotes).

Second, if you want the dialog to show today's date on startup, simply use Dd.DateTicks = DateTime.Now
 

sioconcept

Active Member
Licensed User
Longtime User
Thank you Inman, but no change

The DateDialog open nice; it's only when i push a button else i can see the dialogbox with the good day.
Strange :sign0161:

I don't find another DateDialog so nice.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…