woniol Active Member Licensed User Longtime User Oct 19, 2018 #1 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: Oct 19, 2018
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?
Erel B4X founder Staff member Licensed User Longtime User Oct 19, 2018 #2 (Better to check the value of GetDeviceLayoutValues.Scale as 1dip is rounded to an integer.) Make sure not to use DIP units in Process_Globals. This is the only place where it might not yet be correct. Upvote 0
(Better to check the value of GetDeviceLayoutValues.Scale as 1dip is rounded to an integer.) Make sure not to use DIP units in Process_Globals. This is the only place where it might not yet be correct.
woniol Active Member Licensed User Longtime User Oct 19, 2018 #3 Can something change it later, so that it's not correct in Activity_Start? I uploaded the screenshots to show how it looks. Upvote 0
Can something change it later, so that it's not correct in Activity_Start? I uploaded the screenshots to show how it looks.
Erel B4X founder Staff member Licensed User Longtime User Oct 19, 2018 #4 The value is set once when the program starts. What is the output of Log(GetDisplayLayouyValues) when this error happens? Upvote 0
The value is set once when the program starts. What is the output of Log(GetDisplayLayouyValues) when this error happens?
woniol Active Member Licensed User Longtime User Oct 19, 2018 #5 I will log it and let know the results. So far I have this: Code: 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
I will log it and let know the results. So far I have this: Code: 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.
woniol Active Member Licensed User Longtime User Oct 19, 2018 #6 When it's ok Code: 1440 x 2560, scale = 4.0 (640 dpi) is logged with Code: Log(GetDeviceLayoutValues) Upvote 0
When it's ok Code: 1440 x 2560, scale = 4.0 (640 dpi) is logged with Code: Log(GetDeviceLayoutValues)