NumberDialog does not show last digit

BasicBert

Member
Licensed User
Longtime User
Hi all,

In my current app under development I use the Dialogs 2.80 library to get some userresponse. In general this works well, but one of the numberDialogs I use (6 digits, no decimals) does not show the last digit in portrait mode. It does in Landscape mode, though. See the attached screenshots.

It's the first time I use this lib.

I define the dialog in Sub Globals :
B4X:
Dim inputLiter, inputNumber, inputBedrag As NumberDialog

and use it in a label-click event :
B4X:
Sub lblKMtellerInvoer_Click
   LaatsteKM = Tabel.GetValue(2, Tabel.LastEntry)
   inputNumber.Decimal = 0
   inputNumber.Digits = 6
   If lblKMtellerInvoer.Text = "" OR lblKMtellerInvoer.Text <= LaatsteKM Then
      inputNumber.Number = LaatsteKM
   Else
      inputNumber.Number = lblKMtellerInvoer.Text
   End If
   inputNumber.Show("KM-teller","OK","Cancel","", Null)
   If inputNumber.Response = OK Then
      lblKMtellerInvoer.Text = inputNumber.Number
      If inputNumber.Number <= LaatsteKM Then
         Result = Msgbox2 ("KM <= Laatste invoer !", "", "OK","" ,"" , LoadBitmapSample(File.DirAssets, "aglogo.jpg",LogoBreedte , LogoHoogte))
         lblKMtellerInvoer.Text = ""
      End If
   End If
End Sub

The app is written for 320x480/480x320 screens and uses AutoScaleAll and Designer Scripts to scale and position the views. This seems to have no effect on the dialogs itself.
The screenshots are taken from my HTC One X and are scaled down in size to be able to upload them, but that's OK for the purpose of showing the problem.

:sign0163:
 

Attachments

  • screenshot_(1024_x_768).jpg
    screenshot_(1024_x_768).jpg
    19.2 KB · Views: 284
  • landscape_(1024_x_768).jpg
    landscape_(1024_x_768).jpg
    29.4 KB · Views: 570

BasicBert

Member
Licensed User
Longtime User
I don't think that you can change the way this dialog appears.

Erel, there is absolutely no doubt about your knowledge and I praise and :sign0188: you for what you have achieved with B4A.

And then the BUT... comes in :) of course...

I think it is quite strange to provide a way to easily create a dialog that can be used with up to 9 digits, while they would only show on landscape and in portrait just truncates some digits.
I have searched the posts but could not find other questions about this, while there will be lots of people that have tried out this library.

I'll keep looking for a solution in the hope that :sign0163: can help.
If there just isn't one, I'll have accept that and look for other ways to get input the way I want to.
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
Hi Bert:
I use NumberDialog in portait mode. I usually do not need more than 5 digits, but for your sake I changed it to nd.Digits=9 and it showed the correct number. I tried on a 7 inch tblet and on a Razr phone. Both showed 9 digits. Try it on another device. Also you may want to change the Manifest Editor for the SDK version. I did not have to do that to get the correct format.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Sounds strange, I tested it with a small test program and it shows OK.
Tested on a
- standard Emulator 320x480x160
- Nexus One 480x800x240

Could you post a small project showing the problem so we could also test it.
Attached my test program.

Best regards.
 

Attachments

  • NumberDialog.zip
    5.9 KB · Views: 190
Upvote 0

BasicBert

Member
Licensed User
Longtime User
Thanks for your replies. I haven't had time to test everything yet, but I'll give my results so far :

@ Mahares : thanks for testing on different devices. As soon as I have acces to my wife's tablet I'll try that.

@Klaus : Also thanks for the testprogram. I tried it as is and it showed the same behaviour as in my original post.

@all : Combining Klaus' testprogram and Mahares' suggestion for changing the Manifest from targetSdkVersion="14" to targetSdkVersion="10" leads to the app showing all digits, both in landscape and portrait mode ! Changing it to 11, 12 or 13 gave the same results as 14.

I would like my app to use the highest available sdk for my device, so I'm not happy with this behaviour and apparently the need to go back. If someone has a solution for this I would be happy. In the meantime I'll have to do with it I guess.
 
