Bug? [SOLVED] New PreferencesDialog issues

Rubsanpe

Active Member
Licensed User
I've been trying the new PreferencesDialog option and it works really well. I only have two problems:

1) When I try to define a size for the dialog the vertical position the dialog takes is too high, leaving a lot of space at the bottom of the screen. Also the title of the dialog is not shown. Steps to reproduce the problem in the original example:
B4X:
prefdialog.Initialize(Activity, "Preferences Dialog", 300dip, 61%y).

If a height greater than 60% is set and the title is not shown.

2) For some reason that does not occur in the original example, in a dialog created by me, when opening the dialog, in debug mode there are warnings about not defining the classes of the different controls of the dialog:

B4X:
Class not found: b4a.example.b4xswitch, trying: com.clarionero.boletinesoficiales.b4xswitch
Class not found: b4a.example.b4xswitch, trying: com.clarionero.boletinesoficiales.b4xswitch
Class not found: b4a.example.b4xswitch, trying: com.clarionero.boletinesoficiales.b4xswitch
Class not found: b4a.example.b4xfloattextfield, trying: com.clarionero.boletinesoficiales.b4xfloattextfield
Class not found: b4a.example.b4xcombobox, trying: com.clarionero.boletinesoficiales.b4xcombobox
Class not found: b4a.example.b4xfloattextfield, trying: com.clarionero.boletinesoficiales.b4xfloattextfield
Class not found: b4a.example.b4xcombobox, trying: com.clarionero.boletinesoficiales.b4xcombobox
Class not found: b4a.example.b4xfloattextfield, trying: com.clarionero.boletinesoficiales.b4xfloattextfield
Class not found: b4a.example.b4xcombobox, trying: com.clarionero.boletinesoficiales.b4xcombobox
Class not found: b4a.example.b4xfloattextfield, trying: com.clarionero.boletinesoficiales.b4xfloattextfield
Class not found: b4a.example.b4xcombobox, trying: com.clarionero.boletinesoficiales.b4xcombobox
Class not found: b4a.example.b4xfloattextfield, trying: com.clarionero.boletinesoficiales.b4xfloattextfield
Class not found: b4a.example.b4xcombobox, trying: com.clarionero.boletinesoficiales.b4xcombobox
Class not found: b4a.example.b4xswitch, trying: com.clarionero.boletinesoficiales.b4xswitch

Any idea why they appear in my dialogue and do not appear in the original example?

3) If the dialog has a date field that is not visible (it is a field that is outside the visible fields), when the calendar is opened, the dialog disappears and when you select a date the dialog reappears but not showing the date field, but showing the dialog from the first field.



Greetings

Rubén
 

Attachments

  • 1.png
    1.png
    30.2 KB · Views: 368
  • 2.png
    2.png
    21.8 KB · Views: 362
  • 3.png
    3.png
    21.5 KB · Views: 366
Last edited:

Rubsanpe

Active Member
Licensed User
Do not copy the layout files from one app to another. Create a new layout in your app.

Hi DonManfred, thanks for answering. The JSon file of the dialog was created from 0 and its content has nothing to do with Erel's example. The code that generates the dialog in B4A is not the same code used by Erel. I have modified the Erel example package from b4a.example to b4a.example2 and now it also shows the warning messages running.

B4X:
Close the drawers on back key press
** Activity (main) Pause, UserClosed = true **
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Class not found: b4a.example.b4xfloattextfield, trying: b4a.example2.b4xfloattextfield
** Activity (main) Resume **
Class not found: b4a.example.b4xswitch, trying: b4a.example2.b4xswitch
Class not found: b4a.example.b4xfloattextfield, trying: b4a.example2.b4xfloattextfield
Class not found: b4a.example.b4xplusminus, trying: b4a.example2.b4xplusminus
Class not found: b4a.example.b4xplusminus, trying: b4a.example2.b4xplusminus
Class not found: b4a.example.b4xcombobox, trying: b4a.example2.b4xcombobox
Class not found: b4a.example.b4xfloattextfield, trying: b4a.example2.b4xfloattextfield
Class not found: b4a.example.b4xfloattextfield, trying: b4a.example2.b4xfloattextfield
Class not found: b4a.example.b4xswitch, trying: b4a.example2.b4xswitch
** Service (starter) Destroy (ignored)**

Regarding the problem with the uses of the calendar field, the same happens with the original example of Erel.

Greetings

Ruben
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
2. Ignore the warnings. They will be removed in the next version of B4A.

1.
When I try to define a size for the dialog the vertical position the dialog takes is too high, leaving a lot of space at the bottom of the screen. Also the title of the dialog is not shown. Steps to reproduce the problem in the original example:
Remember that the keyboard will take quite a lot of space when it appears. The title is hidden by design when there isn't enough space for the keyboard to appear without hiding the dialog (the measurement is not 100% accurate so it adds some "safe" margins).

If the dialog has a date field that is not visible (it is a field that is outside the visible fields), when the calendar is opened, the dialog disappears and when you select a date the dialog reappears but not showing the date field, but showing the dialog from the first field.
How can the calendar open if the field is not visible?
 

Rubsanpe

Active Member
Licensed User
2. Ignore the warnings. They will be removed in the next version of B4A.

1.

Remember that the keyboard will take quite a lot of space when it appears. The title is hidden by design when there isn't enough space for the keyboard to appear without hiding the dialog (the measurement is not 100% accurate so it adds some "safe" margins).


How can the calendar open if the field is not visible?

Hey, Erel, thanks for the answers.

By non-visible fields I am referring to fields that are not visible when opening the dialog and that the dialog must be scrolled in order to be visible. Then when you click on them to select a date, when the calendar closes, the dialog displays the first controls of the dialog again, and not the control over which we just selected the date (image nº 3).

Rubén
 

Rubsanpe

Active Member
Licensed User
I'm unable to reproduce it. The list preserves the scroll position.

Thank you Erel. I have uploaded your same example (commenting a single line) using the dialog I try to use. In the test if I try to assign a date field, when it return the first field of the dialog is selected.

Rubén
 

Attachments

  • EjemploPreferencesDialog.zip
    14 KB · Views: 361
Top