Android Question 1dip calculation

woniol

Active Member
Licensed User
Longtime User
Hi,
I have a question: how and when is the 1dip calculated?

I have a very rare problem with the vies in my app.
The result is that the views are 'pinched'.
This is very rare and I can't repeate it.
I also use same libs that I think can have some impact on it.

What i managed to figure out from my app logs that when it happens the 1dip size has different value
than is the views are ok.

I run it on Galaxy S7 and normaly the 1dip = 4.
But when the problem occures 1dip = 1

It happens both then the views are loaded with Loadlayout or in with the code.

Any ideas?
 
Last edited:

woniol

Active Member
Licensed User
Longtime User
Can something change it later, so that it's not correct in Activity_Start?
I uploaded the screenshots to show how it looks.
Screenshot_20181019-092638.jpg Screenshot_20181019-092818.jpg
 
Upvote 0

woniol

Active Member
Licensed User
Longtime User
I will log it and let know the results. So far I have this:
B4X:
Log(Activity.Height&" x "&Activity.Width)
    Log("1dip "&1dip)
And there I relized that when the problem occures 1dip 1 is logged, normaly it's 4
It might take some time, I can not reproduce this error, It happens very rare.
I'll come back.
 
Upvote 0

woniol

Active Member
Licensed User
Longtime User
When it's ok
B4X:
1440 x 2560, scale = 4.0 (640 dpi)
is logged with
B4X:
Log(GetDeviceLayoutValues)
 
Upvote 0
Top