Upvote 0

mc73

Well-Known Member
Licensed User
Longtime User
Seeing the screenshots, I am thinking that you could alternatively create your very own dialog. Another thing is whether clicking buttons is always suitable for a numeric value. For example, I would actually prefer as an end-user to type my number.
 
Upvote 0

BasicBert

Member
Licensed User
Longtime User
Seeing the screenshots, I am thinking that you could alternatively create your very own dialog. Another thing is whether clicking buttons is always suitable for a numeric value. For example, I would actually prefer as an end-user to type my number.
:sign0142:Creating my own dialog is possible, sure. But the idea of using a lib is that you don't have to reinvent the wheel.
With sdk version 10 it's working OK, the ICS look that I loose with that is not a real problem, just some cosmetic detail that can be solved later, maybe. See the attached screenshot.

In this app, that will be used mainly in the car, I don't want to mess with the keyboard. So a dialog suits me better in this case. I can understand your point though for other uses.

Thanks for replying.
 

Attachments

  • 2013-01-08_22-41-58_(800_x_600).jpg
    2013-01-08_22-41-58_(800_x_600).jpg
    14.1 KB · Views: 252
Upvote 0

mc73

Well-Known Member
Licensed User
Longtime User
:sign0142:Creating my own dialog is possible, sure. But the idea of using a lib is that you don't have to reinvent the wheel.

In general, I agree, if either the task is relatively complicated (this means time consuming at least) and it doesn't give me trouble. I personally use the customDialogs lib a lot, but if a bug, or 'bug' comes to my attention, I will not hesitate to create a new view. Specifically if it would take less time to create than try to 'debug' somehow. And this is a general approach, for every class and lib, not only in b4a. Yet, again, it is probably a matter of choice :)
 
Upvote 0

BasicBert

Member
Licensed User
Longtime User
In general, I agree, if either the task is relatively complicated (this means time consuming at least) and it doesn't give me trouble. I personally use the customDialogs lib a lot, but if a bug, or 'bug' comes to my attention, I will not hesitate to create a new view. Specifically if it would take less time to create than try to 'debug' somehow. And this is a general approach, for every class and lib, not only in b4a. Yet, again, it is probably a matter of choice :)

You're right, it's a matter of choice. And the choice depends on the circomstances. In this case I wanted to know if I was experiencing a known bug, if I was missing information or if I did something wrong that was not obvious to me.

Since the community here is so quick in responding, asking the question and trying to find out what is going on was less timeconsuming then making my own dialog. And I wanted to find out what was wrong anyway, even when I would make my own dialog.

Other people may also learn from my experience, as I do learn from others.

If I think I really have to use sdk-version 14 or higher and the initial problem could not be solved, I suppose I will make a new dialog in my own code anyway. That would be a good learning situation, but now I like to go on with the rest of the app.

For now going back to sdk 10 is fine.
 
Upvote 0

RauchG

Active Member
Licensed User
Longtime User
Hi all,

the tip with sdk 10 works fine, but when I use "SetApplicationAttribute (android: theme,"Android: style / Theme.Holo.Light ")" work, the number dialog is cut off again.

Does anyone have an idea?

greeting
RauchG
 
Upvote 0

udg

Expert
Licensed User
Longtime User
Hi,
didn't try it myself, but I would have it done the other way around.
So, sdk set to 14 (or whatever "higher" number) and
B4X:
SetApplicationAttribute(android:theme, "@android:style/Theme")
to set the old style theme that seems to work well with the dialog appearance.

udg
 
Upvote 0

RauchG

Active Member
Licensed User
Longtime User
Hi,
didn't try it myself, but I would have it done the other way around.
So, sdk set to 14 (or whatever "higher" number) and
B4X:
SetApplicationAttribute(android:theme, "@android:style/Theme")
to set the old style theme that seems to work well with the dialog appearance.

udg

Hello udg,

thank you for your tip, but I have all my forms app to "SetApplicationAttribute (android: theme,"Android: style / Theme.Holo.Light ")" designed and thus the Number dialog is garbled.

I will now try to build a "Custom Number dialog".

greeting
RauchG
 
Upvote 0
Top