J jtare Active Member Licensed User Longtime User Oct 22, 2018 #1 Recently I experienced a really weird behavior when the activity load the layout. Sometimes, randomly, the layout will load with very big text size and views, some views even appear half outside of the screen, making it impossible to use. This issue happens when the app is opened after being a long time without use, a few hours or 1 day. Usually when opened from a notification. But in general is very random and almost never happens, most of the time it loads the layout perfectly. The problem persist when starting a new activity. The "solution" is to clear the app from the recent apps list and open it again. Have someone experienced something similar? Here are some screenshots: Normal behavior: Issue:
Recently I experienced a really weird behavior when the activity load the layout. Sometimes, randomly, the layout will load with very big text size and views, some views even appear half outside of the screen, making it impossible to use. This issue happens when the app is opened after being a long time without use, a few hours or 1 day. Usually when opened from a notification. But in general is very random and almost never happens, most of the time it loads the layout perfectly. The problem persist when starting a new activity. The "solution" is to clear the app from the recent apps list and open it again. Have someone experienced something similar? Here are some screenshots: Normal behavior: Issue:
Erel B4X founder Staff member Licensed User Longtime User Oct 22, 2018 #2 Are you using 'dip' units or percentage in Process_Globals? Upvote 0
J jtare Active Member Licensed User Longtime User Oct 22, 2018 #3 The code for the layout is in Designer -> Script-general, here I use mostly dip units and percentage to get screen width. In Process_Globals I don't set any variable related with the layout design. Upvote 0
The code for the layout is in Designer -> Script-general, here I use mostly dip units and percentage to get screen width. In Process_Globals I don't set any variable related with the layout design.
Erel B4X founder Staff member Licensed User Longtime User Oct 23, 2018 #4 Are you using AppCompat? Is this the standard action / title bar? Upvote 0
J jtare Active Member Licensed User Longtime User Oct 23, 2018 #5 Erel said: Are you using AppCompat? Click to expand... Yes. I use a toolbar as the actionbar Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Oct 23, 2018 #6 Add something like: Code: Copy Activity.Title = GetDeviceLayoutValues In Activity_Resume. What it reports when this issue happens? Upvote 0
Add something like: Code: Copy Activity.Title = GetDeviceLayoutValues In Activity_Resume. What it reports when this issue happens?
J jtare Active Member Licensed User Longtime User Oct 23, 2018 #7 I thought about that too and added: Code: Copy If FirstTime Then MsgboxAsync(GetDeviceLayoutValues,"Layout Values") end if Under Activity_Create. But It shows the same value when the issue happens, 1080 x 1920, scale = 3.0 (480 dpi). I will try it in Activity_Resume, it will take sometime until the issue happens again. I will reply here when I get the value. Upvote 0
I thought about that too and added: Code: Copy If FirstTime Then MsgboxAsync(GetDeviceLayoutValues,"Layout Values") end if Under Activity_Create. But It shows the same value when the issue happens, 1080 x 1920, scale = 3.0 (480 dpi). I will try it in Activity_Resume, it will take sometime until the issue happens again. I will reply here when I get the value.
J jtare Active Member Licensed User Longtime User Oct 24, 2018 #8 Erel said: What it reports when this issue happens? Click to expand... Here are the results: In Activity_Create: 1080 x 1920, scale = 3.0 (480 dpi) (DialogBox) In Activity_Resume: 1080 x 1920, scale = 3.0 (480 dpi) (Activity title) Upvote 0
Erel said: What it reports when this issue happens? Click to expand... Here are the results: In Activity_Create: 1080 x 1920, scale = 3.0 (480 dpi) (DialogBox) In Activity_Resume: 1080 x 1920, scale = 3.0 (480 dpi) (Activity title)
Erel B4X founder Staff member Licensed User Longtime User Oct 24, 2018 #9 Maybe the activity size is not correct. Repeat the test with MsgboxAsync($"${100%x} x ${100%y}"$, ""). Upvote 0
Maybe the activity size is not correct. Repeat the test with MsgboxAsync($"${100%x} x ${100%y}"$, "").
J jtare Active Member Licensed User Longtime User Oct 25, 2018 #10 The issue have not showed up today, I will reply as soon as it shows up with the activity size values. Upvote 0
The issue have not showed up today, I will reply as soon as it shows up with the activity size values.
J jtare Active Member Licensed User Longtime User Oct 27, 2018 #11 Update: The issue have not showed up yet, although it wouldn't be accurate saying that the issue is gone since no changes were made. If the issue shows up again I will post here with the layout values. Upvote 0
Update: The issue have not showed up yet, although it wouldn't be accurate saying that the issue is gone since no changes were made. If the issue shows up again I will post here with the layout values.
J jtare Active Member Licensed User Longtime User Oct 30, 2018 #12 Update: Erel said: Repeat the test with MsgboxAsync($"${100%x} x ${100%y}"$, "") Click to expand... I get the same value (1080 x 1848) Upvote 0
Update: Erel said: Repeat the test with MsgboxAsync($"${100%x} x ${100%y}"$, "") Click to expand... I get the same value (1080 x 1848)
woniol Active Member Licensed User Longtime User Oct 30, 2018 #13 I think it's similar to my problem described here: https://www.b4x.com/android/forum/threads/1dip-value-calculation-problem.98817/ started here: https://www.b4x.com/android/forum/threads/1dip-calculation.98422/ For me it looks like a problem with 1dip value calculation. It' very rare in my case and very difficut to trace, even catch the logs So far no solution.... Upvote 0
I think it's similar to my problem described here: https://www.b4x.com/android/forum/threads/1dip-value-calculation-problem.98817/ started here: https://www.b4x.com/android/forum/threads/1dip-calculation.98422/ For me it looks like a problem with 1dip value calculation. It' very rare in my case and very difficut to trace, even catch the logs So far no solution....
J jtare Active Member Licensed User Longtime User Oct 30, 2018 #14 woniol said: I think it's similar to my problem described here: Click to expand... Thanks for the links. I will log the 1dip value to see if changes. I'm also using a Samsung device, but I had never gotten this error in any other app tested in the same device. What is causing this error could be samsung related? Upvote 0
woniol said: I think it's similar to my problem described here: Click to expand... Thanks for the links. I will log the 1dip value to see if changes. I'm also using a Samsung device, but I had never gotten this error in any other app tested in the same device. What is causing this error could be samsung related?
woniol Active Member Licensed User Longtime User Oct 30, 2018 #15 Do you use AHViewPager(3.0) library in your app? Upvote 0
J jtare Active Member Licensed User Longtime User Oct 30, 2018 #16 woniol said: Do you use AHViewPager(3.0) library in your app? Click to expand... No I don't. What I am using that I think could cause the issue because I never used them before are AHSwipeToRefresh, MPAndroidCharts and AS BottomMenu (class). Upvote 0
woniol said: Do you use AHViewPager(3.0) library in your app? Click to expand... No I don't. What I am using that I think could cause the issue because I never used them before are AHSwipeToRefresh, MPAndroidCharts and AS BottomMenu (class).
woniol Active Member Licensed User Longtime User Oct 30, 2018 #17 jtare said: No I don't. What I am using that I think could cause the issue because I never used them before are AHSwipeToRefresh, MPAndroidCharts and AS BottomMenu (class). Click to expand... None of them used in my app Upvote 0
jtare said: No I don't. What I am using that I think could cause the issue because I never used them before are AHSwipeToRefresh, MPAndroidCharts and AS BottomMenu (class). Click to expand... None of them used in my app
Erel B4X founder Staff member Licensed User Longtime User Oct 31, 2018 #18 See my answer here: https://www.b4x.com/android/forum/threads/1dip-value-calculation-problem.98817/#post-622438 This is probably the cause of this issue. Upvote 0
See my answer here: https://www.b4x.com/android/forum/threads/1dip-value-calculation-problem.98817/#post-622438 This is probably the cause of this issue.
J jtare Active Member Licensed User Longtime User Nov 1, 2018 #19 woniol said: For me it looks like a problem with 1dip value calculation Click to expand... I just confirmed I have the same issue (1dip calculation). In the attached image the values that changed are marked with an arrow "-->" Upvote 0
woniol said: For me it looks like a problem with 1dip value calculation Click to expand... I just confirmed I have the same issue (1dip calculation). In the attached image the values that changed are marked with an arrow "-->"
Erel B4X founder Staff member Licensed User Longtime User Nov 2, 2018 #20 Have you checked the code in all the process global subs? Upvote 0