Datagrid scroller interfering with other cards

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
KimD
Posts: 223
Joined: Wed Jul 08, 2015 5:51 am
Location: Wellington, New Zealand

Datagrid scroller interfering with other cards

Post by KimD » Wed May 15, 2019 8:16 am

LC 9.0.4 --- Android 8.1.0

1) I create and populate a datagrid table on card AAA. In the data grid's custom properties I set the vertical scrollbar to true.
- On windows the scroller works as-is
- On Android the scroller works as-is while I stay on the card that the data grid is on.

2) But, when on Android I navigate to:
card BBB - about 10% of the time I get a "ghost" vertical scrollbar appearing in the location where it was on card AAA
card CCC, which includes a mobileControlCreate scroller - about 70% of the time the mobile scroller isn't displayed

Some of the things that I've tried

3) In the data grid's custom properties, setting the vertical scrollbar to false. When I do this both of the problems identified in point 2 stop occurring. But, of course, I can't scroll my datagrid.

4) Testing the mobileControls() on each card. Nothing unexpected shows up. Card BBB shows zero mobileControls, even while the ghost scrollbar is visible. Card CCC shows only the mobileControl that I had created for that card.

5) Testing the mobileControlGet(MyScrollerID, "visible") on card CCC. This returns true, even when no scrollbar is visible.

6) Testing the rect and contentRect of the he mobileControl on card CCC. These look normal.

7) Setting dgProps["show vscrollbar"] to false on CloseCard AAA, and true on OpenCard AAA. This improved things. I ended up with less ghost scrollbars on Card BBB and less cases of mobileControlCreate scroller not resulting in a scroller on card CCC, but both of these things still did occur.

8) Abandoning the datagrids built in scrollbar function entirely, and instead using mobileControlCreate to create a scroller for the datagrid. I've tried two approaches within this:
- keeping the scroll window small (part of the card); and
- scrolling the whole card.
Both approaches worked, but both also resulted in a massive increase in the time that it took to open card AAA. By playing around with the height of the datagrid, I was able to ascertain that the time that it took LC to draw the datagrid was strongly influenced by the footprint of the DG, rather than the contents of the DG.

At the moment, I've almost run out of ideas for things to try. Except that - I have realised that I also have a mobileControlCreate scroller on card AAA (the card that also has the dg scroller). I'll try removing this tommorrow and see if that helps.

Any help would be much appreciated

Regards

Kim

KimD
Posts: 223
Joined: Wed Jul 08, 2015 5:51 am
Location: Wellington, New Zealand

Re: Datagrid scroller interfering with other cards

Post by KimD » Thu May 16, 2019 7:41 am

Today I discovered the problem occurs when selecting a entry in a datagrid is used to trigger a change of card. If the datagrid has focus at the time the "go to card" occurs, then I sometimes get ghost scroll bars appearing on the other card and sometimes get real scroll bars on the other card being "jammed". If I "Focus on nothing" before "Go to card", then the problem goes away. We'll, I'e carried out over 100 tests and haven't seen it again so hopefully it's gone away. Once I've finished my current project I'll try to replicate this in a simple stack. If I can then I'll submit a bug report.

KimD
Posts: 223
Joined: Wed Jul 08, 2015 5:51 am
Location: Wellington, New Zealand

Re: Datagrid scroller interfering with other cards

Post by KimD » Thu Jun 27, 2019 12:58 am

I think that I've sorted out what I was doing wrong. I thought that I would be smart and put my mobileControlDelete command immediately before my mobileControlCreate command (and NOT in CloseCard which is what I've seen recommended). That way I could be sure that I was always starting anew. No stray mobileControllers would be in-use. That was my (now proven to be incorrect) reasoning at the time.

What I had not thought about is that behind the scenes data grids would also be creating mobile native scrollers. At least, that's what they seem to be doing. Mobile native scrollers just appear on my "out-of-the-box" data grids. I'm not complaining. This is a nice feature.

I was deleting my existing mobile native scrollers before I set up new mobile native scrollers; and not on CloseCard. So my mobile native scrollers were still in existence at the time when the data grid created it's mobile native scrollers.
- this does not seem to cause any problems for the data grid creating, displaying and operating it's mobile native scroller; but
- this does seem to cause a problem for the data grid cleaning up it's mobile native scroller. The data grid's scrollers start appearing in ghost form on other cards.

That's what I think is happening. I can only re-produce my "ghost data grid scrollers" problem when I don't delete my own mobile native scrollers on closeCard.

Demo stack is attached.
Attachments
GhostScrollers3.7z
(14.06 KiB) Downloaded 195 times

Post Reply

Return to “Android Deployment”